Forum Moderators: phranque

Message Too Old, No Replies

asking for help with 'sftp'

         

sodani

2:28 am on Oct 28, 2006 (gmt 0)

10+ Year Member



I have a web server and an sftp backup server with my web host and they have different IP addresses. I'm using plesk to backup my files and write them to the sftp backup server.

I'd like to access this backup server so that I can verify that the files are getting backed up and also so that I can transfer them to my local machine. I'm told that the only way to access the backup server is by using the 'sftp' command at the ssh command line. However, I'm a complete beginner when it comes to ssh.

Can someone tell me how to do this?

equalm

8:22 am on Oct 28, 2006 (gmt 0)

10+ Year Member




I use winscp. [winscp.net...]

Great freeware tool. Good GUI for SCP and SFTP, which is essentially FTP tunneled over SSH. It's intuitive for beginners.

sodani

10:20 am on Oct 28, 2006 (gmt 0)

10+ Year Member



Can I just as well use Filezilla? I was under the impression that I could only access this ftp backup server by logging in as 'root' on my webserver.

jtara

9:29 pm on Oct 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I was under the impression that I could only access this ftp backup server by logging in as 'root' on my webserver.

That's possible, but unlikely. You will have to ask your ISP what restrictions (if any) they have put on access to the sftp site.

They COULD have set things up so that the backup site can only be accessed from your webserver. Technically, they have no way of restricting access to a particular user on your webserver... well, they could have set up public/private key access, and you have to use a key that is only present on your webserver, and that they have not given you read access to...

But, again, very unlikely. It would partially defeat the purpose of backup. You should be able to access your backup data!

I think you must be misunderstanding your ISP's configuration.

As for how to access this - there are tools built-in or easily added to any Linux system for accessing via sftp. If you have a Windows system, most free and commercial FTP software packages now include sftp support.

Yes, FileZilla supports sftp, so that is an option.

sodani

12:32 am on Oct 29, 2006 (gmt 0)

10+ Year Member



Okay, this is what I've tried with Filezilla...
- Put the ftp backup server IP address in 'host'
- Port: 22
- Under 'Servertype,' I selected 'SFTP using SSH2'. This is the only SFTP option

However, I'm unable to connect to the server. Any ideas why?

jtara

12:57 am on Oct 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



However, I'm unable to connect to the server. Any ideas why?

Really, you're asking in the wrong place.

At this point, you'd best ask your web host, as what you've done looks fine. They are going to have to tell you about any differences in their configuration or access restrictions.

sodani

1:43 am on Oct 29, 2006 (gmt 0)

10+ Year Member



Ugh, I just got off the phone with my webhost and they confirmed that I can access the ftp server only from an internal IP address, which I suppose means that it has to be through SSH. They couldn't provide any more support than that being that these are largely 'unmanaged servers'

jtara

7:25 pm on Oct 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are plenty of inexpensive backup services. Or, if you have a high-speed connection, backup onto your OWN computer.

Using rsync, rdiff-backup, etc. nightly backups can be quite compact, as only the differences are sent.

sodani

3:47 pm on Oct 30, 2006 (gmt 0)

10+ Year Member



Well, I've already paid for the one I have, so if possible I'd like to try to figure it out.

jtara

4:25 pm on Oct 30, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK, so I assume you have command shell access at your host, right?

Getting to your backup files is going to be a two-step process.

First, you need to make an SSH connection to your host. If you have Linux at home, this is as simple as "ssh user@example.com". You will then be asked for a password, and once you enter the password, you will be at a command-line prompt at your host.

If you have Windows, you will need an SSH client for Windows. Putty is a popular free one. There are a number of shareware/commercial packages as well.

Once you have a command-line prompt at your host, you need to use sftp to connect to the backup machine. The command is very similar to the ssh command above. "sftp user@backup.example.com". (Substititue your user name, and the domain name or IP address they gave you for the backup machine.)

SFTP has commands similar to command-line FTP. You can type "help" to get a list. Useful commands are "li" (list files), "cd" (change directories), "get" (copy a copy from the backup to the host) and "put" (copy a file from the host to the backup).

Personally, I'd still keep a backup at home or elsewhere. What if your host goes out of business or has a catastrophic failure. Or, as seems to happen way too often, you have a billing dispute? You empower yourself by taking control of your data.

sodani

5:32 pm on Oct 30, 2006 (gmt 0)

10+ Year Member



Okay, so I tried logging into this backup server using the command you described. I tried 'sftp user@ip_address' and 'sftp ip_address' but I'm getting the following message:
Connecting to 123.44.555.66...
ssh: connect to host 123.44.555.66 port 22: No route to host
Couldn't read packet: Connection reset by peer

jtara

5:39 pm on Oct 30, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Double-check that you are trying to connect to the right address. It seems you can't get to the backup machine from your web host. The issue is not ssh or sftp, but lack of connectivity. Make sure you can "ping" first.

You might be able to find some configuration information in your Plesk control panel. Unfortunately, I'm not a Plesk user, so I can't help you there. But there might be some set-up for the backup where you can check the address.

I think you will need to ask your hosting company, to make sure you have the right address.

jtara

7:56 pm on Oct 30, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Whoops! "no route to host" is a bit of an erroneous message from most Unix/Linux remote command-line tools. It does NOT literally mean that there is no route to the host! It simply means that it couldn't make a connection. For example, they might be using an alternate port (not port 22) for SSH. (SFTP runs over SSH.)

I would still first try a ping and/or traceroute to make sure that you have connectivity to the backup machine.

If that works, then I would contact you host to get the details of their SSH setup on the backup machine.

sodani

8:48 pm on Oct 30, 2006 (gmt 0)

10+ Year Member



I tried 'ftp' instead and that worked! Then I used the 'get' command to transfer the file to my webserver. So I think I'm all good now. =)