1

I need help with this one please. I couldn't connect with any FTP client to a remote server given by a client. It would be SFTP protocol, but I could never connect.

With ssh [email protected] I'm able to connect. After connecting I can use ls to list the directories and I get prod dev stage which refers to the three sudomains.

If I go inside prod I get www tmp log.

My task would be to copy the remote www directory to my local machine. However I'm not able to.

My idea was after ssh connection to scp [email protected]:/prod/www /Desktop which should copy the files to my local Desktop.

However what it does is copying the files to the remote machine creating a directory "Desktop" which has the copied files.

2 Answers 2

0

You seem to have gotten things muddled up. You are already on your remote server, so the /Desktop refers to /Desktop on the remote server, not your local machine, essentially you're taking a long way round there and copying the file locally to a different path on the server. Instead, you either need to change the command or change where you are running it from.

Option 1. From the server after sshing in:

scp -r /path/to/your/folder user@yourlocalmachine:/Desktop

Option 2. From your local machine (easier)

scp -r [email protected]:/prod/www /Desktop
4
  • Hey, thanks. If I use option 2 though … it asks me for the password, when entering I get scp: /prod/www: No such file or directory
    – Matt
    Apr 3, 2019 at 6:47
  • Ah yes, sorry I hadn't realised you wanted the whole folder. You'd need to use -r (Recursively copy entire directories). I've updated my answer to add this in.
    – Solarflare
    Apr 3, 2019 at 7:37
  • Thanks, I already tried that, but no luck either: See imgur.com/FGyiXGr Maybe this has todo with the fact that I couldn't connect with sftp either?
    – Matt
    Apr 3, 2019 at 7:45
  • Is there actually a /prod/www directory? You need to put the full path from root, so if prod is actually under /var/ for example, then you would need to change it to /var/prod/www. Go to the folder and run pwd to make sure you have the full path to the folder and you're not missing anything.
    – Solarflare
    Apr 3, 2019 at 8:40
0

Your need to run your scp command on your computer, not the remote one. Or you have to qualify the destination Desktop with the appropriate user name and address.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .