SSH를 통해 연결할 때 Putty 명령을 자동으로 실행하는 방법은 무엇입니까? [폐쇄]

SSH를 통해 연결할 때 Putty 명령을 자동으로 실행하는 방법은 무엇입니까? [폐쇄]

거기에는 두 개의 파일이 있습니다. SSH 포트 연결에서 cmds.txt cmd를 실행하고 싶습니다. Putty를 사용하여 txt 파일을 실행하는 방법

이것이 sv.bat(배치 파일)이라고 가정하면

배치 파일 안에 cmds가 포함된 txt 파일이 있습니다.

start C:\USERS\putty\putty.exe -ssh 10.15.12.12  -m C:\USERS\cmds.txt

cmds.txt

login
password

답변1

txt 파일을 만든 후에는 다음을 만들어야 합니다.박쥐파일을 저장하거나 CMD 프롬프트에 다음을 입력하세요.

  • ssh.cmd
  • @echo on[무슨 일이 일어났는지 봐]
  • [PuTTY 설치로 이동합니다. ]cd C:\Program Files\Putty
  • 시작putty.exe -ssh [domain name] -l [username] -pw [password] -m [the directory of the .txt file you created which contains the codes you want to be executed]

-m옵션이 작동하지 않으면 대신 (PuTTY 백엔드의 명령줄 인터페이스)를 사용해야 합니다 plink.exe.putty.exe

-m file   read remote command(s) from file

당신은부터 시작합니다PuTTY 다운로드 페이지

관련 정보