1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Random Linux+ Question #58

Discussion in 'Linux+' started by tripwire45, Aug 9, 2005.

  1. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    179
    287
    You type the following to create a user named "testuser":

    Code:
    useradd testuser
    When you used the command, you automatically created certain files for this user. Of the options below, choose two. Answer later.

    1. /home/testuser
    2. /etc/passwd
    3. /etc/password
    4. /etc/shadow
    5. /etc/group
    6. /etc/groups
    7. /bin/bash
     
    Certifications: A+ and Network+
  2. guyver9114

    guyver9114 Bit Poster

    45
    0
    17
    Should be 1 & 2 :)
     
    Certifications: MCSA: Messaging, MCT
    WIP: Nothing for a few months :)
  3. ffreeloader

    ffreeloader Terabyte Poster

    3,661
    106
    167
    Hmmmm.... I must be missing something. When useradd is run on my system the -D switch must be added for useradd to create the default home directory and add the user to the default system files. Without the switch no /home directory is added and the user is not added to any group, nor are /etc/passwd or /etc/group edited. The user exists, but all files and passwords must be modified manually. Read man useradd to verify this.

    The command adduser will, with no switches, add the user, create the /home directory, ask for the password, full user name, other miscellaneous user data, copy the files from /etc/skel, and edit /etc/passwd, /etc/shadow, and /etc/group.

    I think you were thinking of the wrong command, trip.
     
    Certifications: MCSE, MCDBA, CCNA, A+
    WIP: LPIC 1
  4. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    179
    287
    I'll answer this one early. Correct answer should be 2 and 4. I just tested it again on my trusty Debian box. When you use the command "useradd username" without switches, entries for that user are automatically created in /etc/passwd and /etc/shadow. yes I know...the user has no password and they have no home directory, but the entries exist in those two files. When I use the "userdel username" command, the entries are automatically deleted. You do have to add additional information to create the home directory, password and so forth.
     
    Certifications: A+ and Network+
  5. ffreeloader

    ffreeloader Terabyte Poster

    3,661
    106
    167
    OK. What confused me then was the way you worded the question. The question read "you automatically created certain files". Those files aren't created by useradd, they're existing system configuration files that are edited by useradd.
     
    Certifications: MCSE, MCDBA, CCNA, A+
    WIP: LPIC 1
  6. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    179
    287
    My bad, Freddy. :oops: Writing these questions isn't as easy as it looks. I'm learning a lot from you, my friend. :)
     
    Certifications: A+ and Network+
  7. ffreeloader

    ffreeloader Terabyte Poster

    3,661
    106
    167
    No biggy. How well I know how hard it is to write a good question. I wrote questions for MCSE World for a while, a very little while, and even that little bit of experience that taught me just how hard writing good questions is. :biggrin
     
    Certifications: MCSE, MCDBA, CCNA, A+
    WIP: LPIC 1
  8. guyver9114

    guyver9114 Bit Poster

    45
    0
    17
    Tested it on one of my CentOS 4.1 boxes and without any switches it creates the user folder in /home/.

    Must be different on some distro's
     
    Certifications: MCSA: Messaging, MCT
    WIP: Nothing for a few months :)
  9. ffreeloader

    ffreeloader Terabyte Poster

    3,661
    106
    167
    What does adduser do on your CentOS box?
     
    Certifications: MCSE, MCDBA, CCNA, A+
    WIP: LPIC 1

Share This Page

Loading...