How to automatically define functions and aliases on remote server after ssh login

Posted by Ramon on Server Fault See other posts from Server Fault or by Ramon
Published on 2012-06-09T14:32:50Z Indexed on 2012/06/09 16:42 UTC
Read the original article Hit count: 309

Filed under:
|
|

I want to define bash functions and aliases in my remote shell automatically on login. I can't put the definitions into .profile or similar because the users I log in as are often shared with others who use the same systems and I don't have control of this. What I'm trying to do is execute a few bash function definitions in the remote process and then continue as a login shell. I tried this but it did not work:

cat ~/.profile - | ssh -tt user@host bash -l

Any ideas?

© Server Fault or respective owner

Related posts about ssh

Related posts about bash