How to connect to server on strange port, or when you're behind a firewall: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 23: | Line 23: | ||
from server to local: | from server to local: | ||
scp -P portnumber_on_targetserver user@localhost:/path/were/to/get/it/from/ . | scp -P portnumber_on_targetserver user@localhost:/path/were/to/get/it/from/ . | ||
=mount filesystem over ssh using sshfs= | |||
sshfs user@localhost:/data/videos/ mnt/ -p portnumber | |||
=Rsync= | =Rsync= |
Latest revision as of 13:39, 25 July 2014
Situation
cpuxxxx -> FW -> intermediateserver -> targetserver 22......-> 22 -> 22.................-> portnumber_on_targetserver
Connect
On cpuxxxx:
ssh -L portnumber_on_targetserver:targetserver:portnumber_on_targetserver username_on_intermediateserver@intermediateserver
Leave terminal open!
Then on cpuxxxx again:
ssh -YC username_on_targetserver@localhost -p portnumber_on_targetserver
That's it!!
Copy files
from here tot server:
scp -P portnumber_on_targetserver file user@localhost:/path/were/to/put/it/
from server to local:
scp -P portnumber_on_targetserver user@localhost:/path/were/to/get/it/from/ .
mount filesystem over ssh using sshfs
sshfs user@localhost:/data/videos/ mnt/ -p portnumber
Rsync
from server to localdisk:
rsync -avz -e 'ssh -p PORTNUMBER' USER@localhost:/data/htdocs/motion/ /data/motion/
Start Konversation from behind a firewall
ssh -L 6667:irc.freenode.org:6667 user@xs3.xs4all.nl konversation --server localhost
Start Pidgin from home to wzs
- in a terminal typ:
ssh -L 8300:gwmsg.wonen.amsterdam.nl:8300 root@wzs
- leave terminal open
- start pidgin and fill in:
- server: localhost
- port: 8300
reverse tunnel
- From the machine at work, create a tunnel to your machine running ssh at home:
randolf@workserver:~$ ssh -vvv randolf@myhomeserver -R 44455:localhost:22
This will forward the remote port 44455 from your home server to port 22 (or whichever port ssh is listening on) on your work machine.
- From home, check to see if anything is listening on 44455
randolf@homeserver:~$ netstat -an | grep 44455 tcp 0 0 127.0.0.1:44455 0.0.0.0:* LISTEN
- Next, to connect from home to your work machine, from your home server:
randolf@homeserver:~$ ssh localhost -p 44455 Password: ******
From there you should be connected to your work machine via your tunnel.