Please login as the user centos rather than the user root
I have lately been experimenting with AWS (Amazon web services) and the idea of setting up your server yourself is just too overwhelming for me.It’s super-cool to create your own instances, volumes and iptables. If you haven’t tried it so far, try it. Documentation is very explicit and clear that you can manage almost all of the stuff yourself. Anyway, I created an instance with Centos 6.7.
The connection string I got looked like this:
ssh -i "cdh-sample.pem" firstname.lastname@example.org
Here’s a snapshot:
I tried to ssh into the instance and got this error message
Please login as the user “centos” rather than the user “root”
Here’s the snapshot for the error message:
How to fix Please login as the user "centos" rather than the user "root"? Here’s a problem fix:
1. Replace root with centos in the connection string.
For example: My connection string would look like this now:
ssh -i "cdh-sample.pem" email@example.com
2. Switch to root user
3. Open the file using vi editor:
sudo vi /root/.ssh/authorized_keys
4. Start editing it :
Remove all of the content before
and save the file.
5. Edit the next file using command :
sudo vi /etc/ssh/sshd_config
6. Un-comment the line by removing # before it.
7. Restart sshd service using the command :
sudo service sshd restart
systemctl restart sshd
That’s it. 🙂
Try logging in using the original ssh command with root user and it should TADA, It should work now!
I was trying to install services to a new host using cloudera and that’s when I encountered this error. I hope it solves your problem too and the instance should allow/permit the root login.
P.S: Internet is a successfully thriving community from generous contributions of people from across the globe. You can help it thrive too. Please contribute. As a reader, you can be contributing with your valuable feedback.
Please drop by a comment or Share to let people know you were here. 🙂 🙂