docker-machine boot2docker root password

DockerBoot2dockerDocker Machine

Docker Problem Overview


Haven't found an answer anywhere... I created a VM (boot2docker) using docker-machine. I need to edit some files using root.

What is the root password in boot2docker?

Docker Solutions


Solution 1 - Docker

If you only have a single docker machine, you simply do:

$ docker-machine ssh

If you have multiple machines, you need to find your "machine name" first:

$ docker-machine ls
NAME      ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER    ERRORS
default   *        virtualbox   Running   tcp://192.168.99.101:2376           v1.10.2 

From the above, you can see that default is the name of your machine and you can ssh as follows:

$ docker-machine ssh default

When you're in, it's a simple case of sudo-ing to root

docker@default:~$ sudo -i
Boot2Docker version 1.10.2, build master : 611be10 - Mon Feb 22 22:47:06 UTC 2016
Docker version 1.10.2, build c3959b1
root@default:~# 

Edited: Also, as @MediaVince mentioned you can use the following credentials:

user: docker

pwd: tcuser

Solution 2 - Docker

just type

$ docker-machine ssh your_environment

and then to be root

$ sudo -i

hope it helps

Solution 3 - Docker

Login via ssh as docker user:

$ ssh docker@<docker-machine-ip>

> Password: tcuser

Then you can change on root user, just run sudo su root

Solution 4 - Docker

Ok the key was not to do "su root" but rather "su sudo". It then doesn't ask for root password.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser1340582View Question on Stackoverflow
Solution 1 - DockerNick De GreekView Answer on Stackoverflow
Solution 2 - DockergrimabeView Answer on Stackoverflow
Solution 3 - DockergiokoguashviliView Answer on Stackoverflow
Solution 4 - Dockeruser1340582View Answer on Stackoverflow