I have a situation. We have Solaris 8 machines. For every users we have to change the shell from /bin/sh to .../sdshell. So far we have been doing it by editing the /etc/passwd file manually. Is there a better way to do so? Because I am trying to write a script to do these task. what i have tried:
useradd -s ... its not working, it says the shell is not valid. I have added the shell to /etc/shells file as well. But we can modify the password file and it works fine.
Or is there any way to change the default shell. I came across a file /usr/sdam/defadduser. but i am not sure
Please help.
Thanks
useradd
must have some reason to say the shell is not valid; you could always run useradd throughstrace
to see which files it looks at before erroring out. Something likestrace -f useradd -s ... | tee useradd.strace
should get you started, but check the man page first.