15
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

docker上のCentOS7でsshdを起動

Last updated at Posted at 2014-07-14

docker使っていない人にdockerの環境を使ってもらうにはsshdがないと拒絶反応起こす。
あとctrl-pが喰われるのがとても痛いのでsshdやっぱりいいよね。

docker run --name production -it -p 2222:22 \
 tukiyo3/centos-ja:7.0 /bin/bash

/etc/rc.d/init.d/functions が無いとssh-keygenが出来ないので
initscriptsをインストール

sshd
yum install -y passwd openssh-server initscripts
/usr/sbin/sshd -D &
コンテナにssh接続
ssh root@192.168.2.4 -p 2222
15
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?