Solved

Raspberry Pi SSH/Putty login scripts, which

Posted on 2016-10-26
1
99 Views
Last Modified: 2016-10-26
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
Comment
Question by:zzhang2006
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 29

Accepted Solution

by:
serialband earned 500 total points
ID: 41861412
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
Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
configuration questions on my cisco router 11 114
read remote file without password 6 174
Edit file on Server 4 75
Out of band question 2 68
We all know how boring and exhausting it is to transfer huge web projects developed locally to a webserver simply via FTP. The File Transfer Protocol is a really nice solution if you need to transfer small amounts of files, but if you're plannin…
Hello to you all, I hear of many people congratulate AWS (Amazon Web Services) on how easy it is to spin up and create new EC2 (Elastic Compute Cloud) instances, but then fail and struggle to connect to them using simple tools such as SSH (Secure…
Viewers will learn how to properly install and use Secure Shell (SSH) to work on projects or homework remotely. Download Secure Shell: Follow basic installation instructions: Open Secure Shell and use "Quick Connect" to enter credentials includi…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question