Ubuntu network configuration and SSH remote connection

Source: Internet
Author: User
Tags nameserver

    • The following software is required before operation, and Ubuntu is installed on the VMware workstation.
 ubuntu16  .04  lts  
vmware workstation
securecrt
    • VMware's edit tab-> virtual Network Edit menu to view network configuration:
Sub-NetworkIP: 192. 168.. 0
Subnet Mask: 255. 255. 255. 0
GatewayIP: 192. 168.. 1

1. su in the Enter mode, vi /etc/network/interfaces set the virtual machine IP to static the following configuration:

You can also change the ens33 to eth0.

2. Set up the DNS server information,vi /etc/resolv.conf

nameserver180...BaiduDNS
nameserver223. 5. 5. 5AliDNS
nameserver192. 168.. 1Gateway Address

3. Configure the gateway addressroute add default gw 192.168.92.1
4. Restart the Network Service, command:

/etc/init.d/networking reload
sudo /etc/init.d/networking restart

5. In general, the network should be able to connect, ping www.baidu.com can be ping, if not, then continue to try the following methods:

    • Restart and stop the virtual network card:
ifconfig eth0 down
ifconfig eth0 up
    • To restart Ubuntu:
      shutdown -r nowOrreboot

6. Network OK, but cannot connect to host from remote SSH
ps -e|grep sshFound no sshd service

执行:
install openssh-sever
正在读取软件包列表...
完成正在分析软件包的依赖关系树正在读取状态信息...
完成现在没有可用的软件包 openssh-server,
但是他被其他的软件包引用了这可能意味着这个缺失的软件包可能已被废弃,或者只能在其他发布源中找到
E:软件包 openssh-server 还没有可供安装的候选者
    • Solution: apt-get No update, execute:

7. Perform the installation after the update is complete:

install openssh-server

8. Start the SSH service:

start
netstat -tlp

You can also ps -e|grep ssh see if the Open-server installation is successful,

9. Modify the SSH configuration,vi /etc/ssh/sshd_config

10. Connect secureCRT 192.168.92.128 The virtual machine with the client and connect OK.

Ubuntu network configuration and SSH remote connection

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.