1

My webserver networking is down. I can open a shell over SSH using serial port.

I need to download 2 files (an sql dump and a backup of the entire website: aprox 3GB).

To open the shell I must to follow these steps:

  1. open an SSH connection to a server: ssh <host> -l<user>
  2. enter password
  3. then I must to log again (this time to my server), enter my username
  4. and my password
  5. now I have a shell to my server

How can I transfer files to my local machine? Remember, the server has no internet access

console dump:

Pedro@MyMachine:~$ ssh <server address> -l<user>
Password: 
Trying ***.***.***.***...
Escape character is '^]'.
CentOS release 5.4 (Final)
Kernel 2.6.27.4rootserver-20081028a on an x86_64

<server address> login: root
Password: 
Last login: Wed Mar 10 23:02:10 on ttyS0
[root@s15315044 ~]# 

lrzsz not available

UPDATE:

My server is up :) So I don't need this anymore, but it would be great to know if someone has a solution to this problem

Peter
  • 113
  • 1
  • 2
  • 7
  • 2
    3GB?! Good lord, do you know how long that will take to download over a serial connection? If you manage to get 57600 bps you would be looking at about 150 hours. Are you sure you can't find a USB disk or something? – Zoredache Mar 10 '10 at 22:21
  • Oh, and it isn't clear to me where you are making a serial connection based on your description. – Zoredache Mar 10 '10 at 22:26
  • How on earth does a webserver have no Internet connection? How does it serve the website to the Internet? – Andy Shellam Mar 10 '10 at 22:28
  • My server is located in Germany. I'm from Spain. The serial port connection is an emergency connection to access the server when the network is down. I need to get at least my databases (40MB). My host (1&1) seems to have routing problems and they give me no solution. Now it's the 3rd day of downtime. – Peter Mar 10 '10 at 22:30
  • It's going to take days to download those files via serial speeds. – Satanicpuppy Mar 10 '10 at 22:35
  • Sure but it's the 3rd day of downtime... In this time I could have downloaded all the files and setup'd a new server. (Sorry if my english is wrong). – Peter Mar 10 '10 at 22:45
  • 1
    How exactly do you access this emergency connection once you are connected via SSH? What client are you using for SSH? Is `lrzsz` installed on your server? – Zoredache Mar 10 '10 at 22:54

2 Answers2

2

It sounds like your SSHing into a serial server first and then interacting with your machine (?)

If that's the case, and if you absolutely MUST do this / can deal with the insanely slow speeds as have been mentioned in the comments:

  1. Run script or similar to capture output
  2. Perform whatever gyrations you must in order to connect to your server
    (Steps 1-5 in your question)
  3. uuencode input_filename output_filename
    (for practical purposes input & output filenames can/should be the same & uudecode will spit its output to stdout).
  4. Disconnect from your server
  5. Exit the script output file & grab the uuencoded version of your file
  6. Feed the uuencoded data through uudecode to get your original file back.

Check out man uuencode & man uudecode for more details.

voretaq7
  • 79,879
  • 17
  • 130
  • 214
0

How about using zmodem (sz and rz) - those work over a serial port.

  • IIRC http://zssh.sourceforge.net/ will neatly wrap a zmodem listener around an interactive ssh session. You can zssh as as described, then sz the files on the remote end, and they'll be efficently transfered to the local machine. zmodem brings me back to my bbs days .... – Jason Mar 10 '10 at 23:24
  • zmodem not available – Peter Mar 10 '10 at 23:27