ssh-key - 从LAN1的Ubuntu用ssh连LAN2的服务器,不同局域网之间难道只能花钱买个花生壳吗?
黄舟
黄舟 2017-04-21 11:19:22
0
1
758

两台机子在不同的内网里,都是ubuntu,网上很多办法描述的意思大概是“必须客户端能直接获得外网ip”,感觉好像没有什么别的办法了,而且用花生壳,因为是没有Linux内网版的缘故,只能买个花生棒。。。加上免费账号只能用在电信网上,我的是联通。。难道只能这样了吗?

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(1)
Ty80

Peanut Shell DDNS is mainly to solve the problem of the IP changing every time you dial up. It is to dynamically resolve domain names. For example, our Peanut Shell Passport abc has a domain name www.oray.net, then we use Passport on 192.168.1.10 abc logs into the peanut shell client. At this time, the IP address corresponding to www.oray.net is the router’s public IP address 218.6.146.31.

What you need is to use SSH from Ubuntu in LAN1 to connect to the server in LAN2. In this case, you only need to do a port mapping on the router of LAN2,
Reference here http://wenku.baidu.com/view/e67fb4d233d4b14e852468f2.html

Access to 9 servers under it.
Because we use ssh for remote login, first install ssh on each machine
apt-get update
apt-get install openssh-server
After the installation is complete, perform network configuration on each machine and set it to automatically obtain IP
Then configure the router. Since fixed IP access is required, the IP of each server on the intranet must be fixed. Enter the router login interface, bind the mac corresponding to each machine, and fix the IP address. Then perform virtual server mapping. The external port can be selected from any port of 5000+, and the internal port is set to 22 (the default port for ssh, which can be changed). After filling in the corresponding IP address and saving it, you can remotely log in to the ubuntu server via ssh.
ssh user@xxx.xxx.xx -p 5000 port number corresponds to the corresponding server IP

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template