Unix

포트포워딩 명령어, 자꾸 까먹어서

ForceCore 2021. 11. 21. 17:25

검색하면 나오기는 하는데 내가 쓰는 조합이 맘에 들어서.

 

ssh -N -v -L 8888:localhost:9999 ID@REMOTE_HOST

 

localhost (내쪽) 8888로 가는 접속을 원격 host의 9999로 보내되,

 

     -N      Do not execute a remote command.  This is useful for just forwarding ports.
             Refer to the description of SessionType in ssh_config(5) for details.

 

 -v      Verbose mode.  Causes ssh to print debugging messages about its progress.
             This is helpful in debugging connection, authentication, and configuration
             problems.  Multiple -v options increase the verbosity.  The maximum is 3.