An SSH key is an access credential in the SSH protocol. We can login our server without password cause SSH key allow It. It is automated process for user and provide more secure our server.

Create SSH key in Linux or Mac  

Run this command from your local server.


For more security run this command

ssh-keygen -b 4096

Run this command with login with your server

mkdir -p ~/.ssh && sudo chmod -R 700 ~/.ssh/

And run this command from your local server

scp ~/.ssh/ [email protected]:~/.ssh/authorized_keys

In demo_user provide your username and replace with your server IP.

That's enough.

Your server is more secured now.

Author: Al Mamun

Leave a Comment