在EC2的ubuntu实例中中安装DOCKER

最近在EC2主机中启用了一个ubuntu20.4容器。试着把启动一个DOCKER服务的过程记录一下。

使用下载的pem登陆

在linux系统,
chmod 400 pemfile
ssh -i penfile ubuntu@IP
在win10
需要更改pem权限,
将下面的代码存为bat,将pem拖动到上面。

:: # Set Variable ::
Set Key=%1

:: # Remove Inheritance ::
Cmd /c Icacls %Key% /c /t /Inheritance:d

:: # Set Ownership to Owner ::
Cmd /c Icacls %Key% /c /t /Grant %UserName%:F

:: # Remove All Users, except for Owner ::
Cmd /c Icacls %Key% /c /t /Remove Administrator "Authenticated Users" BUILTIN\Administrators BUILTIN Everyone System Users

:: # Verify ::
Cmd /c Icacls %Key%

但是还是需要打开一下权限
图片方式的英文说明

ubuntu初始root密码

安装完Ubuntu后忽然意识到没有设置root密码,不知道密码自然就无法进入根用户下。

到网上搜了一下,原来是这么回事:
Ubuntu的默认root密码是随机的,即每次开机都有一个新的root密码。

解决方法:
我们可以在终端输入命令“sudo passwd”,然后输入当前用户的密码后"Enter"。
终端会提示我们输入新的密码并确认,此时的密码就是root新密码。
修改成功后,输入命令 su root,再输入新的密码就ok了。

具体操作如下:

user@instant-contiki:~$ sudo passwd
Enter new UNIX password:  
Retype new UNIX password: 
passwd: password updated successfully
user@instant-contiki:~$ 

user@instant-contiki:~$ su -
Password: 
root@instant-contiki:~# 

若输入exit命令,则从root退回到普通用户

原文链接:https://blog.csdn.net/frank_jb/article/details/50927088

安装DOCKER

https://gist.github.com/wdullaer/f1af16bd7e970389bad3
wget -O - https://gist.githubusercontent.com/wdullaer/f1af16bd7e970389bad3/raw/install.sh | bash or
wget -O - https://bit.ly/docker-install | bash (if you trust wdullaer and me 😛)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wjcroom

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值