we harmoyos 论坛

 找回密码
 立即注册
查看: 941|回复: 0

远程登录ubuntu root用户 显示access denied

[复制链接]
  • TA的每日心情
    开心
    2024-1-19 14:48
  • 签到天数: 17 天

    [LV.4]偶尔看看III

    48

    主题

    77

    帖子

    1007

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    1007
    发表于 2022-6-18 09:31:14 | 显示全部楼层 |阅读模式
    为了跑鸿蒙, 选择 windows + ubuntu 双系统模式 , 需配置 SSH 登录 ubuntu , 发现 root 登录输入密码后显示 access denied

    解决办法:
    1. vim /etc/ssh/sshd_config
    找到
    #PermitRootLogin prohibit-password
    改成
    PermitRootLogin yes
    :wq 保存退出


    2.重启ssh
    service sshd restart


    效果:
    1.     ┌──────────────────────────────────────────────────────────────────────┐
    2.     │                 • MobaXterm Personal Edition v21.2 •                 │
    3.     │               (SSH client, X server and network tools)               │
    4.     │                                                                      │
    5.     │ ➤ SSH session to root@192.168.1.204                                  │
    6.     │   • Direct SSH      :  ✔                                             │
    7.     │   • SSH compression :  ✔                                             │
    8.     │   • SSH-browser     :  ✔                                             │
    9.     │   • X11-forwarding  :  ✔  (remote display is forwarded through SSH)  │
    10.     │                                                                      │
    11.     │ ➤ For more info, ctrl+click on help or visit our website.            │
    12.     └──────────────────────────────────────────────────────────────────────┘

    13. Welcome to Ubuntu 20.04.4 LTS (GNU/Linux 5.4.0-26-generic x86_64)

    14. * Documentation:  https://help.ubuntu.com
    15. * Management:     https://landscape.canonical.com
    16. * Support:        https://ubuntu.com/advantage

    17. 0 updates can be applied immediately.



    18. The programs included with the Ubuntu system are free software;
    19. the exact distribution terms for each program are described in the
    20. individual files in /usr/share/doc/*/copyright.

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

    23. root@turingkuang:~# ls
    24. Desktop  Documents  Downloads  Music  Pictures  Public  Templates  thinclient_drives  Videos
    复制代码


    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    手机版|小黑屋|we harmonyos 论坛 ( 粤ICP备 2022126345号 )

    GMT+8, 2024-4-29 21:59 , Processed in 0.051012 second(s), 24 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2021, Tencent Cloud.

    快速回复 返回顶部 返回列表