LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-21-2007, 09:18 PM   #1
xenoxnty
LQ Newbie
 
Registered: Aug 2007
Posts: 1

Rep: Reputation: 0
Question Screw up editing /etc/passwd


I have a problem that I need help with. However, I'll start by saying I did something very stupid (granted?). Here is was I did, and why I did it.

I'm running a apache/php server on ubuntu. I only have one user account for logging into said computer. The apache/php server runs as the user w-w-w-data. Whenever I would create a file or directory in the web server dir, I would go back and chown -R w-w-w-data:w-w-w-data /var/w-w-w. Well, I got tired of this, so I sudo vi |etc|passwd, and change my user login account (tod:1000:1000etc)) to tod:33:1000etc), 33 being the id for w-w-w-data. Well... needless to say... that was my stupid mistake... now I'm stuck trying to figure out how to undo this, as I can no longer sudo vi /etc/passwd, as my console says "www-data@servername", or if instead of ssh-ing in, I go to the actual computer, it shows 'I have no name!@servername', I suspect this is because I haven't logged out since I made this change.

Anyways, sudo doesn't take my password. I don't know the root password, because of ubuntu's default setup. Is there any way to fix this? Maybe with a live cd or something? Thanks.
 
Old 08-21-2007, 10:08 PM   #2
tajamari
Member
 
Registered: Jul 2007
Distribution: Red Hat CentOS Ubuntu FreeBSD OpenSuSe
Posts: 252

Rep: Reputation: 32
Quote:
Originally Posted by xenoxnty View Post
I have a problem that I need help with. However, I'll start by saying I did something very stupid (granted?). Here is was I did, and why I did it.

I'm running a apache/php server on ubuntu. I only have one user account for logging into said computer. The apache/php server runs as the user w-w-w-data. Whenever I would create a file or directory in the web server dir, I would go back and chown -R w-w-w-data:w-w-w-data /var/w-w-w. Well, I got tired of this, so I sudo vi |etc|passwd, and change my user login account (tod:1000:1000etc)) to tod:33:1000etc), 33 being the id for w-w-w-data. Well... needless to say... that was my stupid mistake... now I'm stuck trying to figure out how to undo this, as I can no longer sudo vi /etc/passwd, as my console says "www-data@servername", or if instead of ssh-ing in, I go to the actual computer, it shows 'I have no name!@servername', I suspect this is because I haven't logged out since I made this change.

Anyways, sudo doesn't take my password. I don't know the root password, because of ubuntu's default setup. Is there any way to fix this? Maybe with a live cd or something? Thanks.

its better to re-install it in 2 hours than figuring the error without resolution for 3 hours or more
 
Old 08-21-2007, 11:39 PM   #3
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Boot from CD, mount HD and undo the changes.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Swat uses PAM but changes linux passwd not samba passwd Peter@KKVS Linux - Networking 0 11-26-2006 04:20 AM
Messed up Fedora by editing /etc/passwd zahadumy Linux - Software 12 06-02-2005 03:40 PM
Looking for help on my screw up. Tink Linux - General 2 03-19-2004 05:55 AM
you know what screw it? unimaginative General 7 01-06-2004 02:28 PM
Did I screw up? Aktionman Slackware 7 11-18-2003 04:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration