Work requires remote computer connection, SSH connection is used here, the system is Ubuntu 16.04. Memo only.
Installing SSH
ubuntu16.04 does not have SSH installed by default and needs to be installed:
1. sudo apt-get install openssh-server//installation command
2, Ps-ef|grep ssh//view start SSH No
3. Restart the SSH service:
Sudo/etc/init.d/ssh stop
Sudo/etc/init.d/ssh start
4, Client command line login: SSH [email protected]
5, SSH configuration file is located in/etc/ssh/sshd_config, the default port is 22, you can define yourself as other port number;
Set the static IP,
Refer to the two blog ways
1. http://blog.csdn.net/xiaohuozi_2016/article/details/54743992
2. https://www.cnblogs.com/lcword/p/5917412.html
Here I use the first way to set, the second seemingly do not have permission to create a new file, there is no corresponding folder.
The way you set it is:
1, Vi/etc/network/interfaces
Add Content:
Auto Eth0
Iface eth0 inet Static
Address 192.168.8.100
Netmask 255.255.255.0
Gateway 192.168.8.2
Dns-nameserver 119.29.29.29
Dns-nameserver 119.29.29.29 This sentence must be there,
DNS server addresses are automatically assigned because they were previously resolved by DHCP.
And once the static IP is set to not automatically get to the DNS server, you need to set up a
After you restart your computer, the/etc/resolv.conf file will automatically add nameserver 119.29.29.29
2. Restart the network: sudo/etc/init.d/networking restart
Note the NIC name in Ubuntu16.04 is not eth0.
Restart your computer and you'll be ready.
3. Also need to set up the network in the router, refer to this post:
Https://zhidao.baidu.com/question/537983585.html
Ubuntu opens an SSH connection and sets a static IP address.