docker: SSH access directly into container

后端 未结 4 1127
孤城傲影
孤城傲影 2021-01-06 07:41

Up to now we use several linux users:

  • system_foo@server
  • system_bar@server
  • ...

We want to put the system users into docker cont

4条回答
  •  抹茶落季
    2021-01-06 07:56

    nsenter could work for you. First ssh to the host and then nsenter to the container.

    PID=$(docker inspect --format {{.State.Pid}} )`
    nsenter --target $PID --mount --uts --ipc --net --pid
    

    source http://jpetazzo.github.io/2014/06/23/docker-ssh-considered-evil/

提交回复
热议问题