infrastructure:ssh
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| infrastructure:ssh [2018-05-15 17:07] – mrks | infrastructure:ssh [2021-01-26 21:23] (current) – mrks | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== SSH ====== | ====== SSH ====== | ||
| + | |||
| + | ===== Use SSH keys ===== | ||
| + | |||
| + | In case there is no '' | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * Paste the public key to the file | ||
| + | |||
| + | Set the permissions for the '' | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | |||
| ===== SSH and SCP on Windows with smartcard authentication ===== | ===== SSH and SCP on Windows with smartcard authentication ===== | ||
| Line 9: | Line 23: | ||
| * Add CAPI cert | * Add CAPI cert | ||
| * Choose certificate | * Choose certificate | ||
| - | * Automatically import a smartcard certificate: | + | * Automatically import a smartcard certificate: |
| + | * Get fingerprint from certificate | ||
| + | * '' | ||
| + | * Browse to certificate, | ||
| + | * Open certificate by double-clicking or right-click and " | ||
| + | * " | ||
| + | * Copy fingerprint and remove the spaces | ||
| + | * Run: '' | ||
| * PuTTY using smartcard authentication | * PuTTY using smartcard authentication | ||
| * Ensure that pageant.exe is still running in the system tray | * Ensure that pageant.exe is still running in the system tray | ||
| Line 19: | Line 40: | ||
| * Ensure that pageant.exe is still running in the system tray | * Ensure that pageant.exe is still running in the system tray | ||
| * '' | * '' | ||
| - | * Optioanlly use "-A" | + | * Optioanlly use '' |
| * WinSCP using smartcard authentication: | * WinSCP using smartcard authentication: | ||
| * Ensure that pageant.exe is still running in the system tray | * Ensure that pageant.exe is still running in the system tray | ||
| Line 26: | Line 47: | ||
| - | ===== Converting X509 certificate to SSH public key ===== | + | ===== Converting |
| + | |||
| + | * Using OpenSSL | ||
| + | * Export in Windows | ||
| + | * certmgr.msc | ||
| + | * Browse to certificate | ||
| + | * Open certificate by double-clicking or right-click and " | ||
| + | * Details | ||
| + | * Export to file | ||
| + | * (*) No, don't export private key | ||
| + | * (*) Base-64 encoded X.509 (.CER) | ||
| + | * Run: '' | ||
| + | * Run: '' | ||
| + | * The SSH key is displayed | ||
| + | * Using PuTTY-CAC | ||
| + | * Open PuTTY-CAC | ||
| + | * Connection > SSH > Certificate > Set CAPI Cert... | ||
| + | * Certificate string for authorized keys file: Copy to Clipboard | ||
| + | ===== Using Pageant with SSH in Cygwin and MinGW ===== | ||
| + | |||
| + | |||
| + | * Get ssh-pageant.exe from [[https:// | ||
| + | * Cygwin | ||
| + | * Install in Cygwin (do not copy paste the file via Windows Explorer) | ||
| + | * $ cp ssh-pageant.exe /usr/bin/ | ||
| + | * $ chmod 755 / | ||
| + | * Run ssh-pageant: | ||
| + | * Automatically run ssh-pageant: | ||
| + | * Alternatively, | ||
| + | * MinGW | ||
| + | * $ eval $(< | ||
| + | |||
| + | |||
| + | ===== Using a Proxy with SSH in Cygwin and MinGW ===== | ||
| + | |||
| + | |||
| + | * '' | ||
| + | * ncat is part of [[https:// | ||
| + | |||
| + | |||
| + | ===== SSH Tunneling ===== | ||
| + | |||
| + | |||
| + | * Create an SSH tunnel from localhost: | ||
| + | * '' | ||
| + | * '' | ||
| + | * Use a different known hosts file when creating multiple tunnels: '' | ||
| + | * SSH into remote-user@remote-host behind jump-user@jump-server: | ||
| - | - Export in Windows | + | SSH config with jump server: |
| - | - certmgr.msc | + | < |
| - | - Browse to certificate | + | # SSH into remote-user@remote-host behind jump-user@jump-server |
| - | | + | Host my-remote |
| - | - Details | + | |
| - | | + | |
| - | - (*) No, don't export private key | + | |
| - | - (*) Base-64 encoded X.509 (.CER) | + | |
| - | - ''> | + | </code> |
| - | - '' | + | |
infrastructure/ssh.1526396854.txt.gz · Last modified: (external edit)
