Virtual box network configuration and SSH login configuration

Source: Internet
Author: User

I. configure the network to make the network take effect 1. edit the configuration file VI/etc/sysconfig/network-scripts/ifcfg-eth0 for the default network eth0, modify the following configurations, and add them manually if not:

 
Nm_controlled = noonboot = yes # automatically start bootproto = DHCP # Dynamic IP

Note: Nm_controlled = No. The default value is yes.

2. Start the network service: Service Network start 3. After the network is successfully started, run the ping command to test the network, as shown in



Ii. Modify SSH connection Configuration 1. modify the configuration file VI/etc/ssh/sshd_config. Remove and modify the parameter values according to the parameter annotations to be modified in the template:

 
Port 22 # specifies the port number of the SSH connection. For security, we do not recommend that you use the default 22 port protocol # To allow SSH1 and SSH2 connections, we recommend that you set it to protocal 2 # other parameters based on your needs.

2. Start SSH

 
/Etc/init. d/sshd start


3. Connect to centos through xshell or putty 1. Use xshell for connection.


The host address is your host IP address, and the port is the port information set in the previous step.

An error occurs after the connection:



We can solve this problem through the following methods.

2. Set virtualbox Nic and port forwarding rules

Host machine starts the first Nic
Nic 1: Nat
Cemtos uses this cartoon to access the Internet through the host (win7) (at this time, the host can access the host), but the host cannot access the host.

Note: You can set port forwarding through "port forwarding" in Nic 1.The host accesses the corresponding services in the host.The port forwarding rule settings are as follows:



3. After setting, we can use xshell to connect to the system to see the successful login information.



Virtual box network configuration and SSH login configuration

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.