Solved

Raspberry Pi SSH/Putty login scripts, which

Posted on 2016-10-26
1
29 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 27

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

Join & Write a Comment

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…
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

759 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

22 Experts available now in Live!

Get 1:1 Help Now