vs2-free-users
Active Member
Quick Start Guide Setting up SSH Key Authentication on a rootserver
- You create an SSH key on the local computer
- Next you copy your public key to your server
- Next you log in to the server
- Now create the SSH directory where the key should be placed
- Now we create the key itself on the server. If the file already exists, it is simply attached.
- In the next step we delete the uploaded file
- Now we set the correct rights otherwise there are sometimes problems
- Now we log out
- And log in again for verification (no password should be requested now)
- You create an SSH key on the local computer
Code:
ssh-keygen -b [Key strength] -t [Key type]
Example:
ssh-keygen -b 4096 -t rsa
- Next you copy your public key to your server
Code:
scp ~/.ssh/id_[Key type].pub [Benutzer]@[Host]:
Example:
scp ~/.ssh/id_rsa.pub [email protected]:
- Next you log in to the server
Code:
ssh [User]@[Host]
Example:
ssh [email protected]
- Now create the SSH directory where the key should be placed
Code:
mkdir -p ~/.ssh/
Code:
cat ~/id_[Typ].pub >> ~/.ssh/authorized_keys
Example:
cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
- In the next step we delete the uploaded file
Code:
rm -f ~/id_[Key type].pub
Example:
rm -f ~/id_rsa.pub
- Now we set the correct rights otherwise there are sometimes problems
Code:
chmod 0600 ~/.ssh/authorized_keys
chmod 0700 ~/.ssh/
- Now we log out
Code:
exit
- And log in again for verification (no password should be requested now)
Code:
ssh [User]@[Host]
Example:
ssh [email protected]