dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To...

28
Intro Linux, Raspbian dhcpd, hostAP Raspberry PI 3 Dr. John Yoon

Transcript of dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To...

Page 1: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

Intro Linux, Raspbian

dhcpd, hostAP

Raspberry PI 3

Dr. John Yoon

Page 2: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

RPi 3B

Page 3: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

RPI 3 Specifications

1.2 GHz 64-bit Quad-core ARMv8 CPU

802.11n wifi

Bluetooth 4.1

BLE

1 GB RAM

4 USB Ports; Full HDMI port; Ethernet port

40 GPIO pins

3.5mm audio jack; composite video

Camera interface (CSI); Display interface (DSI)

Micro SD card slot

VideoCore IV 3D graphics core

Page 4: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

GPIO Pinouts

Page 5: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

Raspbian Linux

Page 6: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

Pre-Knowledge

SD Card Formatting• SF formatter for windows to download from sdcard.org

• Run the formatter after inserting the SD card

NOOBS (New Out Of the Box Software)• Download from raspberrypi.org/downloads

• Copy all the files/folders of NOOBS to the SD card

Now, on Raspberry Pi• Install OS

oRasbian (based on Debian)

oUbuntu Mate (based on Debian)

Page 7: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

Raspbian on RPi3

Choose

• Raspbian (debian)

• Language: English (US)

• Keyboard: US

Page 8: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

Now

Ready to issue shell commands

Page 9: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

VNCVirtual Network Computing

Page 10: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

Download & Install

Advanced IP Scanner

• https://www.advanced-ip-scanner.com/

Real VNC

• https://www.realvnc.com/en/connect/download/viewer/windows/

Page 11: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

VNC Configuration on RPI

Menu on Top Left

• Preferences > Raspberry Pi Configuration > Interfaces

o Enable VNC

o Enable SSH

• Or, on terminal

o Type: sudo raspi-config

o Enable VNC as above

Page 12: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

Software Installation on PC

To obtain the IP of Raspberry PI• By double-clicking VNC on RPi: get the IP

• Or, terminal command-line on RPio Command: ifconfig –a

o Then, find the IP of RPi

• Or, using “Advanced IP Scanner on Windowso IP range on Advanced IP Scanner can be figured out form

cmd > config /all– Get your laptop’s IP

– Based on the IP, 192.168.1.1-254 to scan

VNC Viewer• File > New Connection > enter IP

• Double-click on the icon to start VNC

Page 13: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

On IP Scanner

Get the IP for your raspberry

Page 14: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

On VNC

File

• New Connection

Page 15: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

Now Connect

Your login and password

Page 16: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

What About on Mac?

On terminal

• Command

o ssh pi@<your raspi IP>

Page 17: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

VNC on Mac?

Install on Raspberry Pi

• ssh apt-get install tightvncserver

Run on Raspberry Pi

• vncserver :1 –geometry 1920x1080 –depth 24

Page 18: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

Now on Mac (as Client)

Install realvnc

• Choose VNC Viewer

Run vnc viewer

• After this, very similar to Windows

Page 19: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

To Connect to RPi from Windows

Raspbian login from Windows

• The default credential:

o ID: pi

oPassword: raspberry

Note that

• If your AP is changed,

oRe-configure for VNC connection again for new IP’s!

Page 20: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

Networkingdhcpdnsmsqdhostapd

Page 21: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

Wifi Access Point

In Raspbian

Commandssudo apt update

sudo apt install network-manager network-manager-gnome

openvpn \openvpn-systemd-resolved network-manager-openvpn

\network-manager-openvpn-gnome

sudo apt purge openresolv dhcpcd5

sudo ln -sf /lib/systemd/resolv.conf /etc/resolv.conf

Page 22: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

On RPi

Click on top bar

• Panel Setting > Panel Applets >

oRemove “Wired & Wireless Networks”

oRemove “Spacer”, the one below

Then Reboot

Page 23: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

Task Bar Setting on RPI

Choose Panel Setting

Page 24: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

Panel Applet on RPI

Wireless & Wired Network > Remove

Spacer > Remove

Page 25: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

On RPi

Click on top icon “wireless…”• Edit Connection > Add > Wi-Fi

o Then, click on the “Create” button

• Click on the Edit button

• On the Wi-Fi tapo Enter on Connection name

o Enter SSID // maybe the same as above

o Choose Mode to “Hotspot”

• On the Wi-Fi Security tapo Choose Security Name: WPA & WPA2 Personal

o Enter Password – // this will be used to connect from your device to this AP

Then Reboot

Page 26: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,

After that,

Page 27: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,
Page 28: dhcpd, hostAP Raspberry PI 3cysecure.org/560/online/07_raspberry.pdfSoftware Installation on PC To obtain the IP of Raspberry PI •By double-clicking VNC on RPi: get the IP •Or,