SSH
키 생성
ssh-keygen -t ed25519 -N "" -C "your_email@example.com" -f <path>
ssh-keygen -t rsa -b 2048 -N "" -C "your_email@example.com" -f <path>
config
~/.ssh/config
또는 /etc/ssh/ssh_config
파일에 아래 설정을 추가할 수 있습니다.
Host <alias>
HostName <host>
User <user>
PreferredAuthentications publickey
IdentityFile <path>
AddKeysToAgent yes
ssh agent 실행
eval "$(ssh-agent -s)"
키 등록
ssh-add ~/.ssh/<id file>
퍼블릭 키 접속할 곳에 등록
ssh-copy-id -i ~/.ssh/<id file>.pub <remote>
SCP
source를 target으로 보낼 수 있는 명령어입니다.
원격지의 경우 \<user>@\<ip>:\<path> 로 구성됩니다.
scp [options] <source> <target>
파일 권한
sudo chmod 700 ~/.ssh
sudo chmod 600 ~/.ssh/*
danger
파일 접근 권한은 로컬과 원격 모두 설정되어 있어야 합니다.