Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
Hi , I created a new user /etc/passwd joe :1005:0::/home/joe:/bin/bash also added him to the group root vi /etc/group root :0:root,joe when i do su joe gives me ERROR: NO ...
  1. #1
    Just Joined!
    Join Date
    Jun 2008
    Posts
    58

    Question adduser problem

    Hi ,

    I created a new user

    /etc/passwd

    joe:1005:0::/home/joe:/bin/bash
    also added him to the group root

    vi /etc/group
    root:0:root,joe

    when i do

    su joe

    gives me
    ERROR: NO LOGNAME
    Strange, any ideas??

  2. #2
    Just Joined!
    Join Date
    Apr 2010
    Posts
    5
    try to avtivate the user with passwd beforehand.

  3. #3
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    No, it's not requires for a user account to have a password.

    I'm confused why you aren't using the useradd or adduser command to create the user?

    Also, you shouldn't edit /etc/passwd or /etc/group with a plain text editor, but use vipw and vigr instead.

    But here's help on manually creating a user.
    Creating a user

    Also, why are you giving your user the root group id and adding them to the root group?

  4. #4
    Just Joined!
    Join Date
    Jun 2008
    Posts
    58
    I'm confused why you aren't using the useradd or adduser command to create the user?
    I did try adduser first.....

    Also, why are you giving your user the root group id and adding them to the root group?
    I was planning to give this username to my technician to carry out some maintenance work. it needs root privileges to carry out some of these tasks, at the same time I'm wary of giving him the root password.

    Also, you shouldn't edit /etc/passwd or /etc/group with a plain text editor, but use vipw and vigr instead.
    i should have mentioned this earlier. this is a busybox kernel, no vipw applet

  5. #5
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    I did try adduser first.....
    And what happened? You can find the busybox man page here, including its adduser command instructions.

    I was planning to give this username to my technician to carry out some maintenance work. it needs root privileges to carry out some of these tasks, at the same time I'm wary of giving him the root password.
    Better to use sudo to set him up with specific privileges.

  6. #6
    Just Joined!
    Join Date
    Jun 2008
    Posts
    58
    -busybox adduser creates the user, but its like 'useless' as in I'm not able to login using that user, or su to that user. I see the user in /etc/passwd and do stuff like change password etc....but it doesnt help....


    -already went through the manual,
    sudo doesn't work on busybox....

    -this is a custom build on busybox, maybe thats what preventing me from getting what i required from adduser.

    Any other suggestions?

  7. #7
    Just Joined!
    Join Date
    Jul 2008
    Posts
    81
    You might as well give Joe the root password since if you put him in group 0 he can do everything that root can do. Including changing the root password so you don't know it any more.

  8. #8
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    623
    Putting user in root group does not give it root privileges in any distro I'm familiar with, but I'm no busybox expert. It would mostly just give some additional file perms, some of which might be useable to compromise root. In Fedora, Ubuntu, et al, it definitely does not permit running passwd with a username (e.g. root) specified. It also thus probably would not accomplish what you're trying to do.

    I do create additional uid 0 users for temporary root privileges quite frequently on RedHat boxes, for circumstances like yours. I normally create with adduser then edit /etc/passwd and change uid to 0 (and chown -R root:root the home directory).

    What happens when you add with adduser and then try to log in or su? The same error as with your hand-rolled entry?

    The thing that looks odd about the entry you posted
    joe:1005:0::/home/joe:/bin/bash
    is that there's no password field, unless that grimace face is supposed to represent a colon. It should look like
    joe::1005:0::/home/joe:/bin/bash
    or
    joe:1005:0::/home/joe:/bin/bash
    or some such. The uid is not the second field, it's the third. So you'd be off by one on all fields after the username.

    Is the colon actually there, and the grimace face just an artifact of posting?

    EDIT: I can see that in my reply the colon-x that I put in after Joe in the second "should look like" line shows up as a grimace face when displayed. So, I guess your entry is probably correct, fieldwise.
    Last edited by Mudgen; 04-23-2010 at 01:06 AM. Reason: AHA moment

  9. #9
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    623
    What happens if you "passwd -u joe" as root? Also, does /etc/shadow exist? Is joe in there?

  10. #10
    oz
    oz is online now
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,097
    Quote Originally Posted by greyhairweenie View Post
    Is the colon actually there, and the grimace face just an artifact of posting?

    EDIT: I can see that in my reply the colon-x that I put in after Joe in the second "should look like" line shows up as a grimace face when displayed. So, I guess your entry is probably correct, fieldwise.
    If you'll look underneath the text box where your inputted text goes when making a post, there is an option to "Disable smilies in text". Checking that will stop the auto smiley thing from happening.
    oz

    new members/users: read this first | new member faq
    no private messages requesting computer support - post them on the forums!
    please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...