1 개요[ | ]
- 리눅스 ssh-copy-id
- /usr/bin/ssh-copy-id
- 로컬서버의 공개키를 원격서버에 배포하는 명령어
- 로컬서버의 ~/.ssh/id_rsa.pub 파일 내용을 원격서버의 ~/.ssh/authorized_keys 파일에 추가하는 명령어
- 원격서버에 authorized_keys 파일이 없다면 생성되고, 있다면 파일내용에 추가된다.
2 실행예시 1[ | ]
Console
Copy
[root@zetawiki ~]# ssh-copy-id testuser@123.45.67.101
testuser@123.45.67.101's password:
- → 원격서버 testuser의 패스워드 입력
Console
Copy
Now try logging into the machine, with "ssh 'testuser@123.45.67.101'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
3 실행예시 2: sshpass와 조합 사용[ | ]
Console
Copy
[root@zetawiki ~]# sshpass -p"P@ssw0rd" ssh-copy-id testuser@123.45.67.102
Now try logging into the machine, with "ssh 'testuser@123.45.67.89'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
4 같이 보기[ | ]
- 리눅스 SSH 자동 로그인
- 리눅스 ssh-keygen
- 리눅스 sshpass
- PHP Warning: ssh2_auth_pubkey_file(): Authentication failed for