• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 183
  • Last Modified:

Raspberry Pi SSH/Putty login scripts, which

I have a  .bashrc script at  /home/pi, but it doesn't get to run if I remotely connect to the Pi with Putty/SSH.
The .bashrc script only automatically run at the teminal, not remotely through SSH Shell. My question is then what is the ssh login script for the remote SSH shell?    I tried, as some suggested,  ~/.ssh/rc,  no luck.

Thanks

ZZ
0
zzhang2006
Asked:
zzhang2006
1 Solution
 
serialbandCommented:
Bash has Login and Non-Login shells as well as interactive and non-interactive shells.  There are basically 4 combinations of logins.  One version uses .bashrc and the other loads .bash_profile.  I suggest you just hardlink .bash_profile to .bashrc and you should be loading the same environment variables when you connect remotely or when you connect at the terminal.

The following links explain them more clearly, but for most people, it's much easier to keep the shells the same by hard linking .bashrc to .bash_profile and loading the same environment regardless of how you log in.
https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html
http://tldp.org/LDP/abs/html/intandnonint.html
http://www.linuxfromscratch.org/blfs/view/svn/postlfs/profile.html
0
Tackle projects and never again get stuck behind a technical roadblock.
Join Now