docker-machine boot2docker root密码 [英] docker-machine boot2docker root password

查看:303
本文介绍了docker-machine boot2docker root密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在任何地方都找不到答案...我使用docker-machine创建了一个VM(boot2docker).我需要使用root编辑一些文件.

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

boot2docker中的root密码是什么?

What is the root password in boot2docker?

推荐答案

如果只有一台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 

从上面可以看到,默认是您的计算机的名称,您可以使用ssh进行如下操作:

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

$ docker-machine ssh default

在您进入时,这是一个简单的root伪装

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:~# 

此外,正如@MediaVince所提到的,您可以使用以下凭据:

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

用户: docker

pwd:跟踪器

这篇关于docker-machine boot2docker root密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆