Recent Comments
변군이글루
[linux] SSH Config 설정으로 SSH 간편하게 접속하기 본문
SSH Config 설정으로 SSH 간편하게 접속하기
일반적인 SSH 접속(ssh, scp)
$ ssh -i ~/sshkey/prod.pem ec2-user@111.111.111.111
$ scp -i ~/sshkey/prod.pem ec2-user@111.111.111.111:/abc.txt .
SSH Config 설정
$ touch ~/.ssh/config
$ chmod 600 ~/.ssh/config
SSH Config 편집
$ vim ~/.ssh/config
Host awsserver01
hostname 111.111.111.111
user ec2-user
identityfile "~/sshkey/prod.pem"
port 22
# Host {원격지 서버의 별칭}
# HostName {원격지 서버의 아이피 또는 호스트 주소}
# User {원격지 서버의 계정}
# IdentityFile {프라이빗 키}
# Port {원격지 서버의 ssh 포트}
원격 서버 접속하기(ssh, scp)
$ ssh awsserver01
$ scp awsserver01:/abc.txt .
원격 서버의 별칭이 두 개일 때
$ vim ~/.ssh/config
Host awsserver01 webserver01
hostname 111.111.111.111
user ec2-user
identityfile "~/sshkey/prod.pem"
port 22
원격 서버 접속하기(ssh)
- 다른 별칭으로 동일한 서버에 접속이 가능함.
$ ssh awsserver01
$ ssh webserver01
'* 리눅스' 카테고리의 다른 글
[명령어] htop 명령어 (0) | 2021.01.21 |
---|---|
[명령어] dstat 명령어 (0) | 2021.01.21 |
[linux] SSH Config 설정으로 SSH 간편하게 접속하기 (0) | 2021.01.19 |
[Fabric] fabric hello print on CentOS 7 (0) | 2021.01.11 |
[Fabric] fabric hello print on CentOS 8 (0) | 2021.01.11 |
[Shell Script] 반복문 for 문법 (0) | 2021.01.07 |
- Tag
- .config, SSH, ssh .config, ssh config, SSH 간편하게 접속, ssh 별칭, ssh 호스트명 별칭
0 Comments