反向SSH

来源:互联网 发布:老男孩linux视频云盘 编辑:程序博客网 时间:2024/05/16 18:46

ubuntu

转载来自:https://linux.cn/article-5975-1.html

home-pc

sudo apt-get install autosshautossh -M 10900 -fN -o "PubkeyAuthentication=yes" \-o "StrictHostKeyChecking=false" \ -o "PasswordAuthentication=no" \-o "ServerAliveInterval 90" \ -o "ServerAliveCountMax 3"  \ -R 192.168.0.92:10022:localhost:22 \ xds@192.168.0.92

transfer-pc : xds@192.168.0.92

vim /etc/ssh/sshd_config

add

GatewayPorts clientspecified

sudo /etc/init.d/ssh restartsudo netstat -nap | grep 10022

test

ssh -p 10022 yeshen@192.168.0.92
原创粉丝点击