Support Questions
Find answers, ask questions, and share your expertise

Trying to copy file from my windows machine to sandbox and not succeding

Contributor

Hello @slachterman

Greetings!!!

I am trying to copy a file from my local windows machine to sandbox using below command and not seeing the file in sandbox root directory after executing command.

scp -P C:/Users/rnkumashi/Downloads/sample.txt root@localhost:/root

1.I am connected to sandbox using Vm ware.

2.After executing the command i am trying to list the content in sandbox root directory and not seeing the file.

Please see below for the details.

5303-scp-command.png

any help would be great and i am new to sandbox.

1 ACCEPTED SOLUTION

Accepted Solutions

@Ravikumar Kumashi

Try this command instead.

scp -P 2222 C:/Users/rnkumashi/Downloads/sample.txt root@localhost:/root

However you need something like cygwin to make scp work from windows machine.

You have to run the command from windows, not sandbox.

This is a good document to get you started http://hortonworks.com/hadoop-tutorial/learning-the-ropes-of-the-hortonworks-sandbox/

View solution in original post

33 REPLIES 33

@Ravikumar Kumashi the scp command is missing the port number (please notice that the "usage" text was returned by the command, which means the syntax was incorrect). Please try specifying 2222 after the -P switch.

@Ravikumar Kumashi

Try this command instead.

scp -P 2222 C:/Users/rnkumashi/Downloads/sample.txt root@localhost:/root

However you need something like cygwin to make scp work from windows machine.

You have to run the command from windows, not sandbox.

This is a good document to get you started http://hortonworks.com/hadoop-tutorial/learning-the-ropes-of-the-hortonworks-sandbox/

View solution in original post

Contributor

@slachterman Thanks for your reply...

Do you mean i have to use below command in my windows machine command prompt to copy files to sandbox root directory.

scp -P 2222 C:/Users/rnkumashi/Downloads/sample.txt root@localhost:/root

1.How does my windows machine(command prompt) make connection to sandbox server and copy the file to sandbox root directory ? do i need to install cygwin for that?.

2.Yes i trying to refer the same link which you shared.

Yes, you have to run the the scp command from Windows, not the virtual machine. Windows does not natively offer the ability to scp, so trying to scp from the virtual machine to Windows will not work. Windows also does not have an SCP command by default. You must install WinSCP or PSCP (via PuTTY) to get access to an SCP command.

Here are links to the respective software:

PuTTY

WinSCP

@Ravikumar Kumashi yes, that is correct, you want to run the command from your local machine since that is where the file lives that you are scp'ing over to the sandbox. You can invoke via Cygwin or you can use pscp (from the makers of Putty) and run pscp from the Windows command line.

Contributor

@slachterman

I installed cygwin in my windows machine and trying to execute the same and it is not recongizing scp command

5304-cygwin.png

I would recommend looking into pscp if you are on a Windows platform. If using Cygwin, you'll need to install scp, see http://stackoverflow.com/questions/18688502/how-do-i-download-scp-and-ssh-on-cygwin. scp is part of the openssh package as noted.

Contributor
@slachterman

I installed openssh package for cygwin, it recongnizes scp now.

but still no luck in copying to sandbox server, please see below

5305-scp-openssh.png

@Ravikumar Kumashi in Cygwin, you can access the root of your C: drive by specifying the directory /cygdrive/c. So the path would be /cygdrive/c/Users/rnkumashi/Downloads/sample.txt

This is one of the reasons I recommended pscp.