Start SSH connection in PuTTY, run a command, and leave the session active

后端 未结 2 1701
轮回少年
轮回少年 2020-12-19 12:27

I want to run a few shell commands every time I SSH to a server via PuTTY. I\'m connecting to a production web server managed by someone else, and I don\'t want to store my

2条回答
  •  被撕碎了的回忆
    2020-12-19 13:18

    The SSH session closes (and PuTTY with it) as soon as the command finishes. By default the "command" is a shell. As you have overridden this default "command" and yet you want to run the shell nevertheless, you have to explicitly execute the shell yourself:

    my-command ; /bin/bash
    

    See also Executing a specific command on the server.

提交回复
热议问题