0% found this document useful (0 votes)
7 views3 pages

M Lab 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views3 pages

M Lab 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Professional Training In Programming

Iii

Student Name: Menna mohamed


Student ID: 221027574
LAB2

Configure OpenSSH to allow pulic key-based login credentials


sudo nano /etc/ssh/sshd_config
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
sudo systemctl restart sshd

Create an SSH key-pair


ssh-keygen -t rsa -b 4096

Configure with one of your colleagues to login without the need of a password.
Share the public key (~/.ssh/id_rsa.pub) with your colleague and add it to their
~/.ssh/authorized_keys file:
ssh-copy-id username@colleague_host

Confirm that your colleague can login without password.


Configure SSH to prevent root logins.
sudo nano /etc/ssh/sshd_config
PermitRootLogin no
sudo systemctl restart sshd

Confirm that root can't log with SSH


ssh [email protected]

You might also like