Windows remotely connect to the Linux system in the VirtualBox virtual machine

Environment
PC: windows
PC software: WinSCP
virtual machine: Ubuntu

Ubuntu 配置

First confirm whether the ssh service of the virtual machine is turned on

ps -e | grep ssh

If there is only ssh-agent, then ssh-server has not been started, and /etc/init.d/ssh start is required. If you see sshd, it means that ssh-server has been started. If it fails to start, it means you need to install ssh service:

sudo apt-get install sshd 或
sudo apt-get install openssh-server

After installation, start successfully

service sshd start 或
/etc/init.d/ssh start

VirtualBox configuration

The number of NICs needs to be closed when Ubuntu is running.
NIC 1 sets the network address translation (default) (in this mode, the same DNS as the PC)
Insert picture description here
NIC 2 sets the Host-Only network
Insert picture description here

Telecommunication

After configuration, start Ubuntu, terminal input: Ifconfig to view the network address, the second is the ip address in Host-Only, we ping the
Insert picture description here
communication successfully on the PC side , open WinSCP and
Insert picture description here
fill in the corresponding information to
Insert picture description here
log in, if you see the following effect Congratulations - >> success
Insert picture description here
summary
Insert picture description here

Guess you like

Origin blog.csdn.net/Mr_Bobcp/article/details/107375777