Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Cannot scp a file from local machine to Azure Sandbox

Solved Go to solution

Cannot scp a file from local machine to Azure Sandbox

Contributor

I am able to ssh into my Sandbox on Azure but can't send a file via scp because I'm challenged for a localhost password which I do not know. Assuming my Azure username is myName, this is the command I'm running:

scp -P 22 ~/Downloads/Somefile.txt MyName@localhost:/MyName

The console returns with:

MyName@locahost's password:

I've tried my Azure password, my Mac's password, the ENTER key, and "hadoop". Nothing works. I tried both port 22 and port 2222. Please advise. I'd like to move on to some real tutorials but I can't even copy a file to my Sandbox! :(

I get "Permission denied, please try again" and after 3 attempts "Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)" and then "lost connection"

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Cannot scp a file from local machine to Azure Sandbox

Contributor

OK, I finally got it to work! The instruction in Step 1.4 in Section 2 of the "Learning the Ropes ..." tutorial (Sandbox in Microsoft Azure) is wrong, in 3 ways:

  1. The scp port for Azure is 22, not 2222
  2. You must scp into Azure as root; therefore you must reset the root password in your Sandbox first using 'sudo passwd root'
  3. Your home directory is not just “RemoteUser” from root’s perspective, but /home/RemoterUser'
7 REPLIES 7

Re: Cannot scp a file from local machine to Azure Sandbox

@Suzanne Dimant

It is your sandbox root account with the password you set initially when you accessed the sandbox.

Highlighted

Re: Cannot scp a file from local machine to Azure Sandbox

Contributor

Thank you @Constantin Stanca, that worked!

Re: Cannot scp a file from local machine to Azure Sandbox

Contributor

I'm sorry, @Constantin Stanca ... I think I accepted your answer prematurely.

I got past the password challenge, but then scp couldn't find my file so I opened a separate question "Aligning Home Directories between Sandbox and local Mac?" which is still unresolved. After some research, I am pretty sure the problem was that I running scp from inside my ssh session (trying to send a file from local to remote) which doesn't really make sense. When I run scp from a separate terminal window, I can't get past the password challenge.

Also, the password I used to get past the password challenge (when I wrote back to you) was the one I used to set up my Sandbox in Azure. But I just realized that's not actually a root password, it's just a user account password. I just confirmed that by trying to "su" from within my ssh session and failing. I also tried ssh'g into my Sandbox as root and failed.

How do I find and/or recover my Sandbox root password?

Re: Cannot scp a file from local machine to Azure Sandbox

Contributor

Update: I was able to make a little progress by resetting my root password on my Sandbox (using 'sudo passwd root') and then scp'g in as root with that password. The console response makes it seems as if a file was actually transferred but I cannot find it anywhere on my Sandbox (even using 'find /*.txt'). In that case the console output was:

root@xx.xx.xx.xx:'s password:

Somefile.txt 100% 133KB 133.4KB/s 00:00

When I try port 2222 (as per the tutorial), I just time-out with the response below (I read in other posts that people are recommending port 22 for Azure):

ssh: connect to host xx.xx.xx.xx port 2222: Operation timed out

lost connection

When I try to scp in as root from the web client, I'm back to ground zero:

root@xx.xx.xx.xx:'s password:

/Path/Somefile.txt: No such file or directory

So confused ... :(

Re: Cannot scp a file from local machine to Azure Sandbox

Contributor

OK, I finally got it to work! The instruction in Step 1.4 in Section 2 of the "Learning the Ropes ..." tutorial (Sandbox in Microsoft Azure) is wrong, in 3 ways:

  1. The scp port for Azure is 22, not 2222
  2. You must scp into Azure as root; therefore you must reset the root password in your Sandbox first using 'sudo passwd root'
  3. Your home directory is not just “RemoteUser” from root’s perspective, but /home/RemoterUser'

Re: Cannot scp a file from local machine to Azure Sandbox

@Suzanne Dimant

Good for you! I guess that if you look retrospectively, I responded to most of your question as it was stated.

Re: Cannot scp a file from local machine to Azure Sandbox

Contributor

I agree. It was a HUGE hint. I had a few other things to think through but knowing I had to scp in as root was pivotal. Thank you! BTW the tutorial needs a little correction/elaboration on that step; not sure exactly who that needs to be communicated to?