\u521b\u5efa\u5bb9\u5668\u65f6\u6307\u5b9a\u6620\u5c04\u7684\u7aef\u53e3<\/strong><\/span><\/div>\n\r\ndocker run --name test -dit -p 8022:22 2c886f766286 \/bin\/bash\r\n<\/pre>\n\u53e6\u5916\u5728\u5bbf\u4e3b\u673a\u4e0a\u4e5f\u662f\u53ef\u4ee5\u770b\u5230\u5bf9\u5e94\u7684\u7aef\u53e3\u662f\u5426\u88abdocker\u5bb9\u5668\u76d1\u542c\u4e86<\/p>\n
\r\nnetstat -tunlp\r\ntcp6 0 0 :::8022 :::* LISTEN 24209\/docker-proxy\r\n<\/pre>\n\u767b\u5f55\u5bb9\u5668\u4e2d\uff0c\u4fee\u6539root\u5bc6\u7801\uff0c\u5b89\u88c5openssh\u670d\u52a1<\/strong><\/span><\/div>\n\r\ndocker exec -ti test \/bin\/bash\r\n[root@84641e8d0f74 \/]#passwd #\u4fee\u6539\u5bb9\u5668\u4e2dcentos\u7cfb\u7edfROOT\u8d26\u6237\u7684\u5bc6\u7801\r\n[root@84641e8d0f74 \/]#yum -y install openssh* #\u5b89\u88c5openssh\u670d\u52a1\r\n[root@84641e8d0f74 \/]#service sshd start\r\n<\/pre>\n\u5bbf\u4e3b\u673a\u6dfb\u52a0\u7aef\u53e3\u653e\u884c<\/strong><\/span><\/div>\n\r\niptables -A INPUT -p tcp --dport 8022 -j ACCEPT\r\nservice iptables save\r\n<\/pre>\n\u8fdc\u7a0b\u767b\u5f55\u6d4b\u8bd5\u4e00\u4e0b\uff0c\u767b\u5f55\u6210\u529f\uff01<\/p>\n
<\/p>\n
\u4e3a\u4e86\u65b9\u4fbf\u4ee5\u540e\u4f7f\u7528\uff0c\u53ef\u4ee5\u5c06\u8fd9\u4e2a\u5f00\u542f\u4e86ssh\u767b\u5f55\u7684\u5bb9\u5668\u4fdd\u5b58\u4e3a\u955c\u50cf<\/strong><\/span><\/div>\n\r\ndocker commit 84641e8d0f74 centos_6.6_ssh #\u5bb9\u5668ID \u521b\u5efa\u7684\u955c\u50cf\u540d\r\ndocker images \u53ef\u4ee5\u770b\u5230\u8be5\u955c\u50cf\u5df2\u7ecf\u521b\u5efa\u6210\u529f\uff0c\u4e0b\u6b21\u9700\u8981\u65b0\u5efa\u5bb9\u5668\u65f6\u53ef\u76f4\u63a5\u4f7f\u7528\u8be5\u955c\u50cf\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"docker run –name test -dit -p 8022:22 2c886f766286 \/bi […]<\/p>\n","protected":false},"author":668,"featured_media":16254,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-160842","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/160842","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/668"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=160842"}],"version-history":[{"count":8,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/160842\/revisions"}],"predecessor-version":[{"id":161623,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/160842\/revisions\/161623"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/16254"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=160842"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=160842"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=160842"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}