bashrc and .profile for password-less ssh

shantanu pavgi shantanu.uab at gmail.com
Thu Sep 2 18:55:14 UTC 2010


Thanks all for explaining it in detail. Fixed and it worked..

--
Shantanu.


On Thu, Sep 2, 2010 at 11:39 AM, Nils Kassube <kassube at gmx.net> wrote:

> shantanu pavgi wrote:
> > I am having some issue in executing in setting values in .bashrc file
> > on ssh based command execution. If I log in using SSH then bashrc is
> > sourced and settings in it work.  But following doesn't work and
> > returns no value:
> > {{{
> > inode:~ shantanu$ ssh 192.168.174.129 "echo $CATALINA_HOME"
> > }}}
>
> Well, that command passes the value of CATALINA_HOME of your local
> machine to the ssh command which is probably not what you want. You need
> single quotes instead of double quotes or you could escape the $ with a
> backslash because now the $CATALINA_HOME is expanded by your local shell
> before it is passed to the ssh command.
>
> Due to the end of your .bashrc file I suppose you want to see the value
> set by that file. Your second problem is at the start of the file where
> it checks if it is an interactive shell and returns if it isn't.
>
> > # If not running interactively, don't do anything
> > [ -z "$PS1" ] && return
>
> You can set PS1 and then source .bashrc with something like this:
>
> ssh 192.168.174.129 'PS1=\$ . $HOME/.bashrc;echo $CATALINA_HOME'
>
>
> Nils
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20100902/18f8ebe4/attachment.html>


More information about the ubuntu-users mailing list