ssh 설정
ssh 접속 설정시 아래 처럼 권한이 등록 되어 있어야 한다.
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
chmod 644 ~/.ssh/authorized_keys
chmod 644 ~/.ssh/known_hosts
- 키 교환을 원하는 각 서버 계정으로 접속한다.
- ssh-keygen 사용
ssh-keygen
# Generating public/private rsa key pair.
# Enter file in which to save the key (/home/jsmith/.ssh/id_rsa):[엔터키]
# Enter passphrase (empty for no passphrase): [엔터키]
# Enter same passphrase again: [엔터키]
# Your identification has been saved in /home/jsmith/.ssh/id_rsa.
# Your public key has been saved in /home/jsmith/.ssh/id_rsa.pub.
# The key fingerprint is:
- ssh-copy-id
ssh-copy-id -i ~/.ssh/id_rsa.pub 원격아이디@IP or HOST
- ssh 확인
ssh 원격아이디@IP or HOST