LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-12-2014, 06:31 AM   #1
unclesamcrazy
Member
 
Registered: May 2013
Posts: 189

Rep: Reputation: 1
Question about editing /etc/passwd


What would happen, if I edit /etc/passwd and change root's user id and group id from 0:0 to 1001:1000 a unique user id and exist normal group id.

How would I perform root's task?
would root show $ prompt or # prompt?
Would sudo work in this condition?

Sorry I am not brave enough to try this on my system.
 
Old 05-12-2014, 06:52 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,776

Rep: Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888
do not try to do that, your system will die immediately.
 
2 members found this post helpful.
Old 05-12-2014, 11:18 AM   #3
JeremyBoden
Senior Member
 
Registered: Nov 2011
Distribution: Debian
Posts: 1,183

Rep: Reputation: 243Reputation: 243Reputation: 243
Quote:
Originally Posted by unclesamcrazy View Post
What would happen, if I edit /etc/passwd and change root's user id and group id from 0:0 to 1001:1000 a unique user id and exist normal group id.

How would I perform root's task?
Don't mess with /etc/passwd with an editor.
Assuming you are using a Ubuntu or Mint or similar distro:-
Signon as the user you created during the install (it will likely have a userid in /etc/passwd of 1000).
Code:
sudo whatever command line you want to run as root...
Then enter your password, when prompted.

BTW If you should ever find a way to sign in as root directly, don't do it.
 
Old 05-12-2014, 01:33 PM   #4
Mark I
LQ Newbie
 
Registered: Feb 2014
Posts: 4

Rep: Reputation: Disabled
If I were to try your experiment, I would find an unused computer or create a virtual machine using VirtualBox on which to install Linux.
As an extra safety precaution I would not connect them to the internet.
Doing potentially risky experimentation on an isolated system reserved for that purpose allows you to find answers without losing anything valuable.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
passwd -S question jcky Linux - Newbie 4 09-15-2010 05:20 AM
Screw up editing /etc/passwd xenoxnty Linux - General 2 08-22-2007 12:39 AM
/etc/shadow and /etc/passwd permissions question lqchangba Linux - Security 2 02-20-2007 01:46 PM
question about /etc/passwd file hongxing Linux - Software 2 11-30-2005 11:47 AM
Messed up Fedora by editing /etc/passwd zahadumy Linux - Software 12 06-02-2005 04:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:39 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration