Koozali.org: home of the SME Server

Root password problem

Offline steve288

  • *
  • 336
  • +0/-0
Root password problem
« 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.

Offline pfloor

  • *****
  • 889
  • +1/-0
In life, you must either "Push, Pull or Get out of the way!"

Offline steve288

  • *
  • 336
  • +0/-0
Re: Root password problem
« Reply #2 on: April 26, 2008, 03:24:29 AM »
Thanks I will give it a try.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Root password problem
« Reply #3 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!

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Root password problem
« Reply #4 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?

Offline steve288

  • *
  • 336
  • +0/-0
Re: Root password problem
« Reply #5 on: April 28, 2008, 03:49:00 PM »
It was the /etc/passwd file

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Root password problem
« Reply #6 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?

Offline steve288

  • *
  • 336
  • +0/-0
Re: Root password problem
« Reply #7 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

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Root password problem
« Reply #8 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.
« Last Edit: April 28, 2008, 06:42:24 PM by cactus »
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline steve288

  • *
  • 336
  • +0/-0
Re: Root password problem
« Reply #9 on: April 28, 2008, 07:06:20 PM »
Great thanks