Root password does not work
I have a CentOS7, and I am setting up LAMP. I was able to install php and mysql, and I was trying to set the password for the mysql:
/usr/bin/mysql_secure_installation Enter password for user root: Error: Access denied for user 'root@localhost' (using password: YES) I checked if I can login as root through SSH, and I got Access denied. I am still logged in as root at the initial window, and I was able to change password with passwd root I entered new password twice, and I got: passwd: all authentication tokens updated successfully. I was trying to log in through SSH with the new password, and I was not able to. I got: Access denied again. I am logged it as root now, and I can do whatever I want on the system. Why does it not work? What can I do in order to get it to work? Thanks. |
please show us the output of this command from this file:
Code:
[schneidz@hyper ~]$ sudo grep ^PermitRootLogin /etc/ssh/sshd_config also, i am pretty sure that mysql has its own security database therefore the root (or any users) password is not necessarily the same as the systems password: https://dev.mysql.com/doc/refman/5.0...rmissions.html |
Didn't you just turn off root SSH access a couple of hours ago???
http://www.linuxquestions.org/questi...rt-4175557377/ |
Check /var/log/secure to see what it says about your login attempt.
It depends on what your setup is. For example /etc/securetty might prevent logins as root if it has been restricted. There could be PAM authentication modules you're using that restrict it or require other information. Looking at the log should give you some idea of what failed. |
Code:
unix_chkpwd[xxxx]: password check failed for user (root) |
Quote:
Going off your previous post, you set PermitRootLogin to no (the default, since it is commented in the sshd_config.) So go ahead and add PermitRootLogin yes to your /etc/ssh/sshd_config. Remember to reload sshd afterwards (systemctl reload sshd). Remember, this is BAD SECURITY PRACTICE. The recommendation is to just make a user account with ssh and sudo rights. |
Quote:
BTW - the default for RHEL/CentOS is for PermitRootLogin to be set to yes, it has to be explicitly shut off by the user. |
I changed all the values to the default ones, so this line is set to:
Code:
#PermitRootLogin yes I addded Code:
AllowUsers UsernameThatIcreatedHere I noticed the following lines, look like default settings: Code:
PasswordAuthentication yes |
Quote:
You really need to stop mucking about with your sshd config, your PasswordAuthentication lines are NOT the default and could really screw things up. The PasswordAuthentication section should look like the following: Code:
# To disable tunneled clear text passwords, change to no here! Code:
# Set this to 'yes' to enable PAM authentication, account processing, It is still unclear whether your original mysql error is even referring to regular user accounts or special mysql accounts, as schneidz mentioned earlier. |
Quote:
|
Quote:
#PermitRootLogin yes and PermitRootLogin yes Neither of these work. Access denied, when I try to open another ssh connection through user "root". It would be good to fix this, as I would like to turn off the pc... Edit: @Demosa "Remember, this is BAD SECURITY PRACTICE. The recommendation is to just make a user account with ssh and sudo rights." This part I know very good. I read it in like 80 of the books that I read (Linux, I would say the best that are out there now). The best for Apache seems to be "Pro Apache, 3rd" by the way. There is a new one coming out from O'Reilly I think, and all the other ones that are out there are old (I still read them though). # # # In general, working on Linux does not seem to very hard, as people may be suggesting, I think. It is all described on the Internet, in multiple places, and everything can be found through google.com (or other search engines). Like I said, I went over like 15 books (it took me 3 months) and this background knowledge is very good. Using it is the best learning now, but again, it does not seem to be that hard (some people were saying, it takes 2-3 years to learn it, but this was probably with things like awk, perl, advanced scripting, I dont remember all these names now, but along these lines). I personally need it only for web server / email / ftp. |
Quote:
|
Quote:
Edit: I did not notice your last post, I will go over it now. And yes, I did not make a backup. I read about it in some place before... |
I had this part wrong:
Code:
# To disable tunneled clear text passwords, change to no here! Thanks again for the answers, I know it was all very basic, at this point. |
Quote:
A VPS is not the place to be experimenting with these kinds of things. You were one internet hiccup away from locking yourself out of your VPS permanently. Set up a VM on your local system and experiment there. Use snapshots so when you screw something up irrecoverably (and you will, multiple times) you can just restore from it and use those lessons to hopefully not screw up the VPS. |
All times are GMT -5. The time now is 05:49 AM. |