(2) Principle of SSH login

1. Direct use

1. Turn on the car, connect to WIFI, password:
donguan 2. SSH remote login: ssh -Y [email protected], password: donguan

Two, login command

1. SSH command:
①Secure network protocol based on the application layer
②Using it is mainly to facilitate the remote use of the ROS car function

2. Wheeltec:
There is a raspberry pi on our car, which is equivalent to a computer. It contains the Ubuntu system. The user name of this system is wheeltec.

3.
The wifi address sent by the "192.168.0.100" car

Third, the reason for using SSH

There are two reasons:
1. First, if our car is not equipped with a display screen and a keyboard and mouse, we cannot enter commands, nor can we see some of our interfaces.
2. Generally, in the competition field, we cannot see the display screen and the user interface . Less than keyboard and mouse

Fourth, the installation of SSH

1. Generally, the Ubuntu system automatically installs the ssh client by default

2. The server needs to install sudo apt-get install openssh-server

3. Check whether the ssh client or server has been installed in the system: open a new terminal and enter dpkg -l | grep ssh

4. Check whether the ssh client or server has been installed on the car: enter dpkg -l | grep ssh after remote login

5. Our virtual machine only needs the client, and the car needs the server

6. Start the ssh service: sudo /etc/init.d/ssh start
Close the ssh service: sudo /etc/init.d/ssh stop
Restart the ssh service: sudo /etc/init.d/ssh restart

Five, two login methods

1. Account and password login:
(1) Select the port number: ssh -p 22 -Y server user name@server ip address (default 22)

(2) Modify the port number of the server:

cd /etc/ssh

ls

##打开编辑器
sudo nano sshd_config

Modify Port **

##重启ssh服务
sudo /etc/init.d/ssh restart

2. Public key key login:
(password-free login, safer)

3. Alias ​​login

cd ~/.ssh

touch config

File content:
Host abc (alias)
HostName 192.168.0.100
User wheeltec
Port 22

Six, other issues

1. Why use Ubuntu?
Because these devices (Raspberry Pi, Nano, NX) on our ros car are all Ubuntu systems

2. Why do I get an error after changing the connection? Why do I copy the code input?
(1) Because when we log in, the public key will be automatically saved. After changing the connection, the public key will be different, so an error will be reported.
(2) That piece of code is to delete the previous public key
(3) Yes is whether to add New public key

3. After the login is successful, you can use some functions. We enter the command in this successful login terminal, which is equivalent to directly input the command on the car

Guess you like

Origin blog.csdn.net/m0_46278925/article/details/114614937