Ubuntu opens an SSH connection and sets a static IP address.

Source: Internet
Author: User
Tags nameserver

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.