I installed ssh in my Ubuntu 14.04. I followed a tutorial for generating ssh keys. I used following commands to set the keys.
ssh-keygen -t rsa -P ""
cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
when I type ssh localhost as a normal user it will not ask for any passwords and it works fine but when do it as a root it is asking for root@localhost password and my root password is not working.
Here is what I have tried so far by visiting some stackoverflow.com questions regarding this error.
Everyone suggested to create a password by "sudo su" then "passwd". I tried it. I created a password and it's not working. I tried it several times.
I tried "ssh-add" as root but it says Could not open a connection to your authentication agent
I tried generating the keys as root by doing ssh-keygen -t rsa -P ""
then cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
. After doing this when I start ssh localhost
it is asking for root@localhost password and it is not accepting my root password.
I tried changing PermitRootLogin to yes and withoutpassword. both did not work.
I added a new property to the sshd_config saying AllowUsers root
. It also did not work.
Thanks in advance. I would really appreciate some help.
If u have not given password for root and you are trying to fire command on spark or haddop like ./sbin/stop-all.sh
or ./sbin/start-all.sh
. If you don't have a root password, you can setup one using
sudo passwd
and fire commands.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.