Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

docker-machine scp Permission denied #2722

Open
AlexZeitler opened this issue Jan 2, 2016 · 11 comments
Open

docker-machine scp Permission denied #2722

AlexZeitler opened this issue Jan 2, 2016 · 11 comments
Labels

Comments

@AlexZeitler
Copy link

I created a folder on a Docker machine (default) like this:

docker-machine ssh default -- mkdir -p /home/alexzeitler/src/myproject/subproject

Then I tried to copy local files from the current directory into it:

docker-machine scp -r . default:/home/alexzeitler/src/myproject/subproject

This results in:

scp: /home/alexzeitler/src/myproject/subproject/./config.json: Permission denied
scp: /home/alexzeitler/src/myproject/subproject/./node_modules: Permission denied
scp: /home/alexzeitler/src/myproject/subproject/./.gitignore: Permission denied
scp: /home/alexzeitler/src/myproject/subproject/./docker-compose.yml: Permission denied
scp: /home/alexzeitler/src/myproject/subproject/./api: Permission denied
scp: /home/alexzeitler/src/myproject/subproject/./app.js: Permission denied
@AlexZeitler
Copy link
Author

I had to regenerate the certs (because of #1954 on Ubuntu as well) - might this cause the problem?

After re-creating the VM the issue is gone.

@AlexZeitler
Copy link
Author

Regeneration of certs doesn't seem to cause it. Created another directory and tried to scp into it and it failed again.

@dgageot
Copy link
Member

dgageot commented Jan 4, 2016

Hi @AlexZeitler, can you tell us which version of docker-machine you are using and which OS you are on? Also if you are not using 0.5.5 of docker-machine, can you please try it?

@AlexZeitler
Copy link
Author

@dgageot Thanks for your reply.
I'm running on Ubuntu 14.04 x64, docker-machine version 0.5.5, build 02c4254

@rjurney
Copy link

rjurney commented Apr 25, 2016

This problem is incredibly limiting. I can't put a file on my docker machine!

@AlexZeitler
Copy link
Author

@MatrixManAtYrService
Copy link

MatrixManAtYrService commented Jun 18, 2016

In my case, this had to do with filesystem permissions on my boot2docker instance. I worked around it like so:

docker-machine scp -r myFolder/ machineName:/tmp
docker-machine ssh machineName sudo cp -r /tmp/myFolder /path/to/actual/destination

@n0wak
Copy link

n0wak commented Jul 12, 2018

Is there a more elegant solution to this than the above? It works but seems counter to what you'd want to do.

@awhillas
Copy link

wow, this is hacky...

@Dvisacker
Copy link

Dvisacker commented Nov 23, 2018

The correct syntax for copying files to a machine is the following:
docker-machine scp path user@machine:path

So for example, it would be:
docker-machine scp ./src ubuntu@my-machine:~/dest

Don't forget the ~ to indicate that you are copying to your home folder. If you simply put /dest, it will not work because the user (in the above example ubuntu does not have permissions outside ~/.

@RafaelRNunes
Copy link

the default password to copy is tcuser

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants