Solaris / OpenSolarisThis forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I can just hear the thoughts as the thread is read... I'll just say I know I messed up real bad and any/all help I can get to retrieve login short of reinstalling would be awesome. The system is Solaris 10 on a SunBlade 1000 with a gig of RAM.
The problem: I modified the /etc/passwd file and changed the shell for root but included an extra / in the path for the shell. Obviously, now, when attempting to login with the root account, I'm prompted with, "Unable to login, invalid shell".
What I've tried: I got to the ok> prompt and typed boot cdrom -s and modified the /etc/passwd to the correct path for the shell but, lo and behold, I'm probably not modifying the right file considering I booted off a cdrom disk. So, the question becomes, I suppose I need to mount my hard drive from the # prompt so that I can modify the passwd file. The prroblem is, I'm not entirely sure what that should be. I know I have an ide hard drive and I did try to mount what I thought to be the path, but obviously I'm doing something wrong. The system is in another side of the building so I'll have to go back and forth to it when information is requested which is no big deal, just FYI. Any/all help would be awesome. Perhaps there's a faster way to do this than booting from cdrom, but I'm not the guru on Solaris 10.
Thanks in advance and please let me know if I need to include more information than what I've given.
It happens to the best of us. I know I've done it a few times in the past. He's what I did to fix it.
At the ok prompt do the boot cdrom -s
When the system comes up mount what you think is your root partition to /a
ie; mount /dev/dsk/c0t0d0s0 /a
Then cd /a/etc
Set your term so vi dosen't look all weird.
TERM=sun;export TERM
Then vi passwd
Fix the file, save it and you should be all set.
You can also try to switch to Single user mode without booting from cdrom.
You will be prompted for root passwd and will be signed in with the
default shell SH. From there you can change the "/etc/passwd" and
exit - which will take you to the default runlevel.
I messed up in the same manner few days back. Put an extra "s" in
the shell's name.
shizzyt - thanks! I actually just mounted the /dev/dsk/ to /mnt which seemed to work. From there, I vi'ed /mnt/etc/passwd which allowed me to change what I needed to change. Of course, as if on cue, I found the "exec" command for changing things for the root account so that one doesn't have to hold one's breath while editing such an important file.
Quote:
You can also try to switch to Single user mode without booting from cdrom.
gs_tahmeed - awesome! Didn't know that.
Quote:
Anyway, it is always a wrong idea to change root's shell.
jlliagre - I agree completely! lol... So idiotic on my part, I know... Guess it all goes back to that ole adage, "RTFM". Heh heh heh...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.