Virtual Box network configuration and SSH login configuration, virtualssh
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: The default value of NM_CONTROLLED = no is yes.
2. Start the network service: after the service network start3. you can run the ping command to test the network, as shown in
2. Modify SSH connection configuration 1. modify the configuration file vi/etc/ssh/sshd_config, remove the parameter comment to be modified according to the template, and modify the parameter value:
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. Use XShell or putty to connect to CentOS1.
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 use "port forwarding" in network interface card 1 to set the service for accessing the host. The port forwarding rules are as follows:
3. After setting, we can use XSHELL to connect to the system to see the successful login information.
How to configure the network when linux is installed on the virtual box virtual Machine
The default mode is NAT. You can access the Internet with any configuration, but you can only access the Internet from a virtual machine. It is recommended to change to the bridge or ViutualBOX Host Only ethernet Adapter mode. In the bridge mode, you can use different IP addresses in the same network segment as the Host. In the ViutualBOX Host Only ethernet Adapter mode, the IP address in the virtual machine is set to 192.168.137.2-254, and the corresponding virtual network card on the Host is set to 192.168.137.1, and enable the sharing mode of the local connection.
How can I configure virtualbox so that putty can be used in windows to connect to Ubuntu?
1. Install the Virtual Machine and set the network connection mode of Linux to bridge in the virtual machine. This is not hard to solve.
2. Set the IP addresses of xp and Linux to a CIDR Block and enable the SSH service in Linux. Ubuntu has never been used. Please go to the next hundred times. How can I enable the ssh service and set the startup.
3. Use SSH to connect to the ubuntu client. By default, ubuntu does not allow root login. SSH may not work either. Use your new user name. You can try it.
4. The connection fails. You can close both the firewall of xp and ubuntu to see if it can be connected.
The above is my experience.
When I configure the zookeeper server, ssh can be connected, but Linux cannot connect to the xp database. I was bored and later found that it was a problem with the xp firewall. Some time ago, I failed to use the bridge and nat methods to access the Internet. I checked that it was the role of the linux firewall.
Therefore, there are usually no problems with these aspects. Good luck