第一种原因:是当前的登陆密码识别无效
背景:在装完的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 个安全更新。
希望有帮助