Ssh: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 39: | Line 39: | ||
-rw-r--r--. 1 stk stk 416 May 11 11:01 id_rsa.pub | -rw-r--r--. 1 stk stk 416 May 11 11:01 id_rsa.pub | ||
-rw-------. 1 stk stk 1675 May 11 11:01 id_rsa | -rw-------. 1 stk stk 1675 May 11 11:01 id_rsa | ||
</pre> | |||
== -L == | |||
Local port forwarding using ssh. | |||
<pre> | |||
-L [bind_address:]port:host:hostport | |||
-L [bind_address:]port:remote_socket | |||
-L local_socket:host:hostport | |||
-L local_socket:remote_socket | |||
</pre> | |||
=== Example === | |||
<pre> | |||
$ ssh -L 127.0.0.1:80:intra.example.com:80 gw.example.com | |||
</pre> | </pre> | ||
Revision as of 08:53, 3 December 2018
Overview
ssh 내용 정리.
Create key
ssh 를 사용하기 위해서는 ssh key 가 필요하다. 다음의 명령어로 간단하게 키 생성이 가능하다.
[stk@pchero21.com ~]$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/stk/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/stk/.ssh/id_rsa. Your public key has been saved in /home/stk/.ssh/id_rsa.pub. The key fingerprint is: 1c:fb:fa:f1:f7:f4:13:62:79:8e:57:45:b8:52:cb:a0 stk@pchero21.com The key's randomart image is: +--[ RSA 2048]----+ | oo | | .. o. | | =.o+.o | | o.X.o+ | | S X. | | * + | | . o | | . | | | +-----------------+
키 생성 이후, ~/.ssh 디렉토리를 확인하면 생성된 key 내용들을 볼 수 있다.
$ cd ~/.ssh $ ls -tlr total 16 -rw-------. 1 stk stk 397 Oct 29 2015 authorized_keys -rw-r--r--. 1 stk stk 668 May 11 10:27 known_hosts -rw-r--r--. 1 stk stk 416 May 11 11:01 id_rsa.pub -rw-------. 1 stk stk 1675 May 11 11:01 id_rsa
-L
Local port forwarding using ssh.
-L [bind_address:]port:host:hostport -L [bind_address:]port:remote_socket -L local_socket:host:hostport -L local_socket:remote_socket
Example
$ ssh -L 127.0.0.1:80:intra.example.com:80 gw.example.com
See also
- https://git-scm.com/book/ko/v1/Git-%EC%84%9C%EB%B2%84-SSH-%EA%B3%B5%EA%B0%9C%ED%82%A4-%EB%A7%8C%EB%93%A4%EA%B8%B0 - SSH 공개키 만들기
References
<references />