Koozali.org: home of the SME Server

Contribs.org Forums => General Discussion => Topic started by: steve288 on April 25, 2008, 10:30:54 PM

Title: Root password problem
Post by: steve288 on April 25, 2008, 10:30:54 PM
I make some manual changes to the root password line in /etc. I was trying to add additional paths.

Obviously I had the fields wrong and have screwded up the root line in the password file. Now cant log in as root via putty. I have searched the contribs and see various notes about using control X at boot to log in as single but I dont get boot: and the instructions do not seem to line up with the 7.3 version. I also read that I could just change the admin password from the server-panel and that will change the password for the root as well. It appears they are the same password. (I didnt know that)anyway I tryed to change it but while the password did change for the admin the root still is not accessible. I suppose I need to get into a terminal mode and clean up the password file I messed up.

Any suggestions.
Title: Re: Root password problem
Post by: pfloor on April 25, 2008, 10:45:11 PM
http://wiki.contribs.org/SME_Server:Documentation:FAQ#Reset_the_root_and_admin_password
Title: Re: Root password problem
Post by: steve288 on April 26, 2008, 03:24:29 AM
Thanks I will give it a try.
Title: Re: Root password problem
Post by: CharlieBrady on April 26, 2008, 07:27:53 PM
http://wiki.contribs.org/SME_Server:Documentation:FAQ#Reset_the_root_and_admin_password

That won't necessarily work if the format of the passwd or shadow file has been broken.

If all else fails, Steve should be able to boot from the CD in rescue mode. And hopefully he has learnt his lesson and will never, ever directly edit the passwd file again!
Title: Re: Root password problem
Post by: CharlieBrady on April 26, 2008, 07:28:44 PM
I make some manual changes to the root password line in /etc. I was trying to add additional paths.

Paths aren't set in the passwd file. Which file in /etc did you edit?
Title: Re: Root password problem
Post by: steve288 on April 28, 2008, 03:49:00 PM
It was the /etc/passwd file
Title: Re: Root password problem
Post by: CharlieBrady on April 28, 2008, 03:53:11 PM
It was the /etc/passwd file

And how did you add "additional paths" there?

You won't try that again, right?
Title: Re: Root password problem
Post by: steve288 on April 28, 2008, 05:14:15 PM
Yes your right.

I had thought that you could add it to one of the fields, I have forgotten alot of linux/unix stuff since I dont deal with it much now.

I logged in as single user. Went to /etc/passwd deleted the string I added reset password and it worked. The line I changed was the last field which actually after pulling out my Unix book is the shell that the login uses. As I think about paths Im beginning to recall now that the path is set in the home dir of the user in the .bash_profile . Im setting up a new computer and want to put some short form commands into my own root/bin . So I want to put that dir in the path.

Regards
Title: Re: Root password problem
Post by: cactus on April 28, 2008, 06:40:15 PM
Im setting up a new computer and want to put some short form commands into my own root/bin . So I want to put that dir in the path.
Just create a

~/.bashrc

file and put the aliases and commands in there and if you would lik to have them system wide edit the /etc/bashrc file (as this is one of the few files that is not templated on SME Server).

If you really like you could add nexecutables and binary in ~/bin as it should be added to the path automatically.
Title: Re: Root password problem
Post by: steve288 on April 28, 2008, 07:06:20 PM
Great thanks