su : must be run from a terminal

After some googling, I found the solution from Tero's glob. If you have python installed, just run the following from your shell:

echo "import pty; pty.spawn('/bin/bash')" > /tmp/asdf.py
python /tmp/asdf.py 30 down vote
 

You can log into the Docker Image using the root user (ID = 0) instead of the provided default user when you use the -u option. E.g.

docker exec -u 0 -it mycontainer bash

root (id = 0) is the default user within a container. The image developer can create additional users. Those users are accessible by name. When passing a numeric ID, the user does not have to exist in the container.

su terminal get around---docker root的更多相关文章

  1. docker - 修改镜像/容器文件或者 "Docker root dir" 的在宿主机上的存储位置

    背景 之前在使用docker的时候,由于启动container的时候用的是默认的mount(路径为 /var/lib/docker),这个目录对应的硬盘空间有限,只有200G左右.现在随着程序运行,有 ...

  2. Linux学习(十二)mkpasswd、su、sudo、限制root远程登录

    一.mkpasswd mkpasswd用来生成随机密码字符串.可以指定长度和特殊字符的长度: [root@ruanwenwu01 ~]# mkpasswd O7.alw5Wq [root@ruanwe ...

  3. Linux学习总结(六)-su命令 sudo 命令 限制root远程登录

    root 用户拥有至高无上的权利,那么我们运维人员是不是直接在root用户下处理所有问题呢? 答案是否定的,权力越大,责任越大,人是会犯错的,因此我们要在不影响我们的工作情况下,尽量限制我们的权力,以 ...

  4. 二进制方式安装docker(非root用户启动docker)

    二进制方式安装docker(非root用户启动docker) 一.下载安装包: 地址:https://download.docker.com/linux/static/stable/x86_64/ 这 ...

  5. su root 和su - root 的区别

    su - root  is   the same as su - just like login as root, then the shell is login shell,which mean i ...

  6. 非root用户如何使用docker命令

    docker命令默认只能root使用的,但我们可以赋权给其他用户,使用时先照常新建用户: [root@10 ~]# useradd docker [root@10 ~]# passwd docker ...

  7. CentOS7 启动[root@localhost ~]# systemctl start docker Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for de

    1).在linux虚拟机上安装docker步骤:1.检查内核版本,必须是3.10及以上uname ‐r2.安装dockeryum install docker3.输入y确认安装4.启动docker[r ...

  8. Linux安全加固(二)禁止普通用户su到root/设置SSH终端接入白名单/修改history条数

    一.禁止普通用户su到root管理员.设置可以su到root的白名单 1.首先看一下正常情况 2.可以看到普通用户使用su root命令,输入密码即可登录到root用户 3.下面开始配置禁止所有普通用 ...

  9. Centos + docker,Ubuntu + docker介绍安装及详细使用

    docker笔记 常用命令 设置docker开机自启:sudo chkconfig docker on 查所有镜像: docker images 删除某个镜像:docker rmi CONTAINER ...

随机推荐

  1. 第五根k线

    无论是下落还是上涨的一波,到第五根k线就要注意了.要么加速,不然就要翻转了

  2. Android横屏竖屏切换的问题

    Android横屏竖屏切换的问题 http://blog.sina.com.cn/s/blog_77c632410101790w.html

  3. Java的线程模型

    并发不一定要依赖多线程(如PHP中很常见的多进程并发),但是在Java里面谈论并发,大多数都与线程脱不开关系. 线程是比进程更轻量级的调度执行单位,线程的引入,可以把一个进程的资源分配和执行调度分开, ...

  4. node工具--connect

    HTTP构建一个网站: var http = require('http'); var fs = require('fs'); var server = http.createServer(funct ...

  5. 错误:不存在类型或命名空间名称 "Control”

    编译时出现如下错误: 命名空间中不存在类型或命名空间名称 "Control"(是否缺少程序集引用?).     在引用中添加UIAutomationProvider后解决.

  6. topcoder SRM 592 DIV2 LittleElephantAndPermutationDiv2

    #include <iostream> #include <vector> #include <algorithm> #include <iterator&g ...

  7. 【BZOJ】3850: ZCC Loves Codefires(300T就这样献给了水题TAT)

    http://www.lydsy.com/JudgeOnline/problem.php?id=3850 题意:类似国王游戏....无意义.. #include <cstdio> #inc ...

  8. 解决xubuntu的thunar第一次启动慢

    装了Xubuntu后,一直都挺好,只不过就是有一个问题老困扰我,就是每次开机打开thunar都是极慢的.... 一直没注意,原来也一直找不到问题,后来今天一搜,唷呵...找到了. 解决方法 thuna ...

  9. WordPress折腾日记

    安装环境: 我开了个虚拟机xp....用xampp的整合包..下载地址https://www.apachefriends.org/zh_cn/download.html 跟着安装就行了.最后打开xam ...

  10. COJ980 WZJ的数据结构(负二十)

    试题描述 在Bytemountains有N座山峰,每座山峰有他的高度h_i.有些山峰之间有双向道路相连,共M条路径,每条路径有一个困难值,这个值越大表示越难走,现在有Q组询问,每组询问询问从点v开始只 ...