31-08-2021
This commit is contained in:
@@ -158,12 +158,55 @@ $ chmod 600 ~/.ssh/*
|
||||
|
||||
|
||||
|
||||
#### Installer keychain dans wsl:
|
||||
#### Créer le ssh-agent:
|
||||
|
||||
```bash
|
||||
$ eval $(ssh-agent -s)
|
||||
Agent pid 3551
|
||||
```
|
||||
|
||||
#### Ajouter la clé ssh au ssh-agent:
|
||||
|
||||
```bash
|
||||
$ ssh-add
|
||||
Enter passphrase for /home/bruno/.ssh/id_rsa:
|
||||
Identity added: /home/bruno/.ssh/id_rsa
|
||||
```
|
||||
|
||||
####
|
||||
|
||||
#### ~~Installer keychain dans wsl:~~
|
||||
|
||||
```bash
|
||||
$ sudo apt install keychain
|
||||
```
|
||||
|
||||
et ajouter au `.zshrc`:
|
||||
|
||||
```bash
|
||||
# on peut mettre toutes les clés que l'on veut attacher à la keychain
|
||||
eval `keychain --eval --agents ssh ~/.ssh/id_rsa`
|
||||
```
|
||||
|
||||
A la première ouverture du terminal, keychain demande la passphrase.
|
||||
|
||||
Pour les sessions suivantes, keychain indique que des clés sont chargées.
|
||||
|
||||
Liste des clés:
|
||||
|
||||
```bash
|
||||
$ keychain --list
|
||||
3072 SHA256:V/qyypJ2NVwfvQ8l8P/JBZcNC515j66MKG9HTAuDnX0 bruno@BRUNOPESENT79AA (RSA)
|
||||
```
|
||||
|
||||
Décharger les clés en mémoire:
|
||||
|
||||
```bash
|
||||
$ keychain --clear
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### Copier la clé sur le serveur:
|
||||
@@ -184,6 +227,25 @@ scp -P42666 C:\Users\bruno\.ssh\id_rsa.pub bruno@clicclac.synology.me:~/.ssh/aut
|
||||
|
||||
#### Ne plus demander la passphrase ssh:
|
||||
|
||||
#### 1.
|
||||
|
||||
```powershell
|
||||
# By default the ssh-agent service is disabled. Allow it to be manually started for the next step to work.
|
||||
# Make sure you're running as an Administrator.
|
||||
Get-Service ssh-agent | Set-Service -StartupType Manual
|
||||
|
||||
# Start the service
|
||||
Start-Service ssh-agent
|
||||
|
||||
# This should return a status of Running
|
||||
Get-Service ssh-agent
|
||||
|
||||
# Now load your key files into ssh-agent
|
||||
ssh-add ~\.ssh\id_rsa
|
||||
```
|
||||
|
||||
#### 2.
|
||||
|
||||
https://medium.com/@glsorre/windows-subsystem-for-linux-never-prompt-your-ssh-passphrase-again-353db7c931ab
|
||||
|
||||
<u>Installer CredentialManager:</u>
|
||||
@@ -285,6 +347,24 @@ compinit
|
||||
|
||||
|
||||
|
||||
#### Pipe vers le presse-passier Windows:
|
||||
|
||||
Ajouter dans le .zshrc:
|
||||
|
||||
```bash
|
||||
alias clip="clip.exe"
|
||||
```
|
||||
|
||||
puis dans le shell:
|
||||
|
||||
```bash
|
||||
grep alias .zshrc | clip
|
||||
```
|
||||
|
||||
et coller (Ctrl+V) dans Notepad.
|
||||
|
||||
|
||||
|
||||
### Fin
|
||||
|
||||
```bash
|
||||
@@ -296,5 +376,11 @@ $ uname --release
|
||||
|
||||
|
||||
|
||||
https://opticos.github.io/openinwsl/
|
||||
|
||||
https://opticos.github.io/gwsl/
|
||||
|
||||
https://github.com/sirredbeard/Awesome-WSL
|
||||
|
||||
https://devblogs.microsoft.com/commandline/access-linux-filesystems-in-windows-and-wsl-2/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user