Link to home
Start Free TrialLog in
Avatar of AXISHK
AXISHK

asked on

set path available to all users in Linux

How to add a path in linux that it can be available for everyone ? Actually, i what any user can access a file under \autossh1.4\autossh

Tks
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

The question is not clear. Are trying to make available to all user as there is a command there to be used by all, you you want to give access permission to  it?

If it is to add to PATH, then add

PATH=$PATH:/autossh1.4/autossh ; export PATH

to

/etc/profile
/etc/bash.bashrc
Avatar of AXISHK
AXISHK

ASKER

I want the first one,

ie make available to all user as there is a command there to be used by all..

Tks
Then try what I wrote to add to /etc/profile & /etc/bash.bashrc
Avatar of AXISHK

ASKER

So, I need to configure both file, correct ?

Can you give me some idea how a command should be written in both file :

ssh -fNg -L 3306:localhost:3306 sciadm@mysqlserver
The above command can be stored in file e.g.

echo 'ssh -fNg -L 3306:localhost:3306 sciadm@mysqlserver' > /autossh1.4/autossh/myautossh

make it executable:

chmod +x /autossh1.4/autossh/myautossh

Then you can add the path as I mentioned earlier
Avatar of AXISHK

ASKER

There are some contents inside the file (eg. if ... fi. ) . Do you mean just add a single line "/autossh1.4/autossh/myautossh" at the end of the file /etc/profile ?


I can't find a file named /etc/bash.bashrc. What's the purpose of these two files ? Should I need to add both ?

Tks
ASKER CERTIFIED SOLUTION
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AXISHK

ASKER

Tks
Welcome