Michael Grant <[EMAIL PROTECTED]> wrote:
> If I'm sued as root and I ssh somewhere, ssh/scp reads it's files from
> /root/.ssh/.  The docs say it reads from ~/.ssh which is what I want,
> but it's not doing that.  When sued, the shell is properly expanding ~
> to my home dir.
> 
> Anyone know of a way around this behavior?

man su says:
| By default, the environment is unmodified with the exception of USER,
| HOME, and SHELL.  HOME and SHELL are set to the target login's default
| values.  USER is set to the target login, unless the target login has a
| user ID of 0, in which case it is unmodified.  The invoked shell is the
| one belonging to the target login. 

So if you are sued as root, $HOME is set to /root - that's why ssh reads
its configuration from /root/.ssh/

So perhaps you want to try "su -m" as the manpage says:
| -m      Leave the environment unmodified.

HTH,

Michael



_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to