For a Solaris 11 Server Config Review that I am doing, I have following lines in my /etc/passwd file:

lp:x:71:8:Line Printer Admin:/:
uucp:x:5:5:uucp Admin:/usr/lib/uucp:
nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico

Last word of each line means the shell where they log in to. If nothing is mentioned, is it /usr/bin/bash by default? From above, can I affirm if the accounts daemon, bin, sys, adm, lp, uucp can log in or not?

Please note that I have received this as an output to one of the scripts that my team had run, and hence, I may not be able to look for any info that you ask which is outside the script. But your help is really appreciated.



I believe the answers you've got so far are slightly inaccurate or at least incomplete.

You specifically mention that the question is related to Solaris 11 and this is important to the answer.

If no shell is explicitly mentioned in /etc/passwd then it is correct as the man page says that /usr/bin/sh will be used but this is a logical link to Korn 93 Shell. In other words: For those accounts where no shell is mentioned in /etc/passwd the shell is Korn 93, not Bourne Shell as you might think. Solaris used to have an affinity for the Korn shell (long time ago) so this is the reason why /usr/bin/sh points to the Korn Shell.

Here's an Oracle link with more info: New shell in Oracle Solaris 11.

Extra info: So does this mean that Korn shell is the "default shell" on Solaris 11 ? No! When you create an account on Solaris 11 using the useradd command and you do not explicitly specify a shell then Bash shell (/usr/bin/bash) will be used. Hence I would say that Bash is the default shell on Solaris.

Hope this helps.

  • Amongst other things, the question isn't really about the 'default' shell it's about the shell you get when one isn't specified. The real test here is whether /usr/bin/sh will run a script that contain ksh syntax that is invalid in sh. If it will then it's ksh if it won't then for all practical purpose it's sh – Iain Feb 16 '14 at 16:27
  • Edited my answer: added a link which you may find useful and made it more clear what part is the answer to your question and what part is just "bonus info" (which you can disregard) – unixhacker2010 Feb 16 '14 at 22:09
  • @Iain. Sorry. Mistook you for the OP. – unixhacker2010 Feb 16 '14 at 22:19
  • Thanks @unixhacker2010. That's a nicer explanation and gives me what I want. – Nirav Zaveri Feb 17 '14 at 15:19
# man -s 4 passwd    
     login-shell    is the user's initial shell program. If  this
                    field   is   empty,   the  default  shell  is

# man -s 4 shadow
     password    An encrypted password for the user generated  by
                 crypt(3C),  a  lock  string to indicate that the
                 login is not accessible,  or  no  string,  which
                 shows that there is no password for the login.

                 The lock string is defined as *LK* in the  first
                 four characters of the password field.

No, from the above you can't tell if the accounts listed are able to log in or not. To do that you will have to inspect the entry for each account in the /etc/shadow file. In particular you should look at the password field and potentially the expire field.

Regarding the default shell, this would be easy for you to test. Just create a user account and check you can log in. Edit the /etc/passwd file to remove the shell for the test account, then log in again and see what shell it is.

So I spun up a Solaris 11 Vm and it turns out to be sh.

  • Thanks for the first part of the answer. As for the second part - isn't there any default value that's decided for a no mention in the shell? I don't have access to the servers, all I have is an XML output containing the above info. What other things can I do? – Nirav Zaveri Feb 13 '14 at 13:23
  • @NiravZaveri: You should read the documentation or get someone who does have access to the server to carry out the test for you or spin up a Solaris 11 VM and run the test on it - it's really not that hard to help yourself here. – Iain Feb 13 '14 at 13:23
  • Thanks @lain. That helped. Unfortunately, I won't be able to upvote any answers, as I don't have "15"/"enough" rep to do upvoting! – Nirav Zaveri Feb 17 '14 at 15:18
  • Came here to upvote your answer, now that I have enough rep. :) – Nirav Zaveri Jun 3 '15 at 7:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.