User Tools

Site Tools


infrastructure:ssh

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
infrastructure:ssh [2018-08-20 15:23] – mrksinfrastructure:ssh [2021-01-26 21:23] (current) – mrks
Line 47: Line 47:
  
  
-===== Converting X509 certificate to SSH public key ===== +===== Converting CAPI X509 certificate to SSH public key =====
- +
-  * Export in Windows +
-    * certmgr.msc +
-    * Browse to certificate +
-    * Open certificate by double-clicking or right-click and "Open" +
-    * Details +
-    * Export to file +
-    * (*) No, don't export private key +
-    * (*) Base-64 encoded X.509 (.CER) +
-  * Run: ''openssl x509 -in certificate.cer -pubkey -noout > certificate.pem'' +
-  * Run: ''ssh-keygen -i -m PKCS8 -f certificate.pem'' +
-  * The SSH key is displayed +
  
 +  * Using OpenSSL
 +    * Export in Windows
 +      * certmgr.msc
 +      * Browse to certificate
 +      * Open certificate by double-clicking or right-click and "Open"
 +      * Details
 +      * Export to file
 +      * (*) No, don't export private key
 +      * (*) Base-64 encoded X.509 (.CER)
 +    * Run: ''openssl x509 -in certificate.cer -pubkey -noout > certificate.pem''
 +    * Run: ''ssh-keygen -i -m PKCS8 -f certificate.pem''
 +    * 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 ===== ===== Using Pageant with SSH in Cygwin and MinGW =====
  
Line 75: Line 78:
   * MinGW   * MinGW
     * $ eval  $(<path-to>/ssh-pageant.exe -r -a "/tmp/.ssh-pageant-$USERNAME")     * $ eval  $(<path-to>/ssh-pageant.exe -r -a "/tmp/.ssh-pageant-$USERNAME")
 +
 +
 +===== Using a Proxy with SSH in Cygwin and MinGW =====
 +
 +
 +  * ''$ ssh -o ProxyCommand='ncat --proxy-type http --proxy proxy-server:proxy-port --proxy-auth proxy-user:proxy-password %h %p' remote-host''
 +  * ncat is part of [[https://nmap.org/|nmap]]
  
  
Line 84: Line 94:
     * ''$ plink -L 1234:remote-host:22 -P 2233 user@jump-server''     * ''$ plink -L 1234:remote-host:22 -P 2233 user@jump-server''
   * Use a different known hosts file when creating multiple tunnels: ''$ ssh -o UserKnownHostsFile=~/.ssh/known_hosts_tunnel_remote-host -L 1234:remote-host:22 -p 2233 user@jump-server''   * Use a different known hosts file when creating multiple tunnels: ''$ ssh -o UserKnownHostsFile=~/.ssh/known_hosts_tunnel_remote-host -L 1234:remote-host:22 -p 2233 user@jump-server''
 +  * SSH into remote-user@remote-host behind jump-user@jump-server: ''$ ssh -J jump-user@jump-server remote-user@remote-host''
 +
 +SSH config with jump server:
 +<code>
 +# SSH into remote-user@remote-host behind jump-user@jump-server
 +Host my-remote
 +    ForwardAgend yes
 +    Hostname remote-host
 +    User remote-user
 +    ProxyJump jump-user@jump-server
 +</code>
infrastructure/ssh.1534771398.txt.gz · Last modified: (external edit)