Raspberry Pi_Kor_18.2.3 Unix/Linux 계열 및 Apple Mac에서의 SSH 연결


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  Unix/Linux 계열 및 Apple Mac에서의 SSH 연결

 

이들 운영체제에서는 SSH client 프로그램이 기본으로 설치되어 있어서 별도의 프로그램 설치가 필요하지 않다. SSH를 이용하여 Raspberry Pi 시스템에 접속하기 위해서는 [ssh] 명령을 사용한다.  다음 명령은 Linux에서의 명령 형식이다. Apple Mac에서의 명령도 유사한 형태인데 필요하면 확인해보기 바란다

 

[명령 형식]

ssh  IP-Address -  [OPTION]

 

[명령 개요]

    SSH client를 이용하여 원격 시스템의 SSH server에 접속한다

    user 권한    -- 일반 user.

 

[상세 설명]

SSH client는 원격 컴퓨터에 login하여 그 컴퓨터에서 명령을 실행할 수 있도록 해주는 프로그램이다. 이 프로그램은 보안화되지 않은 네트워크상에서 두 개의 untrusted host 간에 안전한 암호화된 통신을 제공해 준다.

 

[주요 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.

 

[사용 Example]

다음은 SSH명령으로 특정 Raspberry Pi 시스템에서 다른 Raspberry Pi 시스템으로 접속한 사례이다

 

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:~ $

 

사용자가 현재 logon되어 있는 Raspberry Pi 시스템은 Host Name "raspberrypi3"로 지정된 시스템이다. 맨 처음의 명령 prompt를 보면  "pi@raspberrypi3:~ $"와 같은 내용이 표시되어 있는 것을 확인할 수 있다. 사용자는 여기서 다른 Raspberry Pi 시스템에 접속할 것인데, 그 시스템에는 IP address "192.168.1.202" 로 할당되어 있고, Host Name"raspberrypi2"로 지정되어 있다.

 

사용자가 SSH 명령을 이용하여 "raspberrypi2" 시스템으로 원격 접속으로 연결하면, 먼저 사용자 암호를 입력하라는 메시지가 나타나고, 사용자가 정확한 암호를 입력하면 해당 목적지 시스템에 접속이 완료된다. 그러면 새로이 나타난 명령 prompt에서 "pi@raspberrypi2 ~ $"와 같은 내용이 표시되는데, 이는 여러분의 컴푸터가 Host Name "raspberrypi2"인 원격 시스템에 접속되어 있다는 것을 의미한다.

 

사용자가 다시 logout 명령을 실행하면 "raspberrypi2" 시스템과의 연결이 끊어지고, 명령 prompt "pi@raspberrypi3:~ $"와 같이 되어 있는 것을 확인할 수 있다. 이는 "raspberrypi3" 시스템으로 되돌아 왔다는 것을 의미한다.

 

 

 

 


 

Leave a Reply