How to bring back/restore root account?


 
Thread Tools Search this Thread
Operating Systems Solaris How to bring back/restore root account?
# 1  
Old 11-25-2009
How to bring back/restore root account?

Hi all,
I have a problem, when I use script with 'expect', accidentally I was deleted root account by "userdel root". Unfortunately, it works, because no other root user login on it. Solaris document said that root cannot delete root, but in my case it works because it deleted by script, not physically log in.
My question is: how to restore my root account? I can log in using other account, but not root and no other account have privilege as root.
Any help would be appreciated. Thank you

Regards,
Joash
# 2  
Old 11-25-2009
boot from cd/dvd and create the root account again. haven't done something like that but i would try to copy the information for /etc/passwd and /etc/shadow from another machine.
# 3  
Old 11-25-2009
Thanks DukeNuke2 for your help, I will try it.
But, could you please share to me, how the steps and to create again? only using 'useradd' ? or other command? or just add root line at /etc/passwd and /etc/shadow ?
Thank you
# 4  
Old 11-25-2009
Got an idea Smilie

Ok boot into solaris into solaris failsafe login , this will boot mini root
then mount FS on /a
then execute sys-unconfig

answer on few questions and you will be promoted to enter password for root , follow instructions , reboot PC and your root account maybe will be backed Smilie
# 5  
Old 11-26-2009
This may also help:

How to recover/reset root password in Sun solaris

It says its just for recovering the root password, but I think when I did the same thing (messed up the root user) this fixed it..
# 6  
Old 11-26-2009
Thank you guys..
It works now.. i did the same thing like restore root password and it works Smilie

- insert CD (I think it can be ignored)
- send <break> on putty
- at '{3} ok' prompt I type boot cdrom -s, but i also can do 'boot -s'
- then restore manually by edit '/etc/passwd', '/etc/shadow', and '/etc/group'
- done

Thank you
# 7  
Old 11-27-2009
Dear Joash, Kindly take note, before you post a question, please do a search within the forum on your query. There are plenty of such examples for you to refer from.
Thanks. This is part of the forum rules Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Red Hat

Bring tape paths back up in Redhat 5.4

Hi Folks, Looking for some assistance here on a Dell server connected to a Dell tape robot with Redhat 5.4 and Netbackup 6.5. Netbackup thinks the tapes are all present and working, but they are not - we lost the internal encryption keys earlier but think that they are reinstated as the... (0 Replies)
Discussion started by: gull04
0 Replies

2. Shell Programming and Scripting

Bring back a file changed with sed

Hello everbody I changed one of my important files with a false sed statement by mistake now I lost my file and I hope I could bring it back what I did was: sed '/^..//' a > myfile myfile should have been another file like b ot something I know I also forgot to place an 's' to the... (5 Replies)
Discussion started by: miriammiriam
5 Replies

3. Solaris

DNS service is in maintenance mode. How to bring it back to online mode?

:confused: when i tried to look the status of DNS-client, it is in maintenance mode..... Please tell me how to bring it back to online mode...PLEASE TELL ME STEP BY STEP.... PLEASE... :wall: (2 Replies)
Discussion started by: vamshigvk475
2 Replies

4. Linux

Bring back a deleted partition

I deleted my partition on a test server and want to bring back the partition. I have not rebooted yet, so system is operational. I have the /proc/partition major minor #blocks name 8 0 195359960 sda 8 1 1044224 sda1 8 ... (2 Replies)
Discussion started by: photon
2 Replies

5. AIX

Can't login root account due to can't find root shell

Hi, yesterday, I changed root's shell in /etc/passwd, cause a mistake then I can not log in root account (can't find correct shell). I attempted to log in single-mode, however, it prompted for single-mode's password then I type root's password but still can not log in. I'm using AIX 5L version 5.2... (2 Replies)
Discussion started by: neikel
2 Replies

6. UNIX for Dummies Questions & Answers

Bring back removed files

Dear People I have removed some of my files and directories( by using rm and rmdir commands) by mistake. I wish to bring them back. How is it possible?( I am using solaris 2.6) best regards Reza Nazarian:( (2 Replies)
Discussion started by: Reza Nazarian
2 Replies
Login or Register to Ask a Question