1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can I execute some commands when starting ssh session before getting to interactive mode?

Discussion in 'Main Forum' started by taw, Oct 8, 2018.

  1. taw

    taw Guest

    When starting ssh session with ssh command I seem to have two options - default interactive session with default env and starting from home directory - or to execute arbitrary command but non-interactively (even tricks like ssh "command; command; bash -i -l" don't seem to do much good). Quite often I want interactive session, but with something happening before that - normally a directory change, or sometimes system environment adjustment. These things would vary from session to session, so I cannot just stick them into .bashrc or so.

    Is there any way to make that happen?

    Login To add answer/comment
     

Share This Page