How to edit the /etc/passwd file not using root?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to edit the /etc/passwd file not using root?
# 1  
Old 04-09-2008
How to edit the /etc/passwd file not using root?

Hi All,

Today I faced a problem trying to log in as root. The output error is
cannot execute sh: No such file....

I doubted there is something wrong with shell interpreter which resides in /etc/passwd file for every user who logs in.
I checked and the line for root account was self-corrupted like below:
root:x:0:0:root:/root:sh

THe line for the user I`m using looks fine

elton:x:1000:1000:Elton,,,:/home/elton:/bin/bash

Can anyone tell me how to modify the line of root to add the proper path of shell?

Thanks
# 2  
Old 04-09-2008
boot the system with cdrom and mount the local disk read/write. after that you can edit the file as needed... lets say:

vi /yourmount/etc/passwd

hth,
DN2
# 3  
Old 04-09-2008
Quote:
Originally Posted by DukeNuke2
boot the system with cdrom and mount the local disk read/write. after that you can edit the file as needed... lets say:

vi /yourmount/etc/passwd

hth,
DN2

Does the fact that debian is under virtual machine affect this resolution to boot from CD?
# 4  
Old 04-09-2008
Quote:
Originally Posted by elthox
Does the fact that debian is under virtual machine affect this resolution to boot from CD?
yes it does...
# 5  
Old 04-09-2008
Quote:
Originally Posted by DukeNuke2
yes it does...
now with a little bit more time... Smilie

i don't know what kind of virtualization you use. is it possible to edit files in the "virtual" root-filesystem? if yes, you can maybe edit the file (/etc/passwd) directly from your server who hosts the vm.
if that is not possible, got to the vm console an boot it with a iso file of debian (or any other distribution) an mount the / filesystem as allready mentioned above (my first post).

hth,
DN2
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to edit /etc/passwd file to change the comment

Hi All, I need to change the comment field in /etc/passwd file for one userid in my RHEL linux m/cs. I tried to open the file in vi editor and changed the comment, but next day it's getting reverted back again. :-( mitchell:x:1000:900:Jon Mitchell User:/home/mitchell:/bin/bash I need to... (2 Replies)
Discussion started by: NARESH1302
2 Replies

2. AIX

root passwd expiration on AIX

Hi Guys, some one could help me on this that will be great . I have AIX 5.1 . when ever u login as root .it says u r passwd is expiredchoose new passwd . I tried couple of times changeing the passwd .still it behaves every time u login it asks to change the passwd . i teied to lokk into... (3 Replies)
Discussion started by: aixguy
3 Replies

3. UNIX for Dummies Questions & Answers

is it really not possible for me to edit the etc/group & the etc/passwd files?

From what I have read it possible to create a new group by editing the etc/group and etc/passwd in UNIX two files but a non-experienced user may face many problems such as destroying the file by mistake ot that his changes to these file does not make any difference. However, there is this... (2 Replies)
Discussion started by: whatev3r
2 Replies

4. Red Hat

forgot root passwd

hi i have a RHEL 4 and have forgot root passwd tried to boot in by singel user and then changing the passwd but it's not letting me do that ......throwing some weird error as .......manipulation i also tried to make a new user from CLI but even though it's not letting me in from that user as... (12 Replies)
Discussion started by: techbravo
12 Replies

5. UNIX for Dummies Questions & Answers

hw to reterive root passwd

heyy i forgot my root passwd but i cant reinstall due to some reason can anyone tell me hw to reterive root passwd (10 Replies)
Discussion started by: mightypp.nits
10 Replies

6. Solaris

How to set new Root Passwd

I forget the Root Passwd of my Sun Netra 20 server and break the same by editing /etc/shadow.Now there is no passwd for Root. And How to set new root passwd?Pls help.... (2 Replies)
Discussion started by: gini
2 Replies

7. Solaris

Recover root passwd

Any body pls let me know the procedure to recover ROOT password in Sun Netra 20 Server..I forgot the password. (5 Replies)
Discussion started by: gini
5 Replies

8. UNIX for Dummies Questions & Answers

Need to change root passwd

I booted up Sun V240 server with boot cdrom -s using the Sun Operating System CD. I now am at the # prompt and su - root . The system will not allow me to set password for root. Get following error: # passwd New Password: xxxxxxxx Re-enter new Password: xxxxxxxx passwd: Unexpected failure. ... (4 Replies)
Discussion started by: mayewil
4 Replies

9. UNIX for Dummies Questions & Answers

Dont have the root passwd for Solaris 8

Hello chiefs :) I have a SUN Enterprise 250, running Solaris 8.5 - I have managed to be able to connect a dumb terminal to the box via a standard straight-through rj45 cable, to my ibm laptop. OK so Putty can connect to the box via ssh - nice! But I dont have the password for root - or any... (1 Reply)
Discussion started by: congo
1 Replies

10. UNIX for Advanced & Expert Users

Preventing passwd root?

I knew it would happen sooner or later.... We have a requirement that specific individuals need "sudo root" authority. I knew it only a matter of time before someone decided to change the root password (at least they owned up to it). Now the question is how can I grant all rights except... (4 Replies)
Discussion started by: scottsl
4 Replies
Login or Register to Ask a Question