Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| public:ssh [2011/10/25 16:20] – local proxy for remote Nico | public:ssh [2023/06/21 22:30] (current) – fix code tag bug Nico | ||
|---|---|---|---|
| Line 33: | Line 33: | ||
| once connected to server_to_connect_to, | once connected to server_to_connect_to, | ||
| + | |||
| + | ====== SOCKS proxies ====== | ||
| + | |||
| + | < | ||
| + | ssh -D 8080 server_to_connect_to | ||
| + | </ | ||
| + | |||
| + | once connected to server_to_connect_to, | ||
| ====== Using a local proxy to enable internet access on a remote host ====== | ====== Using a local proxy to enable internet access on a remote host ====== | ||
| Line 38: | Line 46: | ||
| * install some proxy software (i.e., Squid) | * install some proxy software (i.e., Squid) | ||
| * connect to the server, and map a port to the proxy' | * connect to the server, and map a port to the proxy' | ||
| + | |||
| + | |||
| < | < | ||
| ssh -R8181: | ssh -R8181: | ||
| </ | </ | ||
| * once connected, enter: | * once connected, enter: | ||
| + | |||
| < | < | ||
| export http_proxy=http:// | export http_proxy=http:// | ||
| Line 47: | Line 58: | ||
| * surf | * surf | ||
| + | ====== Run a command on login ====== | ||
| + | |||
| + | Commands in / | ||
| + | |||
| + | < | ||
| + | #!/bin/sh | ||
| + | # source: http:// | ||
| + | DATE=`date " | ||
| + | IP=`echo $SSH_CONNECTION | awk ' | ||
| + | REVERSE=`dig -x $IP +short` | ||
| + | HOSTNAME=`hostname` | ||
| + | |||
| + | echo " | ||
| + | IP: $IP | ||
| + | ReverseDNS: $REVERSE | ||
| + | Date: $DATE | ||
| + | |||
| + | " | mail -s " | ||
| + | </ | ||
| + | |||
| + | ====== Multiplexing ====== | ||
| + | |||
| + | If you make several connections to the same server, you can speed up every connection after the first one by enabling multiplexing. | ||
| + | |||
| + | * create the directory where connections' | ||
| + | |||
| + | < | ||
| + | $ mkdir -p ~/ | ||
| + | $ chmod 700 ~/ | ||
| + | </ | ||
| + | |||
| + | * Enable multiplexing for every hosts in .ssh/ | ||
| + | |||
| + | < | ||
| + | Host * | ||
| + | ControlMaster auto | ||
| + | ControlPath ~/ | ||
| + | </ | ||
| + | |||
| + | Warning: This will not work with tunneled protocols or forwarded ports (See [[http:// | ||