1

I did the following:

useradd -d /home/iauser -m -s /bin/bash -c "IA User" iauser

got this error:

UX: useradd: ERROR: Create home directory failed. Operation not applicable

It created an entry in passwd:

iauser:x:101:10:User:/home/iauser:/bin/bash 

In Solaris you cannot use /home because it is used by the automounter.

Question:

Can I do this:

userdel iauser 

without removing the /home directory?

  • If you do delete a user and keep that user's home directory, have you thought about what happens when you create a new user that gets the some UID as the user you deleted? The new user will be listed as the owner of the old, deleted user's home directory and will have access to all the files in that directory. – Andrew Henle Dec 18 '17 at 11:11
4

If you don't provide the -r option to userdel, it should not remove the home directory:

SYNOPSIS
     userdel [-r] login
...    
OPTIONS
     The following options are supported:

     -r       Remove the user's home directory from  the  system.
              This  directory  must  exist.  The files and direc-
              tories under the home directory will no  longer  be
              accessible  following  successful  execution of the
              command.

Notice that the -r option is in square brackets, indicating that it is an optional flag.

Oracle man pages section 1M: System Administration Commands: userdel

0

Looks like the answer might be in your question (or edited in?)

Since /home is usually an automount, you can't create a dir in it.

  • It looks like it is in the question because you have answered the context and not the question itself. The question is the part that comes after the word "Question:". – JdeBP Dec 16 '17 at 9:09

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.