Showing posts with label ssh-keygen. Show all posts
Showing posts with label ssh-keygen. Show all posts

Tuesday, September 5, 2023

ssh-keygen commands in linux and windows

 locations:-

windows :-

C:\Users\<username>\.ssh

C:\Users\<username>\.ssh\authorized_keys

C:\Users\<username>\.ssh\id_rsa                  👈private key 

C:\Users\<username>\.ssh\id_rsa.pub            👈public key


Linux :-

/home/<username>/.ssh 

/home/<username>/.ssh/authorized_keys        👈authorized key  

/home/<username>/.ssh/id_rsa                        👈private key 

/home/<username>/.ssh/id_rsa.pub                 👈public key 


permissions:-

chmod 700 ~/.ssh  or   chmod 777  /home/<username>/.ssh 

chmod 600 ~/.ssh/authorized_keys  or   chmod  600  /home/<username>/.ssh/authorized_keys

chmod 600 ~/.ssh/id_rsa            or chmod 600   /home/<username>/.ssh/id_rsa

chmod 644 ~/.ssh/id_rsa.pub    or chmdo 644    /home/<username>/.ssh/id_rsa.pub


To generate ssh key on windows and linux 

ssh-keygen -t rsa -b 4096 -C  "user@gmail.com"  

or

ssh-keygen -t rsa 




###########################################################################

share your id_rsa.pub key to target server ~/.ssh directory and activate id_rsa private key on source server(your own server/windows)

###########################################################################

Enable OpenSSH on Windows 11

Step 1: Install OpenSSH Server You can do this via PowerShell (run as Administrator ): Check if it's already available: Get-WindowsCapab...