2016. 10. 8. 16:20ㆍ99. 정리전 - IT/13. Unix 얇팍지식
macOS 터미널의 작업 일람
접속하려는 서버로부터 할당받은 "공개키와 키(password)"를 이용한 터널링 접속 방법
이하와 같이 클라이언트(접속하려는 곳)는 두개의 파일만 있으면 됨
> ls -alts
공개키 : donz_rsa_2048
내용
❯ cat donz_rsa_2048
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,64DDFDC27ED68395
9ai5twqDpKcR+BMXIEJeL/puVZe6/SC/r30WjAPThx90AQLcVTzaaFupeRBLJOWc
p3W4qUbdbgxtGEh1G3uqXxxOVRQWXeetjJaI52PxWdHqD/fcU6seQsaztvqQ1Gt/
Hw+7Wm4RuO5HPur5GwIpwMSn70InjVmlZXFvkYkv0gCTBNNMGfIIbZRowwbf1Nzg
G5TH2csp0nnKMQ6BR/iNDZ6RtM61zR2p9WDyecOh4KfYs+/9k8AHCQHRXQe5r8OW
tJAW2Rf2NwNcoGf52nAycWxqB+6/Ti+m8Xkg1DYHmhveisWpMlyc87xBtMy08vYw
wBTRBGWUe6O4dGfM0WvknjQHmiO3WNaru3FoUCm+NjAgASkUQRnjg7+yosxWLZXl
c0msJmgossUSElMf6o/36IdgKHDyNvTOSeS7ZvdGZl1J20ingCnh5hRHml3SkqXR
vIUNGLtdwrs59963FjEf9ejKj8O2NDmBwxxa2MIEkMwe8FxqKPwEdcCuf1xZ2bn9
YBd9cs4Xc445BtxUSbSAj1K9g9qU1g8fJzQvy1VKl0gpveE1rg3BV12xUxHc0
97ulyc87gFQ7HVVUE9Us5fHG8yNfuUg+pq0oKYN0Eh/hElDp3lYmJCMKdtORI4uf
7Tb+1HlXoGICKCjPx5BLgOKd1qLdEMhSL+svshjZQin7GuhpmLrYB9tyLu/zDI6E
ll42Af2uMO2RxOtAOg3VGaiy4t7db0aD/PZPKfs9VAZKT7ZsfBTzQtUzhalJ9Zc9
PB/1FOk/Pot+P1SmAHn8u9Ms8IqNfIx3GENfriNGFGu9OhacEcJ/f0ga5P6cOl/O
otJeivZfJOG9bVwj0S/1AEWgcKioT1Iz6C9s6Olw5SWEhcNI0hDpKyhY0Sk40U3y
62WUOvtuW6eSEiQbC1MBTedCqxgcRPzEYhaFpY4G/RgIPMT4P2FfGn7tzVEoH5+T
/sYfg3/TqALDm2xAQ84NlhMSlpoT14bROJJoUXU5XBzT/3LYhbiUP7oYpyJXIHme
hhwHs5ajrJikSJEBKzUDt4+zFRWsV/hv2Les6wtNTzVf90aCBnMWfw==
-----END RSA PRIVATE KEY-----
★ IdentityFile 설정용 config ★
내용
❯ cat config
#+---------------------+
#| [XXX] XXXX aws |
#+---------------------+
Host conn_aws
HostName 2xx.xxx.xxx.xx5
Port 22
User donz
IdentityFile /Users/Donz/.ssh/donz_rsa_2048
참고용 퍼블릭키로부터 프라이빗키 생성하기
내용
❯ pwd
/Users/Donz/.ssh
❯ ssh-keygen -y -f ./donz_rsa_2048 > ./donz_rsa_2048.pub
Enter passphrase: ***********
20s
❯
참고용 프라이빗키 : donz_rsa_2048.pub
내용
❯ vi donz_rsa_2048.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzBmhLzV1ixjpG0c4/OwR2U8/F7ggnOY9yKg7u8XJv7EVTWFDAmyd/f18eeeLygTCKA2jRReRACv7wjmMtoJLEudKPhdT5hM2JoIRZJi62tAL0I3wEKZHlUKmRW3D3+/va8boHIDi0XcGcwzS3DATl6EFDkfJBzl3ysUSY7TFkwT9ifD7cVKBbOqjoEbgkGhd65dLVigNLeSQsflmfu4HM5ve/tyG7RUBV+3F6C2/D0AQ==
접속하기
내용
❯ ssh conn_aws
Last login: Sat Oct 8 16:08:38 2016 from 192.168.10.1
-bash: id: command not found
-bash: id: command not found
-bash: tty: command not found
-bash: uname: command not found
-bash: /bin/grep: 허가
------------------------
-bash-4.1$
Success!!!