becool

윈도우터미널에서 ssh 암호없이 원격 접속 본문

linux

윈도우터미널에서 ssh 암호없이 원격 접속

gusalstm 2021. 7. 15. 09:34
반응형

윈도우에서 키젠하고 ssh-copy-id 명령어가 없으므로

아래내용대로 명령어 입력

 

1) 키젠

PS C:\Users\user\.ssh> ssh-keygen
Generating public/private rsa key pair.

 

2) 공개키 이동복사

PS C:\Users\user\.ssh> type C:\Users\user\.ssh\id_rsa.pub | ssh root@192.168.56.10 "cat >> /root/.ssh/authorized_keys"
root@192.168.56.10's password:
PS C:\Users\user\.ssh> ssh root@192.168.56.10
Last login: Wed Jul 14 20:21:13 2021 from 192.168.56.1

 

 

3) 비밀번호를 계속 물어보면 chmod 600 으로 권한 변경해준다. (필요한 경우 restorecon 도 확인)

[user@ansible-server ~]$ chmod 600 .ssh/authorized_keys
[user@ansible-server ~]$ restorecon -R -v /home/user/.ssh/
[user@ansible-server ~]$ ls -lZ .ssh/
-rw-------. user user unconfined_u:object_r:ssh_home_t:s0 authorized_keys
-rw-r--r--. user user unconfined_u:object_r:ssh_home_t:s0 known_hosts

 

728x90

'linux' 카테고리의 다른 글

20210816 (월) ganar un certificado  (0) 2021.08.16
20210719 (월) time zone 변경  (0) 2021.07.19
20210702 (금) dns - apache - tomcat - db  (0) 2021.07.02
20210629 (화) IP alias  (0) 2021.06.29
20210625 (금) glusterfs, 가상인터페이스 생성  (0) 2021.06.25
Comments