ssh
https://www.raspberrypi.org/documentation/remote-access/ssh/
概念:把PC與Raspberry掛在同區網底下,使用nmap掃出樹莓的IP,再使用ssh登入。
handy@handy-dell ~ $ ifconfig
eth0 Link encap:Ethernet HWaddr 5c:f9:dd:48:e7:ef
inet6 addr: fe80::5ef9:ddff:fe48:e7ef/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:382 (382.0 B) TX bytes:1158 (1.1 KB)
Interrupt:16
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:15818 errors:0 dropped:0 overruns:0 frame:0
TX packets:15818 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1561757 (1.5 MB) TX bytes:1561757 (1.5 MB)
wlan0 Link encap:Ethernet HWaddr 84:a6:c8:0c:8e:0b
inet addr:192.168.43.19 Bcast:192.168.43.255 Mask:255.255.255.0
inet6 addr: fe80::86a6:c8ff:fe0c:8e0b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:468308 errors:0 dropped:0 overruns:0 frame:0
TX packets:229691 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:590060238 (590.0 MB) TX bytes:30990513 (30.9 MB)
得知自已ip為 192.168.43.19,接著使用nmap掃同網段機器
handy@handy-dell ~ $ nmap 192.168.43.*
Starting Nmap 6.40 ( http://nmap.org ) at 2017-05-12 11:49 CST
Nmap scan report for 192.168.43.1
Host is up (0.016s latency).
Not shown: 998 closed ports
PORT STATE SERVICE
53/tcp open domain
5060/tcp filtered sip
Nmap scan report for handy-dell (192.168.43.19)
Host is up (0.00014s latency).
Not shown: 998 closed ports
PORT STATE SERVICE
139/tcp open netbios-ssn
445/tcp open microsoft-ds
Nmap scan report for raspberrypi (192.168.43.58)
Host is up (0.032s latency).
Not shown: 997 closed ports
PORT STATE SERVICE
22/tcp open ssh
5900/tcp open vnc
8002/tcp open teradataordbms
Nmap scan report for Sapido_GR-1733_d65086 (192.168.43.247)
Host is up (0.046s latency).
Not shown: 998 closed ports
PORT STATE SERVICE
80/tcp open http
52869/tcp open unknown
Nmap done: 256 IP addresses (4 hosts up) scanned in 8.45 seconds
掃出來的結果,得知樹莓IP為192.168.43.58,接著就直接對IP連了
handy@handy-dell ~ $ ssh [email protected]
The authenticity of host '192.168.43.58 (192.168.43.58)' can't be established.
ECDSA key fingerprint is d5:ed:93:21:a5:5e:4f:94:02:48:39:d0:88:01:f8:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.43.58' (ECDSA) to the list of known hosts.
[email protected]'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: Fri May 12 11:48:02 2017
SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.
pi@raspberrypi:~ $
登入成功後,提示字變成 pi@raspberrypi,這樣就已經在樹莓底下了。
要離開的話,則下exit即可。
pi@raspberrypi:~/solarpidistro/main/data $ exit
logout
Connection to 192.168.43.58 closed.
handy@handy-dell ~ $
提示字又變回 handy@handy-dell了