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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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
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
omarfaridCommented:
Then try what I wrote to add to /etc/profile & /etc/bash.bashrc
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

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
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
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
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

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
omarfaridCommented:
Welcome
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.