{"author_url":"https://blog.hatena.ne.jp/tomy_125/","provider_url":"https://hatena.blog","categories":["Docker","OS","ssh"],"width":"100%","type":"rich","blog_title":"tomy_125: Note","provider_name":"Hatena Blog","height":"190","image_url":null,"title":"Docker\u30b3\u30f3\u30c6\u30ca\u3067 systemctl \u3067 sshd\u8d77\u52d5\u3057\u3066\u63a5\u7d9a","blog_url":"https://tomy-125.hatenablog.jp/","published":"2022-07-26 04:40:04","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftomy-125.hatenablog.jp%2Fentry%2F2022%2F07%2F26%2F044004\" title=\"Docker\u30b3\u30f3\u30c6\u30ca\u3067 systemctl \u3067 sshd\u8d77\u52d5\u3057\u3066\u63a5\u7d9a - tomy_125: Note\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","url":"https://tomy-125.hatenablog.jp/entry/2022/07/26/044004","description":"\u30b3\u30f3\u30c6\u30ca\u8d77\u52d5 docker run -d --rm -p 127.0.0.1:10022:22 --privileged oraclelinux:7.9 /sbin/init \u30b3\u30f3\u30c6\u30ca\u306b\u63a5\u7d9a \u30b3\u30f3\u30c6\u30ca\u306essh\u95a2\u9023\u8a2d\u5b9a\u3092\u5b9f\u65bd docker exec -it <container_name> bash \u30b3\u30f3\u30c6\u30ca\u5185\u3067 useradd newuser passwd newuser \u30b3\u30f3\u30c6\u30ca\u306bssh\u63a5\u7d9a \u30db\u30b9\u30c8\u304b\u3089\u30b3\u30f3\u30c6\u30ca\u306bssh ssh newuser@localhost -p 10022 \u4ee5\u4e0a","author_name":"tomy_125","version":"1.0"}