SeppeBudenaers / IoT_Technologie_PXL_2024

1 stars 0 forks source link

Secure SSH setup #14

Open SamyWarnants opened 9 months ago

SamyWarnants commented 9 months ago

Epic : #11

SeppeBudenaers commented 9 months ago

Setting up OS

Download the Debian OS image from the website(PYNQ,PI), then transfer and install it onto an SD card. Once the burning process is complete, insert the SD card into your single-board computer. Power up the device and follow the subsequent steps to log in via SSH.

SSH login via passwords

Launch the Command Prompt (CMD).

PYNQ

SSH xilinx@[The IP Address of the SBC]

when it asked a password fill in xilinx

Raspberry PI

SSH pi@[The IP Address of the SBC]

when it asked a password fill in raspberry

SSH login via SSH key

Creating an SSH Key on Your PC

  1. Launch the Command Prompt (CMD).
   ssh-keygen -t ed25519 -C "your@email.address"

IMPORTANT: Never disclose your private SSH key; only share your public SSH key.

Transferring the SSH Key to Single Board Computer (SBC)

  1. Locate your SSH key on your PC. Standard path: C:\Users\[Username]\.ssh

  2. Open the ssh.pub file and copy its contents.

  3. Access your SBC via SSH.

    nano /home/cloud-user/.ssh/authorized_keys
  4. Paste the copied key into the opened file.

Turn off passwords login

  1. Login via SSH into your SBC

  2. Edit the SSH daemon configuration file:

    sudo nano /etc/ssh/sshd_config
  3. Find the PasswordAuthentication line: Look for a line that starts with PasswordAuthentication. By default, it is usually set to yes. Replace that line with the line bellow:

   PasswordAuthentication no

If the line is commented out (#), uncomment it by removing the #.

  1. Save and close the file: Save the changes and exit the text editor.

  2. Restart the SSH service:

    sudo service ssh restart

    or

   sudo systemctl restart ssh
SamyWarnants commented 9 months ago

@SeppeBudenaers is the image the same linux image as the one we used in the subject POZ?

SeppeBudenaers commented 9 months ago

click the links and find out ;)

but for the pynq yes

SamyWarnants commented 9 months ago

I'm a low iq person thank you xD