More actions
No edit summary |
|||
| Line 3: | Line 3: | ||
First on the client in power-shell run ssh-keygen from the user account you will be accessing with, and follow the prompts to create an SSH pair, and name them. You can choose note to add a password to the Keys, to make to not require one for SSH. | First on the client in power-shell run ssh-keygen from the user account you will be accessing with, and follow the prompts to create an SSH pair, and name them. You can choose note to add a password to the Keys, to make to not require one for SSH. | ||
[[File:SSHKeygen.png]] | |||
Now copy the public key (Default name id_rsa.pub) created by the client in the C:/Users/USER/.ssh/ directory, to the server with your method of choice. If this is an initial config, just ssh into the server using a password, use copy/paste, and echo to put the key in the home directory of the server user, in the directory with the name: ~/.ssh/authorized_keys. | Now copy the public key (Default name id_rsa.pub) created by the client in the C:/Users/USER/.ssh/ directory, to the server with your method of choice. If this is an initial config, just ssh into the server using a password, use copy/paste, and echo to put the key in the home directory of the server user, in the directory with the name: ~/.ssh/authorized_keys. | ||
| Line 17: | Line 17: | ||
NOTE: this will disable password based ssh from other users, to the server system | NOTE: this will disable password based ssh from other users, to the server system | ||
[[File:SSHAuth.png]] | |||
Finally restart sshd using systemctl, and your Key based SSH is configured. Just ssh into the system using the normal command syntax, and you will be prompted if a key password was set, if not you will be logged in with no password request. | Finally restart sshd using systemctl, and your Key based SSH is configured. Just ssh into the system using the normal command syntax, and you will be prompted if a key password was set, if not you will be logged in with no password request. | ||
Latest revision as of 01:17, 31 August 2024
Passwordless SSH:
First on the client in power-shell run ssh-keygen from the user account you will be accessing with, and follow the prompts to create an SSH pair, and name them. You can choose note to add a password to the Keys, to make to not require one for SSH.
Now copy the public key (Default name id_rsa.pub) created by the client in the C:/Users/USER/.ssh/ directory, to the server with your method of choice. If this is an initial config, just ssh into the server using a password, use copy/paste, and echo to put the key in the home directory of the server user, in the directory with the name: ~/.ssh/authorized_keys.
You can do this with echo "KEYCONTENTHERE" >> /home/USER/.ssh/authorized_keys
Now enter the ssh config file on the server, located in /etc/ssh/sshd_config, and add the following to the file:
RSAAuthentication yes PubkeyAuthentication yes to the end of the file. If you want to disable password based SSH set set PasswordAuthentication to no
NOTE: this will disable password based ssh from other users, to the server system
Finally restart sshd using systemctl, and your Key based SSH is configured. Just ssh into the system using the normal command syntax, and you will be prompted if a key password was set, if not you will be logged in with no password request.

