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

后端 未结 4 1838
别跟我提以往
别跟我提以往 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-16 00:28

    I tried what I suggested in my previous answer.

    It is possible to run 2 simple commands in putty separated by a semicolon. As in my example I tried with ls and echo. The remote server runs them and then the session closes.

    I also tried to ssh to a remote server that is configured for not asking for a password. In that case, it also works, I get connected to the 2nd server and I can run commands on it. Upon exit, the 2 connections are closed.

    So please, let us know what you actually need / want.

提交回复
热议问题