Webserver is “empty” when SFTP-ed into but website is still there?

0

I’ve been put in charge of maintaining a website. When I took over it I was given SFTP credentials and accessed and edited the files through Dreamweaver.

I’ve subsequently changed Dreamweaver accounts because the trial ran out and now have a proper version. However when I SFTP into it now the server just has an empty root directory.

I checked this by using the SFTP command in terminal and it’s showing the exact same result (empty root folder).

tazer@HMSLinux ~ $ sftp XXXXXXXX@www.lceresearch.unsw.edu.au
XXXXXXXX@www.lceresearch.unsw.edu.au's password:
Connected to www.lceresearch.unsw.edu.au.
sftp> pwd
Remote working directory: /
sftp> ls
sftp> cd ..
sftp> pwd
Remote working directory: /
sftp> ls
sftp>

What’s gone wrong?! The website is still there on the Internet, I used a WGET script to crawl through it and download everything. So why is nothing showing up when I use SFTP?

EDIT: With respect to what OS the server is running:

$ curl -I www.lceresearch.unsw.edu.au
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Length: 24104
Content-Type: text/html; charset=UTF-8
Date: Tue, 17 Nov 2015 01:15:01 GMT
ETag: "1e00bc-5e28-519dc423d9134"
Last-Modified: Thu, 02 Jul 2015 03:44:38 GMT
Server: Apache/2.2.31 (Amazon)
Connection: keep-alive

m4p85r

Posted 2015-11-16T23:50:59.737

Reputation: 125

Can you please edit your system to clearly indicate what OS this web server is running on. I am assuming Linux in my answer, but what version? Or perhaps you are using Microsoft IIS? Knowing that would be helpful.

– JakeGould – 2015-11-17T00:07:47.017

I now have server details. – m4p85r – 2015-11-17T01:16:48.817

Nothing that curl -I can provide gives you OS info. In fact I edited my answer 1 hour ago to explain what info I found using curl -I. Honestly nobody here can possibly help you. Just wait to talk to the guy who used to maintain the website. – JakeGould – 2015-11-17T01:49:09.453

Answers

0

Unclear by what you mean by this:

…has an empty root directory.

What exactly are you referring to as the “root” directory? Do you mean you logged in via SFTP and saw nothing? Or are you trying to maneuver to a directory you know has content named /root or something else?

I’ve subsequently changed Dreamweaver accounts because the trial ran out and now have a proper version. However when I SFTP into it now the server just has an empty root directory.

Seems like the issue is you have the correct SFTP credentials, but the old setup might just have a default path set you never noticed.

And while it’s not clear to me what OS or system you are SFTP’ing into, in general Linux systems have web files stored in the /var/www path on the system. So once you login to the system, attempt to maneuver to /var/www or if you have the option to set a default path when logging in, set that to /var/www. Doing a simple check with curl -I (to return server headers) shows it’s running Apache/2.2.31 which is a web server used mainly on Linux/Unix setups so it would be safe to say you are using Linux.

In some cases you might have a per-user directory setup that is something like this: /home/[username]/public_html/ where [username] equates to the username you have as your SFTP login. But that’s really not as commonly used nowadays.

JakeGould

Posted 2015-11-16T23:50:59.737

Reputation: 38 217

Thanks for your answer - I've edited the question to include the terminal output of my SFTP queries. It literally appears to have nothing in it. Would the default path make a difference? Surely I would be able to navigate from / to anywhere in the directory?

Also I'm not sure what OS it is as that's dealt by the university and they seem to have less of an idea than I do. – m4p85r – 2015-11-17T00:34:13.753

Very odd. With SFTP, a user can be “chrooted” to a specific directory so what you see as / (aka: root directory) is just the top-most level of what you are looking for. So yes, the default path might not be an issue here. But here is a thought: What if the server uses plain FTP in addition to SFTP? The user restrictions for an FTP user can differ from an SFTP user so maybe if you try FTP that would give you something. – JakeGould – 2015-11-17T00:50:49.770

I tried to FTP to it and it flat-out refuses to connect. Thanks for confirming that it is very odd. I'm always worried that I'm just missing something blindingly obvious! haha I think I'll head back to central I.T. and see if there's someone who can help floating about. – m4p85r – 2015-11-17T00:52:06.017

Turns out I needed to cd to www.lceresearch.unsw.edu.au/html/ That's where all the site's files were. Obviously there's some permissions thing that doesn't let me see the directory when in the root? Regardless - thanks for the help. – m4p85r – 2015-11-17T03:32:17.550

@ashgetstazered: Well, I guess that works and my default path idea worked out after all! Congrats to fixing this! – JakeGould – 2015-11-17T03:37:58.490