This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
computing:linux:ssh [2012/03/07 10:56] gcooper |
computing:linux:ssh [2018/01/15 11:57] (current) gcooper |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== SSH ====== | ====== SSH ====== | ||
- | ===== Set Up SSH Keys ===== | + | See also **[[computing: |
- | + | ||
- | See [[computing: | + | |
===== Troubleshooting ===== | ===== Troubleshooting ===== | ||
+ | |||
+ | Verbose: | ||
< | < | ||
ssh -v ... | ssh -v ... | ||
+ | </ | ||
+ | |||
+ | Modify the MTU on your remote workstation PC to eliminate fragmentation (MTU mismatch): | ||
+ | |||
+ | < | ||
+ | ifconfig eth0 mtu 576 | ||
</ | </ | ||
Line 28: | Line 34: | ||
< | < | ||
- | chmod 600 /home/gcooper/ | + | chmod 600 /home/username/ |
+ | </ | ||
+ | |||
+ | ==== Unknown Terminal Type ==== | ||
+ | |||
+ | If you get an error message " | ||
+ | |||
+ | < | ||
+ | TERM=xterm-color ssh -l username remote.host.name | ||
</ | </ | ||
Line 41: | Line 55: | ||
service sshd restart | service sshd restart | ||
+ | </ | ||
+ | |||
+ | ==== Additional for EL7 ==== | ||
+ | |||
+ | Install '' | ||
+ | |||
+ | < | ||
+ | sudo yum install policycoreutils-python | ||
+ | |||
+ | semanage port -a -t ssh_port_t -p tcp 2222 | ||
</ | </ | ||
===== Reverse Tunnels ===== | ===== Reverse Tunnels ===== | ||
+ | |||
+ | http:// | ||
http:// | http:// | ||
- | This technique is used to access an SSH host behind a NAT firewall. | + | This technique is used to access an SSH host behind a NAT firewall |
+ | |||
+ | * Box behind NAT creates a reverse tunnel connection to the middle-man | ||
+ | * User connects to middleman PC on reverse tunnel port | ||
+ | |||
+ | ==== Howto ==== | ||
+ | |||
+ | On the middle-man host with a real static IP address: | ||
+ | |||
+ | * Set " | ||
+ | * Restart sshd if sshd_config changed | ||
+ | * Configure to use [[computing: | ||
+ | * Less trouble | ||
+ | * More secure | ||
+ | |||
+ | On remote host (behind NAT) that you want to access: | ||
+ | |||
+ | < | ||
+ | ssh -R 22222: | ||
+ | </ | ||
+ | |||
+ | or if SSH is listening on a non-standard port: | ||
+ | |||
+ | < | ||
+ | ssh -R 22222: | ||
+ | </ | ||
+ | |||
+ | From your workstation, | ||
+ | |||
+ | < | ||
+ | ssh -p 22222 root@middleman | ||
+ | </ | ||
+ | |||
+ | ===== AutoSSH ===== | ||
+ | http:// | ||
+ | Use AutoSSH to keep a tunnel up constantly. |