How do I let only specific PCs connect to via SSH?

I have an Ubuntu Server and I want only a few PCs to be able to connect to my server via SSH (on port 22). Is there a way that I can create an certificate that I would install on the few PCs that are allowed on the server?

2

1 Answer

You can use ssh key-based authentication.

  1. Generate private and public ssh key on one of PC using,

    ssh-keygen

  2. Configure your ubuntu server's /etc/ssh/sshd_config file

    PubkeyAuthentication yesPasswordAuthentication no

  3. restart sshd service on ubuntu server

    systemctl restart sshd.service

  4. Add genetated public key into ubuntu servers /home/users-home/.ssh/authorized_keys

  5. Place generated private key in /home/users-home/.ssh/ path on each PC.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like