Is it possible to run multiple command with remote command option in putty?

后端 未结 4 1877
别跟我提以往
别跟我提以往 2021-01-15 23:46

I want to run multiple commands automatically like sudo bash, ssh server01, ls , cd /tmp etc at server login.. I am using Remote command option under SSH in putty.

I

4条回答
  •  孤独总比滥情好
    2021-01-16 00:15

    You can execute two consecutive commands in PuTTY using a regular shell syntax. E.g. using ; or &&.


    But you want to execute ssh server01 in sudo bash shell, right?

    These are not two consecutive commands, it's ssh server01 command executed within sudo bash.

    So you have to use a sudo command-line syntax to execute the ssh server01, like

    sudo bash ssh server01
    

提交回复
热议问题