1

Firstly, I must confess and say that I'm very green in Linux so kindly forgive me for my newbie question.

Secondly, forgive me again for the long post - I just had to be sure I got everything down.

So I have a laptop that recently couldn't boot via Windows 7 OS anymore. Unfortunately, the machine contains GBs worth of data that I must backup to the office's shared network drive before I can reinstall Windows 7 a fresh again. Therefore, I decided to use Ubuntu live CD and run it through the "Try Ubuntu without installing" option to connect to the office's wireless LAN and then copy all the relevant folders that contain important data to the network drive. I could easily track down the folders/files that I needed from the Windows source directory by starting from Ubuntu's Devices section then navigating through this location: /media/Windows7_OS (I assumed this is how Ubuntu sees the drive C labeled with the same name). And then, I could just as easily find my network destination after successfully connecting to the wireless LAN and finding it under Ubuntu's Network section by navigating through this location: Browse Network > Then opening the drive > NAS-KKM(FTP) (I picked FTP since I figured file transfer was my objective). After successfully logging into the file server, I simply tried copying and pasting my directories of interest from the source, to the destination - though unfortunately, I kept getting this error message almost immediately:

Error while copying ".docx".

There was an error copying the file into ftp://nas-kkm.local/...

Error reading from file: Permission denied

So I tried finding an alternate way to my backing up problem, and I found a post that recommended I try using "sudo cp" to copy my files through the terminal. However, I still cannot copy my files. I used this command:

sudo cp /media/Windows7_OS/Users/Profile One/Desktop ftp://nas-kkm.local/MyOffice/T430_Laptop/Profile%One/Desktop

Notice I placed "%" in place of a space in one of the destination sub-directories since it seemed as though the command didn't want any spaces in my directories for the destination. Unfortunately, this still didn't work. (As you can see, I'm trying to back up the entire desktop from the user "Profile One".)

The command cannot find my destination directory - even when I tried renaming it without spaces.

As I'd mentioned earlier, I've never used the terminal to run any commands before - this is my first time and I'm only familiar with the Ubuntu GUI interface since it's intuitive to use.

Any assistance will greatly be appreciated.

Kind regards, Rama

2
  • How does your ftp server configured? It is open for anonymous access? Or it asking some login/password (For example from Active Directory)?
    – c0rp
    Jul 28, 2014 at 10:52
  • Hi C0rp! Thanks for the quick reply! The ftp server requires log in credentials to access it. I initially successfully do that without any trouble - and even put the setting to "Remember forever". I can then browse the server's files and folders without any hiccups. However, for some strange reason, I loose my link to the drive after some time. I get the error message: The folder contents could not be displayed. Sorry, could not display all the contents of "<folder name>": Host closed connection.
    – rama
    Jul 28, 2014 at 11:40

1 Answer 1

1

The copy command for REMOTE copy is rcp not cp. A more secure version is scp (scp will ask for a passwords or a passphrase if needed). It takes the form of

scp files* {user}@{ip-address}:/dir/to/place/files/

You can put the directories in between "'s if you have spaces somewhere:

scp files* {user}@{ip-address}:"/dir 2/to 3/place 5/files/" 

4
  • Thanks for your quick response Rinzwind! Really appreciate it! Unfortunately, the command didn't work even after replacing cp with rcp. The error message reads: Connection closed by 192.160.55.55 lost connection The same was the result even when using scp. I'm I getting the destination path wrong? This is what my code looked like: scp "media/Windows7_OS/Users/Profile One/Desktop" [email protected]:"/nas-kkm/MyOffice/T430_Laptop/Profile One/Desktop" I'm I messing up the syntax in some way?
    – rama
    Jul 28, 2014 at 12:24
  • No you probably need to set it up ;) "connection closed" means no permission; if the dir was invalid it would complain specifically about it being malformed
    – Rinzwind
    Jul 28, 2014 at 12:26
  • The funny thing is, I can comfortably browse the contents of the destination directory. I can navigate through the folders OK. But then at the same time, when I run this command: scp "media/Windows7_OS/Users/Profile One/Desktop" [email protected]:"/nas-kkm/MyOffice/T430_Laptop/Profile One/Desktop" I keep getting the same error: Connection closed by 192.160.55.55 lost connection.
    – rama
    Jul 28, 2014 at 13:26
  • @rama For scp you need ssh server to be configured properly.
    – c0rp
    Jul 28, 2014 at 15:44

You must log in to answer this question.

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