"리눅스 ssh-copy-id"의 두 판 사이의 차이

2번째 줄: 2번째 줄:
;리눅스 ssh-copy-id
;리눅스 ssh-copy-id
;/usr/bin/ssh-copy-id
;/usr/bin/ssh-copy-id
*로컬서버의 공개키를 다른서버에 배포하는 명령어
*로컬서버의 공개키를 원격서버에 배포하는 명령어


==실행예시 1==
==실행예시 1==
<source lang='dos'>
<source lang='dos'>
[root@jmnote ~]# ssh-copy-id testuser@123.45.67.101
testuser@123.45.67.101's password:
</source>
</source>
:→ 원격서버 testuser의 패스워드 입력
<source lang='dos'>
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.
</source>
:→ 로컬서버의 공개키를 testuser 홈 폴더 아래에 배포했음
:→ 원격서버 /home/testuser/.ssh/authorized_keys 에서 확인가능


==실행예시 2: sshpass와 조합 사용==
==실행예시 2: sshpass와 조합 사용==
<source lang='dos'>
<source lang='dos'>
[root@jmnote ~]# sshpass -p"P@ssw0rd" ssh-copy-id root@123.45.67.89
[root@jmnote ~]# sshpass -p"P@ssw0rd" ssh-copy-id testuser@123.45.67.102
Now try logging into the machine, with "ssh 'root@123.45.67.89'", and check in:
Now try logging into the machine, with "ssh 'testuser@123.45.67.89'", and check in:


   .ssh/authorized_keys
   .ssh/authorized_keys

2014년 9월 4일 (목) 15:05 판

1 개요

리눅스 ssh-copy-id
/usr/bin/ssh-copy-id
  • 로컬서버의 공개키를 원격서버에 배포하는 명령어

2 실행예시 1

[root@jmnote ~]# ssh-copy-id testuser@123.45.67.101
testuser@123.45.67.101's password:
→ 원격서버 testuser의 패스워드 입력
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.
→ 로컬서버의 공개키를 testuser 홈 폴더 아래에 배포했음
→ 원격서버 /home/testuser/.ssh/authorized_keys 에서 확인가능

3 실행예시 2: sshpass와 조합 사용

[root@jmnote ~]# 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 같이 보기

5 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}