?
Solved

Raspberry Pi SSH/Putty login scripts, which

Posted on 2016-10-26
1
Medium Priority
?
157 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 30

Accepted Solution

by:
serialband earned 2000 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

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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

777 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