Pour générer le fingerprint (md5 ou sha256) de votre clé ssh publique
Vous pouvez faire :
ssh-keygen -lf ~/.ssh/id_ed25519.pub
ou
ssh-keygen -l -E md5 -f ~/.ssh/id_ed25519.pub
C’est pratique pour faire la correspondance entre clé publique en local sur son poste et le fingerprint dans l’interface de Github ((https://github.com/settings/keys)
-
https://links.infomee.fr/?DnYicwj'avais perdu cet article, il est là!
-
https://code.fb.com/security/scalable-and-secure-access-with-ssh/not bad! better than unprotected socket access ;)
-
https://medium.com/lucjuggery/docker-tips-access-the-docker-daemon-via-ssh-97cd6b44a53?mkt_tok=eyJpIjoiTmpZNE5HWXdOVFJtWkRWbCIsInQiOiI1b0Zsb1RkNk4rXC9qSWtyajFCN3RsSERRQytkSk0wRzZkQ3dRU3g0eXM0YUV3R3RWM1dpb3dqNXpYVjc4MUlNMmpcL1ZIeGdLbk1yQjZYZjNIbjczOTBLOUY4YlBsSUVQRVZwMUg5bGZnNlRHOXpTaFdhdkIydnhmTFd1V0JyRE50In0%3DSolution 1 (recommended)
Apple updated its Technical Notes to indicate that since 10.12.2, macOS includes version 7.3p1 of OpenSSH and its new behaviors.
In ~/.ssh create config file with the following content:
Host * (asterisk for all hosts or add specific host)
AddKeysToAgent yes
UseKeychain yes
IdentityFile <key> (e.g. ~/.ssh/userKey)
-
https://github.com/jirsbek/SSH-keys-in-macOS-Sierra-keychainEncore un exemple d'utilisation de env= dans le authorized keys
via skunnyk
-
http://damiengustave.fr/ssh-blamer/variables=~/.ssh/variables
sshadd() {
source "$variables" > /dev/null
ssh-add -l > /dev/null 2>&1
case "$?" in
1)
ssh-add /root/.ssh/key > /dev/null 2>&1
;;
2)
rm "$variables"
sshagent
;;
esac
}
sshagent() {
if [ -f "$variables" ] ; then
sshadd
else
ssh-agent -s > $variables
sshadd
fi
}
sshagent
source /root/agentmanagement.sh
-
https://links.infomee.fr/?F4oSMA.ssh/authorized_keys
environment="GIT_AUTHOR_NAME=Arnaud M",environment="GIT_AUTHOR_EMAIL=arnaud@foo.bar",environment="GIT_COMMITTER_NAME=Arnaud M",environment="GIT_COMMITTER_EMAIL=arnaud@foo.bar" ssh-rsa .....
Peut être pratique quand plusieurs personnes commit depuis le même serveur (pour avoir un historique git avec les noms..)
-
http://cweiske.de/tagebuch/carry-git-settings.htmTo manage multiple identities
-
https://github.com/ccontavalli/ssh-identIt took me some time to figure this one out, as everybody is using rsync and ssh-keys without passphrases, but I insist that an ssh-key should have a passphrase.
In my first attemts I got this error messages mailed to me by crontab:
Permission denied (gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive).
Here are the steps to automate a backup initiated from crontab using rsync, SSH and ssh-keys with a passphrase:
Make a set of SSH keys.
Setup SSH to use the agent automatically.
Login once as the user who's cron will run the backup script. You will be asked for a passphrase. When the machine reboots, you will need to login once more, to enter the passphrase again.
Make a backup script that includes some SSH variables.
This script could be as simple as this:
. /home/username/.ssh/variables
rsync -avz --delete /data/ example.com:data
N.B. This variables file only contains these lines:
SSH_AUTH_SOCK=/tmp/ssh-DmFcb18036/agent.18036; export SSH_AUTH_SOCK;
SSH_AGENT_PID=18037; export SSH_AGENT_PID;
echo Agent pid 18037;
Put that script in crontab.
That should do it for you, as it works like a charm for me!
-
https://meinit.nl/using-rsync-from-cron-with-ssh-keys-that-have-a-passphrasevariables=~/.ssh/variables
sshadd() {
source "$variables" > /dev/null
ssh-add -l > /dev/null 2>&1
case "$?" in
1)
ssh-add > /dev/null 2>&1
;;
2)
rm "$variables"
sshagent
;;
esac
}
sshagent() {
if [ -f "$variables" ] ; then
sshadd
else
ssh-agent -s > $variables
sshadd
fi
}
sshagent
-
https://meinit.nl/enter-your-ssh-passphrase-once-use-it-many-times-even-from-crontab