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
AXISHKAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

omarfaridCommented:
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
0
AXISHKAuthor Commented:
I want the first one,

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

Tks
0
omarfaridCommented:
Then try what I wrote to add to /etc/profile & /etc/bash.bashrc
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

AXISHKAuthor Commented:
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
0
omarfaridCommented:
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
0
AXISHKAuthor Commented:
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
0
omarfaridCommented:
To make new command:

- create a file (e.g. using vi editor) in the directory of your choice, e.g. /bin
- put what ever statements you need in that file. It could be a shell script
- make the file executable using chmod command
- if the dir where you created the file is not in PATH then add it as shown above and add to /etc/profile

please see link below for use of files:

http://unix.stackexchange.com/questions/187369/when-is-etc-bash-bashrc-invoked
http://stefaanlippens.net/bashrc_and_others
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AXISHKAuthor Commented:
Tks
0
omarfaridCommented:
Welcome
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.