I wrote an article "2019-09-15-How to open the ubuntu system in win10" earlier, and some students asked if I could remotely control this ubuntu via ssh. Although it is easy to open a ubuntu window on win10, you can also open multiple windows to achieve multiple terminals, but if you can control ubuntu through ssh, you can open multiple terminals more conveniently, or you can just use this ubuntu as one It is indeed a requirement to use a server in a linux environment. Today, I will write an introduction to the realization of this requirement.
The ubuntu18.04 version is installed by default, and this version comes with ssh service by default.
Check whether the ssh service is installed:
ls /etc/ssh/sshd_config
If the file exists, it is already installed. If it does not exist, execute the following command to install:
sudo apt-get install openssh-serve
Execute the following command to check whether the ssh server has been started.
ps -aux | grep ssh
If there is the following line /usr/sbin/sshd
, it means that the ssh server has been started.
efonfighting@DESKTOP-ARKC8D1:~$ ps -aux | grep sshd
root 640.00.019464800? Ss 01:030:00/usr/sbin/sshd
efonfig+680.00.0148041204 tty1 S 01:040:00 grep --color=auto sshd
If only the following one is printed, it means it is not started.
efonfighting@DESKTOP-ARKC8D1:~$ ps -aux | grep sshd
efonfig+430.00.0148041204 tty1 S 01:010:00 grep --color=auto sshd
/etc/ssh/sshd_config
and modify the following items Port 22, ``ListenAddress 0.0.0.0 # Uncomment'' #StrictModes yes # Comment ``PasswordAuthentication yes # Allow password login
“No firewall'None'
is found in the databaseFind "Global Options" → "General" → "Configuration Folder", create a new FireWalls
folder under this folder, and create a blank file without .ini
in the FireWalls
folder.
At this time, you need to execute the following command to start the ssh server:
sudo service ssh start
After execution, a firewall problem will be prompted, just click Allow. At this time, our ssh server has been successful.
At this time, we enter ifconfig
and ipconfig
in the ubuntu window and the windows cmd window respectively to check the IP address.
This is if we want to access the built-in ubuntu of win10 locally, we can directly access 127.0.0.1
through the user name and password, instead of manually opening an ubuntu window. It's really convenient.
Recommended Posts