This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
linux:ssh [2017/01/19 11:58] frank created |
linux:ssh [2017/01/24 11:22] (current) frank |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ==== SSH ==== | ||
+ | === generate key === | ||
+ | <code> | ||
+ | $ ssh-keygen -t rsa -b 4096 | ||
+ | </code> | ||
+ | === ssh agent === | ||
+ | If your private key is encrypted with a passphrase(when you generate it by ssh-keygen), the passphrase must be entered every time you attempt to connect to an SSH server using public-key authentication. | ||
+ | |||
+ | SSH agent is a program which caches your decrypted private keys and provides them to SSH client programs on your behalf. | ||
+ | |||
+ | <code> | ||
+ | |||
+ | $ eval $(ssh-agent) | ||
+ | |||
+ | $ echo $SSH_AUTH_SOCK | ||
+ | |||
+ | $ ssh-add (add ~/.ssh/id_rsa by default) | ||
+ | |||
+ | $ ssh -T user@remote.com | ||
+ | </code> | ||
+ | |||
+ | === forwarding of authentication agent connection === | ||
+ | -A enables forwarding of the authentication agent connection. | ||
+ | local -> server1 -> server2 | ||
+ | <code> | ||
+ | $ eval $(ssh-agent) | ||
+ | $ ssh-add | ||
+ | $ ssh -A server1 | ||
+ | <host1> $ ssh server2 | ||
+ | </code> | ||
+ | |||
+ | |||
=== ssh tunnel ssh -L === | === ssh tunnel ssh -L === | ||
Line 5: | Line 37: | ||
- install sshd package on your local machine | - install sshd package on your local machine | ||
- | - add a line in /etc/sshd/sshd_config | + | - add a line in /etc/sshd/sshd_config<code> |
- | AllowTcpForwarding yes | + | AllowTcpForwarding yes |
+ | </code> | ||
- restart sshd service | - restart sshd service | ||
- | - ssh to start tunnel | + | - ssh to start tunnel<code> |
- | ssh -L 8081:localhost:8080 <oracle db host> | + | ssh -L 8081:localhost:8080 <oracle db host> |
- | - login to db web admin console | + | </code> |
- | http://localhost:8081/apex | + | - login to db web admin console http://localhost:8081/apex |
- login with 'SYS' account, then click the 'Administration' button, 'Tasks - Manage HTTP Access' , then enable HTTP access from remote clients. | - login with 'SYS' account, then click the 'Administration' button, 'Tasks - Manage HTTP Access' , then enable HTTP access from remote clients. | ||
Line 17: | Line 50: | ||
- | $ tar -cf - xen_el5_i386_para | gzip -c -9 | ssh root@ostest117 "gzip -dc | tar -xf - -C /OVS/rpool" | + | $ tar -cf - xen_el5_i386_para | gzip -c -9 | ssh root@ostest117 "gzip -dc | tar -xf - -C /OVS/rpool" |
- | $ tar czf - xen_el5_i386_para | ssh root@ostest117 "tar xzf - -C /OVS/rpool" | + | $ tar czf - xen_el5_i386_para | ssh root@ostest117 "tar xzf - -C /OVS/rpool" |
+ | |||
+ | |||
+ | ==== Reference === | ||
+ | - https://wiki.archlinux.org/index.php/SSH_keys |