-1

I'm ssh'ing to my university network, and from there I can ssh to my server. How can I transfer files from my local machine to my server? I tried tunneling but it seems it's not allowed, I get:

Note that it is not permitted to run SSH tunnels through this or any other computer on campus
slm
  • 7,615
  • 16
  • 56
  • 76
Ansd
  • 179
  • 2
  • 9
  • 1
    Copy to the intermediate ssh server then copy to your remote server. It seems like you're asking how to violate the network policy set up at your university. You should check with the network administrators to see if they have a proxy in place that allows tunneling SSH traffic outside the network. Most https proxies will let you do that. – Andrew Domaszek Sep 16 '13 at 16:57
  • Why don't you just connect directly? – Michael Hampton Sep 16 '13 at 17:17
  • Our university runs different subnets for different purposes. So my server is running on a subnet and have a web-facing off-campus http access. However, ssh is only available from withen my university network which I already have ssh access to. – Ansd Sep 16 '13 at 19:55
  • Are you trying to bypass security measures that the university has in place! – mdpc Sep 16 '13 at 20:34
  • No, not at all. Will.. if this is something serious I definitely going to contact our IT staff. I just thought there's some easy way to upload my files to my server. – Ansd Sep 16 '13 at 20:44
  • 1
    At our campus, we have a ssh server setup to allow off campus users access to their public facing html files. Just shoot an email to your helpdesk. They probably have the proper procedures. – Daniel Widrick Sep 16 '13 at 21:10
  • @MichaelHampton, I was about to post something quite similar to this question albeit a more specific one... I have ssh handshakes between: (i) local -and- remote 1, (ii) remote 1 -and- remote 2. So far, whenever I wish to take data from remote 2 to local, I have to do two separate `scp`s, which really takes too much time, and as of today remote 1 (the intermediate) is out of disk space. Reckon asking a question on serverfault, about how I can just scp via an intermediate server would also be deemed *off-topic* (similar to the fate of this OP)? – hello_there_andy Feb 14 '17 at 21:46

3 Answers3

2

You can try port forwarding then, so that having logged into your uni network, connect to your local home_IP:home_TCP_port would be forwarded to your_server_IP:22

for e. g., at home host:

  • ssh -L 127.0.0.1:10022:your_server_IP_inside_uni_net:22 uni-network-host
  • scp -P 10022 foo_file 127.0.0.1:
poige
  • 9,448
  • 2
  • 25
  • 52
1

You need to setup your .ssh/config file appropriately and this will work as you expect.

Host webserver
  ProxyCommand ssh -q user@intermediatehost.edu nc -q 0 %h %p

man ssh_config will give you all of the necessary options. Replace 'webserver' with the hostname of your final destination. Replace intermediatehost.edu with the hostname of the first hop on your way. Then you'll be able to ssh (and scp) directly to 'webserver'.

toppledwagon
  • 4,245
  • 25
  • 15
0

The way to get what you're looking for is to perform the file-transfer over the text-mode console.

In other words, you need something from the 1980's: ZModem.

If you have an SSH client that supports ZModem transfers, and they're out there (just not stock OpenSSH), you can transfer files via the sz command.

This works because the old Modem protocols were character based and needed ways to reliably transmit binary data over noisy connections that may or may not allow 8-bit characters. If your server has that, or has the option of installing it, you can get your file-transfers.

sysadmin1138
  • 133,124
  • 18
  • 176
  • 300