思路
在公司服务器上建立vpn server,然后将家中电脑,vpn server,公司电脑通过vpn组成局域网,这样既可访问
在公司服务器上安装vpn server
家里和公司电脑安装vpn client
公司电脑安装openssh
sudo apt-get install openssh
家中电脑链接公司电脑
➜ ssh compony@vpn-ip
若出现如下报错
--------------------------------------------------------
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
23:64:49:fb:bd:4b:1c:51:40:56:bf:07:98:43:38:6a.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:2
remove with: ssh-keygen -f "/root/.ssh/known_hosts" -R 172.16.100.136
ECDSA host key for 172.16.100.136 has changed and you have requested strict checking.
Host key verification failed.
--------------------------------------------------------
➜ sudo rm ~/.ssh/known_hosts
➜ ssh compony@vpn-ip