Solved

Raspberry Pi SSH/Putty login scripts, which

Posted on 2016-10-26
1
60 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
1 Comment
 
LVL 28

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

Secure Shell (SSH) is a network protocol for secure data communication, mainly used to administer remote Unix / Linux servers via command line. But it also allows the user to open a secure tunnel between a client and a server where he can send any k…
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

863 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now