This is the old SliTaz forum - Please use the main forum.slitaz.org

User management in Slitaz
  • swalfswalf December 2009
    Good morning everyone ;) . I am a new Slitaz user because in the meantime I offer you my greetings to the entire community of Slitaz. Also I'm Italian so sorry for my bad English.

    I have this problem: Slitaz initially creates two users (tux and root), I would like to change the name tux with my username, but usermod there is not, how can I do?

    Thanks to all
  • vinylvinyl December 2009
    Buongiorno, swalf! This has been addressed before, e credo che ci sono due soluzioni. You can go in and manually edit passwd—barring a usermod that's the best way I've found of changing userinfo. It's probably bad, but ah, well. ;) The other thing is, you can just delete tux and start over again creating your own user! I don't know if that will make you userID 1000, though.

    Grazie, e benvenuto nel foro!
  • babaorumbabaorum December 2009
    Hi Swalf, did you try to create a brand new user and copy all your files in its home directory (cp -a) and then change those with old username:group identity to new username:group identity, with chown command ?
    I've never tried such a thing but it may be a possible solution.
  • swalfswalf December 2009
    Thanks for the replies;)

    Unfortunately, the solution proposed to amend /etc/passwd does not work. In fact if I leave the session and later with the new user name, is impossible to access to Slitaz. But does not access even with tux.
    But if I try to create a new user, even if it creates the correct home, does not allow me to log in.
  • LuXLuX January 2010
    Hello Swalf,

    I'm using Slitaz with several users in addition to 'tux', so I can swear that this is possible without being an expert. I think that I created them by editing /etc/passwd AND /etc/groups. Here is the content of these files (with changed user names).

    /etc/passwd
    root:x:0:0:Root Administrator:/root:/bin/bash
    nobody:x:99:99:Unprivileged User:/dev/null:/bin/false
    www:x:80:80:Web Server User:/var/www:/bin/false
    tux:x:1000:1000:SliTaz User,,,:/home/tux:/bin/bash
    messagebus:x:25:25:DBUS Daemon User:/dev/null:/bin/false
    haldaemon:x:26:26:HAL Daemon User:/dev/null:/bin/false
    swalf:x:1114:100:Linux User,,,:/home/swalf:/bin/bash
    vinyl:x:1002:100:Linux User,,,:/home/vinyl:/bin/bash
    baborum:x:1003:100:Linux User,,,:/home/babaorum:/bin/bash


    Note that I'm using bash as default shell and special ids (for compatibility with other systems I have with the same users). On a 'normal' system you should probably have shell ash, and have user ids and group ids like 1001:1001, 1002:1002, and so on, hence your entries should probably look like this:

    swalf:x:1001:1001:Linux User,,,:/home/swalf:/bin/ash



    /etc/groups
    root:x:0:
    lp:x:10:
    audio:x:20:tux,swalf,vinyl,baborum
    nogroup:x:99:
    www:x:80:
    tux:x:1000:
    messagebus:x:25:
    haldaemon:x:26:
    users:x:100:tux,swalf,vinyl,baborum


    Again this should be adapted to your situation. If the default group of the user 'swalf' is the group 'swalf' with group id 1001 (instead of 'users' with group id 100), I suppose that you shoud have an entry like this in /etc/groups (compare with tux):

    swalf:x:1001:



    * Swalf wrote:
    But if I try to create a new user, even if it creates the correct home, does not allow me to log in.


    It is indeed a good idea to start with creating a new user before trying to replace tux, because it is probably easier and will allow you to distinguish the problems. Keeping the user 'tux' could be safer anyway for further comparisons (you can teach slim not to suggest tux as a default user at the login window).

    When you say that you can't login, I suppose that you mean that the login via slim doesn't work. Since apparently the new user (let us sey his name is 'swalf', and his group is 'users' --although his group is probably 'swalf'--) has been created as well as his home directory, I think that maybe some configuration file is missing or does not have the appropriate rights so that the X (graphic) session does not work. You could test this by logging in as root or tux, then open a terminal and switch to your new user identity:

    $ su swalf

    Then type the password of swalf as required and see what happens.

    If an error message occurs then it might be that something went wrong when you created the user 'swalf'. You should then consider to edit /etc/passwd and /etc/groups by adapting to your situation the above examples.

    On the other hand if you can login in text mode by the above 'su' command (you can test if it is successfull by typing the command 'whoami', it should answer 'swalf' instead of 'root' or 'tux') it is very probably a problem of config file. The simplest solution then seems to me to:

    - remove as root all the content of /home/swalf (by recreating the directory itself);

    - copy into it all the config files of tux;

    - make swalf:users (or swalf:swalf) be the owner:group of these copied files.

    Of course all this should be done as root:
    $ su ** switch to user 'root'
    $ \rm -R /home/swalf ** remove swalf's home directory
    $ cp -R /home/tux /home/swalf ** copy tux's home directory
    $ chown -R swalf:users /home/swalf ** change owner and groups... see below!


    The last command should be replaced by 'chown -R swalf:swalf /home/swalf' if your user 'swalf' has default group 'swalf' instead of 'users'.

    Good Luck!

    LuX.

    PS: Note that this detailed suggestion is nothing but a mix of the previous solutions of vinyl and babaorum.


Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

SliTaz Social