Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

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

avatar
Rising Star

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

avatar
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
33 REPLIES 33

avatar
Rising Star

@slachterman Thanks,that issue resolved, now i am getting connection to host localhost is refused for port 2222

5306-connection-refused.png

avatar

@Ravikumar Kumashi

Make sure your VM is up and sshd is running and listening on port 2222: sudo netstat -anp | grep sshd

Make sure no firewall rules are getting in the way.

If confirmed, try using 127.0.0.1 instead of localhost and if that doesn't work try editing your hosts file so that sandbox.hortonworks.com resolves to 127.0.0.1 and then use the FQDN sandbox.hortonworks.com instead of localhost.

avatar
Rising Star
@slachterma

i was checking sshd is running or not using below 'service ssh status' and it was not running

I used below command to start 'sudo service ssh start' but could not start

5310-ssh-status-and-start.png


ports-listening.pngport-22.png

avatar

@Ravikumar Kumashi sshd not ssh

avatar
Rising Star
@slachterman

Sorry, i changed to 'sudo service sshd' and looks fine.

5322-2016-06-28-21-48-51-10156106-remote-desktop-connec.png

and also i was trying to check ports it is listening using below command and looks like it is not listening to port 2222, how do i make it to listen on port 2222 also

5321-2016-06-28-21-48-03-10156106-remote-desktop-connec.png

avatar

Hi @Ravikumar Kumashi

Can you check how is your vm network is configured?

Ensure that vm network is set to NAT and port forwarding is configured.

If your network is configured to host only then you need to give ip instead of localhost and remove -P 2222 from command.

Can you paste the output of ifconfig from vm?

avatar
Rising Star
@Rahul Pathak

below is the output of ifconfig

5323-ifconfig.png

avatar

In this case below command should work for you.

scp /cygdrive/c/Users/rnkumashi/Downloads/sample.txt root@192.168.228.128:/root

avatar

@Ravikumar Kumashi

I tried the following steps in WINSCP and was able to transfer the file. Please check if the same can be done at your end.

1. Edit the hosts entry C:\Windows\System32\Drivers\etc : hosts file and added the IP

172.16.0.6 sandbox.hortonworks.com sandbox.

at the end of the file.

2. Use the following credentials for WINSCP

File protocol : SCP

IP : 172.16.0.6 Port : 22

User : root; Password : Sandbox password.

avatar
Rising Star
@Bharath Kumar K

Thanks!!! will try and let you know how it goes