freebsd: configure a different default directory

When I ssh right into my freebsd I intend to be instantly in an additional directory site, and also not my home directory.

I.e. as opposed to /users/home/john I intend to remain in /users/home/john/what/i/am/working/on

2022-06-07 14:36:08
Source Share
Answers: 3

So the most basic instance of this is rather very easy. In your ~ jdoe/. account you can add:

if [ X$SSH_TTY != X ]; then
   cd /users/home/john/what/i/am/working/on

If you are seeking the system to bear in mind which directory site you remain in, per - incurable, and also return to the appropriate one when you log back know that incurable, that is extra intricate yet still do - able with covering. Given that $SSH_TTY is a filename, you can prepend " ~/. mydirs/" to it, and also make use of that filename to hold a duplicate of the CWD for the session of that incurable. It is extra intricate than that, yet this is the basic suggestion.

Hope this helps!ยข - pbr

2022-06-28 22:08:40

ssh -t [email protected] 'cd /tmp && exec /bin/sh'
2022-06-28 20:23:14
ssh [email protected]:/path/to/wherever

notification the colon ^

2022-06-07 14:59:00