总共有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 [email protected],
在Person电脑上输入
ssh [email protected]
ssh company_user_name@localhost -p 11235