解决root@localhost's password:localhost:permission denied,please try again

第一种原因:是当前的登陆密码识别无效

背景:在装完的Hadoop及JDK之后,在执行start-all.sh的时候出现

           root @ localhost的密码:localhost:权限被拒绝,请再试一次
           可是,我记得当时设置的密码是对的,无论怎么输都不对

解决方法:在出现上述问题后,输入
       sudo passwd

       然后,会输入新的密码,设置之后,再重新格式化一下名称节点,最后执行start-all.sh,OK。


第二种原因:根用户的SSH开启了认证

su root用户,设置ssh无密码登陆

cd ~/.ssh/                     # 若没有该目录,请先执行一次ssh localhost
ssh-keygen -t rsa              # 会有提示,都按回车就可以
cat ./id_rsa.pub >> ./authorized_keys  # 加入授权
root@wang:~/.ssh# ssh localhost
Welcome to Ubuntu 18.10 (GNU/Linux 4.18.0-10-generic x86_64)

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

 * Security certifications for Ubuntu!
   We now have FIPS, STIG, CC and a CIS Benchmark.

   - http://bit.ly/Security_Certification

 * Want to make a highly secure kiosk, smart display or touchscreen?
   Here's a step-by-step tutorial for a rainy weekend, or a startup.

   - https://bit.ly/secure-kiosk


29 个可升级软件包。
0 个安全更新。

希望有帮助

  • 14
    点赞
  • 32
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值