欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

創建帶sshd服務的docker image

系統 1995 0

參考: https://docs.docker.com/examples/running_ssh_service/


1. 創建一個空目錄用于存放 Dockerfile

mkdir -p /home/thm/docker/test/new_image

vim Dockerfile

Dockerfile 的內容為:

?

        FROM tanghuimin0713/ubuntu_amd64:
      
        14.04
      
      
        
  RUN apt
      
      -
      
        get
      
      
         update
  RUN apt
      
      -
      
        get
      
       install -y openssh-
      
        server
  #RUN mkdir 
      
      /
      
        var
      
      /run/
      
        sshd
  RUN sed 
      
      -i 
      
        '
      
      
        s/^PermitRootLogin/#PermitRootLogin/
      
      
        '
      
       /etc/ssh/
      
        sshd_config
  RUN echo 
      
      
        "
      
      
        PermitRootLogin yes
      
      
        "
      
       >> /etc/ssh/
      
        sshd_config
  RUN echo 
      
      
        "
      
      
        root:root
      
      
        "
      
       |
      
         chpasswd
  EXPOSE 
      
      
        22
      
    

?

2. build a image

docker build -t tanghuimin0713/ubuntu_amd64_ssh .

3. run a container

docker run -d -p 2222:22 tanghuimin0713/ubuntu_amd64_ssh /usr/sbin/sshd -D

4. 主機下 ssh 登陸 docker 容器

ssh root@localhost -p 2222

密碼為: root

      root@ubuntu:/home/thm/docker/test/new_image# ssh root@localhost -p 
      
        2222
      
      
        
The authenticity of host 
      
      
        '
      
      
        [localhost]:2222 ([127.0.0.1]:2222)
      
      
        '
      
       can
      
        '
      
      
        t be established.
      
      
ECDSA key fingerprint 
      
        is
      
       bd:
      
        41
      
      :3f:e4:e3:bd:b4:
      
        46
      
      :
      
        54
      
      :fe:1b:
      
        46
      
      :eb:
      
        60
      
      :f3:
      
        73
      
      
        .
Are you sure you want to 
      
      
        continue
      
       connecting (yes/no)?
      
         yes
Warning: Permanently added 
      
      
        '
      
      
        [localhost]:2222
      
      
        '
      
      
         (ECDSA) to the list of known hosts.
root@localhost
      
      
        '
      
      
        s password: 
      
      
Welcome to Ubuntu 
      
        14.04
      
       LTS (GNU/Linux 
      
        3.13
      
      .
      
        0
      
      -
      
        32
      
      -
      
        generic x86_64)

 
      
      * Documentation:  https:
      
        //
      
      
        help.ubuntu.com/
      
      
        
The programs included with the Ubuntu system are free software;
the exact distribution terms 
      
      
        for
      
       each program are described 
      
        in
      
      
         the
individual files 
      
      
        in
      
       /usr/share/doc
      
        /*
      
      
        /copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

root@db36812760ac:~# 
      
    

成功。

若在 ssh 登陸時提示:

?

      
        @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED
      
      !
      
             @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY
      
      !
      
        
Someone could be eavesdropping on you right now (man
      
      -
      
        in
      
      -the-middle attack)!
      
        
It 
      
      
        is
      
      
         also possible that a host key has just been changed.
The fingerprint 
      
      
        for
      
       the ECDSA key sent by the remote host 
      
        is
      
      
        
bd:
      
      
        41
      
      :3f:e4:e3:bd:b4:
      
        46
      
      :
      
        54
      
      :fe:1b:
      
        46
      
      :eb:
      
        60
      
      :f3:
      
        73
      
      
        .
Please contact your system administrator.
Add correct host key 
      
      
        in
      
       /root/.ssh/known_hosts to 
      
        get
      
       rid of 
      
        this
      
      
         message.
Offending ECDSA key 
      
      
        in
      
       /root/.ssh/known_hosts:
      
        5
      
      
        
  remove with: ssh
      
      -keygen -f 
      
        "
      
      
        /root/.ssh/known_hosts
      
      
        "
      
       -R 
      
        172.17
      
      .
      
        0.2
      
      
        
ECDSA host key 
      
      
        for
      
      
        172.17
      
      .
      
        0.2
      
      
         has changed and you have requested strict checking.
Host key verification failed.
      
    

?

rm $HOME/.ssh/known_hosts 即可。

?

?

創建帶sshd服務的docker image


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 九九精品视频在线观看九九 | 国产精品欧美亚洲日本综合 | 日韩亚洲欧美视频 | 久一久久 | 欧美18xxxx | 久久成人免费 | 免费人成网站线观看合集 | 久久美女| 国产男女免费完整版视频 | 国产精品亚洲国产 | 91p在线观看 | 色天天综合色天天碰 | 日本高清香蕉色视频在线观看 | 日本黄色福利视频 | 久久视频这里只精品3国产 色偷偷偷 | 草草视频在线观看 | 欧美色伊人 | 欧美中文字幕 | 成人蜜桃av | www.国产精| 亚洲精品一区二区三区在线观看 | 国产成人精品免费视频大全可播放的 | 中文字幕亚洲欧美 | 欧美高清另类自拍视频在线看 | 9999人体做爰大胆视频 | 欧美精品一区三区 | 欧美成人免费高清网站 | 97精品一区二区 | 在线观看亚洲一区二区三区 | 日韩免费黄色片 | 玖玖在线免费视频 | 国产成人a | 欧美日一区二区 | 91观看 | 国产欧美精品一区二区三区 | 国产麻豆剧传媒精品好看的片 | 日韩精品 | 日日摸夜夜添夜夜添亚洲女人 | 亚洲色婷婷久久精品AV蜜桃久久 | 达达兔午夜起神影院在线观看麻烦 | 色人阁久久|