guide
ssh
Run the below commands only
ssh-keygen
ssh-copy-id
Open cmd and run
ssh-keygen
This is a once in a lifetime time command 😂. Dont run it again and again otherwise it will replace your old keys which might have been used to login to other servers. If you already have ran this command, you will have keys in .ssh folder and you can use that for next steps.
Then Manually copy files
.ssh
id_rsa.pub
to remote directory file ~/.ssh/authorized_keys
ssh yourusername@servername.xyz
.ssh
folder and .ssh/authorized_keys
file is alredy present. If not present use the below command
mkdir ~/.ssh
touch ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
Copy content of local pc id_rsa.pub
to remote server file ~/.ssh/authorized_keys
You may also need to change/verify the permissions of your home directory to remove write access for the group and others.
chmod go-w ~
source: Stack Overflow
ps -f <PID>