?
Solved

PATH in Linux/Unix

Posted on 2014-09-02
8
Medium Priority
?
422 Views
Last Modified: 2014-09-18
Hi,


I have a service account (Joe_Tester) and I am trying to set the paths, ld_path.  The account does not have a login so how can I set this under su?

Thanks
0
Comment
Question by:Jack_son_
8 Comments
 
LVL 12

Assisted Solution

by:Kent W
Kent W earned 336 total points
ID: 40299469
in /etc/passwd

Replace the users login path with whatever you want.
joe_Tester:x:501:501::/home/joe_Tester:/bin/bash
to
joe_Tester:x:501:501::/path/you/want/joe_Tester:/bin/bash
0
 
LVL 22

Assisted Solution

by:mcsween
mcsween earned 332 total points
ID: 40299492
You can do this system wide
sudo nano /etc/pfofile.d/myenv.sh

Open in new window

Add this line to the file to append the path environment variable (you can set any you like the same way)
export PATH=$PATH:/path/you/want/to/append

Open in new window

0
 
LVL 20

Assisted Solution

by:simon3270
simon3270 earned 1000 total points
ID: 40299536
You can set environment variables for an individual user (assumin ghtey are using bash or sh as their shell) with:

nano ~user_name/.bashrc

(or vi or whatever you are conmfortable with - that's a tilde before the user_name)

and add the line

    export LD_PATH=/lib/whatever:/usr/lib/secondlib

(do you mean LD_LIBRARY_PATH?)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 332 total points
ID: 40300309
when you say "The account does not have a login" do you mean no login shell or no login home dir or password not known?

How you intend to use su for this user?
0
 

Author Comment

by:Jack_son_
ID: 40300838
yes, the LD_LIBRARY_PATH
0
 
LVL 20

Assisted Solution

by:simon3270
simon3270 earned 1000 total points
ID: 40302207
I think we are still unclear by what you mean by "no login".  what does the /etc/passwd entry for this user look like?  Do they have no shell entry, or an unavailable password (so they can't log in)?

Assuming it's just that they do not have a valid password, my ~/.bashrc fix (with
     export LD_LIBRARY_PATH=/lib/whatever:/usr/lib/secondlib
) will be fine for bash, or add it to ~/.profile if you are using /bin/sh - a look at your /etc/passwd line will tell us which shell you are using.
0
 
LVL 85

Expert Comment

by:ozo
ID: 40302260
If they have no login, who or what would be using the path?
0
 
LVL 20

Accepted Solution

by:
simon3270 earned 1000 total points
ID: 40303706
@ozo, I think we're assuming that "service account" means something that is a normal user, but the password is locked so that they can't log in normally.  For example, the daemon, statd and syslog users on some Linuxes, which run varous processes.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Fine Tune your automatic Updates for Ubuntu / Debian
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month16 days, 12 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question