Single user mode

Hi all
I am new on sun OS. I have have little experience on linux.
The Story start from this point:
I want to put some script on start-up the terminal, but I cant do that. my shell was sh and I tried so much to find way to do that. at last someone said to me change your shell to bash. I ask how I can change and he said go to passwd file and change sh to bash. I do that and after that I can't log in. it give me the error unknown user shell...
I go to the single user mode from the fail-safe, but I can't find passwd file. the file that I found is different. and I don't know what can I do?
I use x86 sun Solaris 10.
thanks for reading and your help

The passwd file you are seeing is the one on the DVD that you booted from.

Boot into single user

 
boot cdrom -s

then mount your harddisk root filesystem under /a using the normal device string of your harddisk root filesystem (eg, /dev/dsk/sda0 or whatever it is)

 
mount /dev/dsk/sda0 /a

Now your harddisk root filesystem is accessible by

 
cd /a

Under /a you will have the whole filesystem.

When you're done, remember to shutdown in an orderly manner, eg.

 
init 0

Hope that helps.

1 Like

Assuming you are on Solaris 10 - do not change the root shell from sh to bash in /etc/passwd. Some scripts will fail if you do so.

2 Likes

Yes, good thinking. Don't mess with the root shell.

Change the shell for non-root users only.

Thanks fpmurphy

1 Like

Thanks for your reply.
Yes it worked.
But I was in single user mode.
I didn't use the code:

boot cdrom -s

when I boot in fail-safe it search for installation of OS and mount it.
but the problem is that when I explore the directories I didn't see the directory that my hard disk mounted.
This time I only log in to single user mode and without caring to other thing execute this command:

 
cd /a 

After that I was on my hard disk!
Thank you very much for your helps. Now I should trying to put my script on start-up the terminal.