I am specifying path to my command in the file /etc/profile:export PATH=$PATH:/usr/app/cpn/binMy command is located in:$ which ydisplay /usr/app/cpn/bin/ydisplaySo, when I performing echo $PATH output is looks like:$ echo $PATH...:/usr/app/cpn/binAnd  everything is OK, but when I am trying to launch my command via SSH I am getting error:$ ssh 127.0.0.1 ydisplay$ bash: ydisplay: command not foundBut the my path is still present:$ ssh 127.0.0.1 echo $PATH...:/usr/app/cpn/binPlease explain me why Bash unable to find ydisplay during SSH session and how to properly configurate SSH to avoid this issue.More over, if I specifying $PATH in local file .bashrc in the current user all works correctly. But I want to modify only one file instead specifying a lot of files for each user. This is why I am asking. 
Why Bash unable to find command even if $PATH is specified properly?
linux;bash;shell;ssh;path
tl;drRunning ssh 127.0.0.1 ydisplay sources ~/.bashrc rather than /etc/profile.  Change your path in ~/.bashrc instead.detailsThe only time /etc/profile is read is when your shell is a login shell.From the Bash Reference Manual:When bash is invoked as a login shell, ... it first reads and executes commands from the file /etc/profileBut when you run ssh 127.0.0.1 ydisplay, bash is not started as a login shell.  Yet it does read a different startup file.  The Bash Reference Manual says:when ... executed by ... sshd. ... it reads and executes commands from ~/.bashrcSo you should put your PATH settings in ~/.bashrc.On most systems, ~/.bash_profile sources ~/.bashrc, so you can put your settings only in ~/.bashrc rather than putting them in both files.There's no standard way to change the setting for all users, but most systems have a /etc/bashrc, /etc/bash.bashrc, or similar.Failing that, set up pam_env and put the PATH setting in /etc/environment.See also:What's the conf file reading between login and non-login shell?Is there a .bashrc equivalent file read by all shells?