总共有3台机器人
Company:能够访问外网,没用公网IP
Person:能够访问外网,没有公网IP
Server:具有公网IP
Person电脑想在家里远程ssh登陆到公司的机器
Server:
sudo apt-get install openssh-server
vim /etc/ssh/sshd_config
添加ssh端口11235,22,重启ssh-server
/etc/init.d/sshd restart
公司电脑:
sudo apt-get install openssh-server
/etc/init.d/sshd restart
然后输入
ssh -R 11235:localhost:22 -p 22 server_user_name@xxx.xxx.xxx.xxx,
在Person电脑上输入
ssh server_user_name@xxx.xxx.xxx.xxx
ssh company_user_name@localhost -p 11235