편집을 취소할 수 있습니다. 이 편집을 되돌리려면 아래의 바뀐 내용을 확인한 후 게시해주세요.
최신판 | 당신의 편집 | ||
2번째 줄: | 2번째 줄: | ||
;리눅스 ssh-copy-id | ;리눅스 ssh-copy-id | ||
;/usr/bin/ssh-copy-id | ;/usr/bin/ssh-copy-id | ||
* 로컬서버의 공개키를 원격서버에 배포하는 명령어 | *로컬서버의 공개키를 원격서버에 배포하는 명령어 | ||
* 로컬서버의 [[~/.ssh/id_rsa.pub]] 파일 내용을 원격서버의 [[~/.ssh/authorized_keys]] 파일에 추가하는 명령어 | *로컬서버의 [[~/.ssh/id_rsa.pub]] 파일 내용을 원격서버의 [[~/.ssh/authorized_keys]] 파일에 추가하는 명령어 | ||
:원격서버에 authorized_keys 파일이 없다면 생성되고, 있다면 파일내용에 추가된다. | :원격서버에 authorized_keys 파일이 없다면 생성되고, 있다면 파일내용에 추가된다. | ||
==실행예시 1== | ==실행예시 1== | ||
<source lang=' | <source lang='dos'> | ||
[root@ | [root@jmnote ~]# ssh-copy-id testuser@123.45.67.101 | ||
testuser@123.45.67.101's password: | testuser@123.45.67.101's password: | ||
</source> | </source> | ||
:→ 원격서버 testuser의 패스워드 입력 | :→ 원격서버 testuser의 패스워드 입력 | ||
<source lang=' | <source lang='dos'> | ||
Now try logging into the machine, with "ssh 'testuser@123.45.67.101'", and check in: | Now try logging into the machine, with "ssh 'testuser@123.45.67.101'", and check in: | ||
19번째 줄: | 19번째 줄: | ||
to make sure we haven't added extra keys that you weren't expecting. | to make sure we haven't added extra keys that you weren't expecting. | ||
</source> | </source> | ||
:→ 로컬서버의 공개키<ref>[[/root/.ssh/id_rsa.pub]]</ref>를 원격서버의 testuser 홈 폴더 아래 특정위치<ref>[[ | :→ 로컬서버의 공개키<ref>[[/root/.ssh/id_rsa.pub]]</ref>를 원격서버의 testuser 홈 폴더 아래 특정위치<ref>[[/home/testuser/.ssh/authorized_keys]]</ref>에 배포했음 | ||
==실행예시 2: sshpass와 조합 사용== | ==실행예시 2: sshpass와 조합 사용== | ||
<source lang=' | <source lang='dos'> | ||
[root@ | [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: | Now try logging into the machine, with "ssh 'testuser@123.45.67.89'", and check in: | ||
35번째 줄: | 35번째 줄: | ||
*[[리눅스 ssh-keygen]] | *[[리눅스 ssh-keygen]] | ||
*[[리눅스 sshpass]] | *[[리눅스 sshpass]] | ||
==참고== | ==주석== | ||
<references/> | |||
==참고 자료== | |||
*http://snoopybox.co.kr/m/post/1734 | *http://snoopybox.co.kr/m/post/1734 | ||
[[분류: SSH]] | [[분류: SSH]] | ||
[[분류: /usr/bin]] | [[분류: /usr/bin]] |