Reply to comment

SSH Tips and Tricks

Notes for SSH - various access methods and use for ssh


Local Computer
Local Computer

Remote Server<br />SSH runs on port 22 and 4000
Remote Computer


port 9999
Set up a local proxy that would forward all traffic (encrypted) through the remote server - in this example from an internet cafe, one would connect to remote server, set the browser to use a socks proxy of "localhost:9999" and now all internet traffic is encrypted to/from the remote server.

ssh -D 9999 user@remote
.. or if you run your SSH on the server on a different port, say 4000 -

ssh -D 9999 -p 4000 user@remote
Set your Socks proxy to localhost:9999 - all webtraffic encrypted through the tunnel to the remote server. Add more tunnels for FTP, POP3 and with some proxy config will be secure.
port 4000


port 1234
Tunneling: Local forwarding tunnel: set up a forwarding tunnel so when access localhost:1234 its forwarded to remote:23
ssh -L 1234:localhost:23 user@remote
or if server uses port 4000 for ssh -
ssh -L 1234:localhost:23 -p 4000 user@remote
- here we are setting up secure telnet tunnel. Users access the remote server just by telnet to localhost:1234.
port 23
ssh runs on port 22 & 4000


port 23
Tunneling: Remote forwarding Tunnel: set up a remote tunnel so when access remote:1234 its forwarded to localhost:23
ssh -R 1234:localhost:23 user@remote
- note the only difference is -L and -R. Here we are setting up secure telnet tunnel. Users on the remote server access the local server just by telnet to localhost:1234.
port 1234


X forwarding: Start X applications on remote server, send to localhost:
ssh -X user@remote
or for different ssh port:
ssh -X -p 4000 user@remote
The -X to forward X - if that is enabled on the remote server in /etc/sdh/sshd_config: X11Forward yes
port 22


Firefox forwarding, multiple instances: Start X applications on remote server, send to localhost:
On localhost:xhost +; then login with the -X optoin to the server, then
firefox -no-remote will force firefox to start on the server and that instance will be forwarded to localhost. To run another instance - since only one profile can run at once, create a profile with
firefox -no-remote -ProfileManager&.

From Ubuntu forums
and Lifehacker
port 22

Reply

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.