sshrc | Bring your .bashrc, .vimrc, etc. with you when you ssh | SSH library
kandi X-RAY | sshrc Summary
kandi X-RAY | sshrc Summary
sshrc works just like ssh, but it also sources the ~/.sshrc on your local computer after logging in remotely. You can use this to set environment variables, define functions, and run post-login commands. It's that simple, and it won't impact other users on the server - even if they use sshrc too. This makes sshrc very useful if you share a server with multiple users and can't edit the server's ~/.bashrc without affecting them, or if you have several servers that you don't want to configure independently.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of sshrc
sshrc Key Features
sshrc Examples and Code Snippets
Community Discussions
Trending Discussions on sshrc
QUESTION
I want to call a program when any SSH user logs in that prints a welcome message. I did this by editing the /etc/ssh/sshrc
file:
ANSWER
Answered 2021-Jan-05 at 15:51Use test
to check $SSH_TTY
(final solution in this link):
QUESTION
I am trying to setup svn over ssh on an OS X server. In order to do so, I read that I need a wrapper to set umask and - in my case - to set the repository root. A quick and dirty way to do that is to rename /usr/bin/svnserve
and place a wrapper script at that location. However SIP protects that location from any changes, and I would prefer a cleaner solution anyway.
So I created a wrapper script at /usr/local/bin/svnserve
and created /etc/ssh/sshrc
with
ANSWER
Answered 2017-Mar-11 at 17:31/etc/sshrc
does not run in the same shell instance with the remotely-issued command, so the PATH update does not persist through.
Some of the available options:
- You can set
AcceptEnv PATH
on the server to configure it to accept a PATH sent by the remote system, andSendEnv PATH
on the client (in~/.ssh/config
, or as an argument to ssh passed with-o
, or in/etc/ssh/ssh_config
). - In
/etc/ssh/sshd_config
on the server, you can set the optionPermitUserEnvironment
toyes
; with that done, the variable and value can be added to~/.ssh/environment
in the individual user's account on the server. - You can use
ForceCommand
to override the remotely requested command, either with something like/usr/bin/env PATH=/usr/local/bin:/usr/bin:/bin svnserve
or simply/usr/local/bin/svnserve
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sshrc
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page