Wermescher Advisory Logo

3 Steps to Perform SSH Login Without Password Using ssh-keygen & ssh-copy-id

Inhaltsverzeichnis

Step 1: Create public and private keys using ssh-key-gen on local-host

On your local machine you need to create ONCE the ssh key-pair:

ssh-keygen -o -t rsa -C "herwart@wermescher.com" -b 4096 -N '' -f $HOME/.ssh/id_rsa

Copy the public key to remote-host using ssh-copy-id

ssh-copy-id -i ~/.ssh/id_rsa.pub RemoteHost

you need to enter the password of the remote host once.

Login to remote-host without entering the password

ssh remote-host

Done!

Fix offending key in local store

change the linenumber resp. the ip address before applying the command below

remove 10th line:

sed -i '10d' ~/.ssh/known_hosts

GIT key

If you already have ssh key on your machine then type the following command to retrieve the public key:

cat ~/.ssh/id_rsa.pub

Otherwise type:

ssh-keygen -o -t rsa -C "herwart@wermescher.com" -b 4096

Enter passphrase and store it in the keypass file.!

Now type:

cat ~/.ssh/id_rsa.pub

On Gitlab

Go to GitLab pages and navigate to the ‘SSH Keys’ tab in your ‘Profile Settings’. Paste your key in the ‘Key’ section

https://gitlab.com/profile/keys

and give it a relevant ‘Title’. Use an identifiable title like ‘Work Laptop – Windows 7’ or ‘Home MacBook Pro 15’.

If you manually copied your public SSH key make sure you copied the entire key starting with ssh-rsa and ending with your email.

On GitHub

Click on your profile picture (top right) and select “Settings”.
On the Menu on the left side you see „SSH and GPG keys.
You can store your public key there.

rsync

copy from server

rsync ???

Teilen:
Weitere Posts
Tools für ein technisches Security Audit

Ein technisches Security Audit ist eine entscheidende Maßnahme, um die Sicherheitslage deines Unternehmens zu bewerten und zu stärken. Dieser Beitrag wirft einen Blick auf verschiedene

Tortellini mit Tomatensauce

Ein schnelles Gericht, dass man rasch aus dem Hut zaubern kann, da ich die Tortellini vakuumverpackt und die geschälten Tomaten in der Dose immer vorrätig

Lasagne

Lasagne, ein Klassiker der italienischen Küche, erfreut Gaumen weltweit mit ihrem schichtweisen Reichtum an Aromen und Texturen. Dieses Rezept kombiniert saftiges Rinderhack, aromatische Tomatensauce, cremige

Sende uns eine Nachricht