美文网首页系统和应用
使用ssh登陆docker容器

使用ssh登陆docker容器

作者: qishuai | 来源:发表于2018-09-12 23:32 被阅读0次
  • 基本操作

    docker run -it -p 2222:22 ubuntu /bin/bash
    apt-get update
    apt-get install ssh
    ssh-keygen
    vim authorized_keys
    
  • 配置ssh vim /etc/ssh/sshd_config

    PermitRootLogin yes
    AuthorizedKeysFile  /root/.ssh/authorized_keys
    PasswordAuthentication no
    
  • 启动sshd

    service ssh start
    
  • ssh连接

    ssh root@localhost -p 2222
    

相关文章

网友评论

    本文标题:使用ssh登陆docker容器

    本文链接:https://www.haomeiwen.com/subject/pzrigftx.html