![SSH를 통해 연결할 때 Putty 명령을 자동으로 실행하는 방법은 무엇입니까? [폐쇄]](https://linux55.com/image/8389/SSH%EB%A5%BC%20%ED%86%B5%ED%95%B4%20%EC%97%B0%EA%B2%B0%ED%95%A0%20%EB%95%8C%20Putty%20%EB%AA%85%EB%A0%B9%EC%9D%84%20%EC%9E%90%EB%8F%99%EC%9C%BC%EB%A1%9C%20%EC%8B%A4%ED%96%89%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95%EC%9D%80%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F%20%5B%ED%8F%90%EC%87%84%5D.png)
거기에는 두 개의 파일이 있습니다. 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 다운로드 페이지