Raspberry Pi_Eng_18.2.3 SSH Connection on Unix/Linux Series, and Apple Mac


Published Book on Amazon


All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 1
All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 2


출판된 한글판 도서


최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (상)
최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (하)


Original Book Contents


18.2.3  SSH Connection on Unix/Linux Series, and Apple Mac

 

The SSH client program is installed by default in these operating systems, so no separate program installation is required. To connect to the Raspberry Pi system using SSH, use "ssh" command. The following command is a command format on Linux. The command on Apple Mac is similar, and check details if necessary.

 

[Command Format]

ssh  IP-Address -  [OPTION]

 

[Command Overview]

    This connects to SSH server of remote system using SSH client.

    User privilege           -- Normal user.

 

[Detail Description]

SSH client is a program that allows you to login to a remote computer and execute commands on that computer. This program provides secure encrypted communication between two untrusted hosts on an unsecured network.

 

[Main Option]

-l login_name

 

Specifies the user to log in as on the remote machine. This also may be specified on a per-host basis in the configuration file.

-p port

 

Port to connect to on the remote host. This can be specified on a per-host basis in the configuration file.

 

[Used Example]

The following is an example of connecting from one Raspberry Pi system to another Raspberry Pi system with SSH command.

 

pi@raspberrypi3:~ $ ssh 192.168.1.202 -l pi

The authenticity of host '192.168.1.202 (192.168.1.202)' can't be established.

ECDSA key fingerprint is c9:85:5d:1f:8a:10:6a:d3:47:a2:9f:f2:a4:6e:9a:2e.

Are you sure you want to continue connecting (yes/no)? y

Please type 'yes' or 'no': yes

Warning: Permanently added '192.168.1.202' (ECDSA) to the list of known hosts.

pi@192.168.1.202's password:

 

The programs included with the Debian GNU/Linux system are free software;

the exact distribution terms for each program are described in the

individual files in /usr/share/doc/*/copyright.

 

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent

permitted by applicable law.

Last login: Thu Jun  9 14:09:49 2016 from 192.168.1.230

pi@raspberrypi2 ~ $

 

pi@raspberrypi2 ~ $ logout

Connection to 192.168.1.202 closed.

pi@raspberrypi3:~ $

 

The Raspberry Pi system where the user is currently logged on is the system whose Host Name is specified as "raspberrypi3". You can confirm the first command prompt will show "pi@raspberrypi3:~ $". The user will connect to another Raspberry Pi system, where the IP address is assigned as "192.168.1.202" and the Host Name is specified as "raspberrypi2".

 

When a user connects to a remote connection to the "raspberrypi2" system using the SSH command, the user is first prompted to enter the password, and the user enters the correct password and the connection to the destination system is completed. This will display "pi@raspberrypi2~ $" at the command prompt, which means that your computer is connected to the remote system with Host Name "raspberrypi2".

 

When the user again executes the "logout" command, the connection to the "raspberrypi2" system is lost and the command prompt is shown as "pi@raspberrypi3:~ $". This means that your computer have returned to the "raspberrypi3" system.