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