Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| public:ssh [2009/04/07 10:57] – created 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 ====== | ||
| + | |||
| + | * install some proxy software (i.e., Squid) | ||
| + | * connect to the server, and map a port to the proxy' | ||
| + | |||
| + | |||
| + | < | ||
| + | ssh -R8181: | ||
| + | </ | ||
| + | * once connected, enter: | ||
| + | |||
| + | < | ||
| + | export http_proxy=http:// | ||
| + | </ | ||
| + | * 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:// | ||