Adduser

From WL-HDD Wiki

Jump to: navigation, search
WL-HDD Contents
What is the WL-HDD
Features
Pro's/con's
Reviews
Hacking
Inserting the HDD
Hacking Guides
Basic setup guides
Packages guides
Requests
Troubleshooting
This Wiki
Credits
Editing help
Contact Me

Contents

Prerequisites

To complete this guide, the following is assumed:

You are running Oleg's firmware (1.9.2.7-6b or later)
You have harddisk partitions up and running with an extended filesystem mounted to /opt
You have installed the Ipkg package system.
You have configured your partitions to automount.


Installing the Package

First lets update the feed list:

ipkg update

Now lets install the package, the -force-overwrite line is there to prevent conflicts if you have previously installed coreutils

ipkg -force-overwrite install adduser

Adding Users

The format of the adduser command is quite simple:

adduser <username> -h /path/to/home/directory -G <existinggroupname>

If you do not wish to add the user to an existing group then remove the -G <existinggroupname> off the end of the command.

Adding the user 'bob' to group 'share'

If you wish to add the user 'bob' to group 'share', here is what you would do

adduser bob -h /opt/home/bob -G share

To make changes permanent:

flashfs save
flashfs commit
flashfs enable
reboot

Verifying Functionality

Lets view the file /etc/group

nano /etc/group

You should see the following

root:x:0:admin
nobody:x:99:
share::1000:

Note down the GID (group ID) for the user 'share' (1000 in this case)

Now lets look at /etc/passwd

nano /etc/passwd

You should see entries for users admin, nobody and bob. Here is the line for the user bob.

bob:$1$$I2o9Z7NcvQAKp7wyCTlia0:1002:1000:Linux User,,,:/opt/home/bob:/bin/sh

The long string of characters in the middle is the password 'hash'. Notice that bob has the GID 1000 meaning that bob is part of the group share.

Finally, check that you can enter your home directory

cd /opt/home/bob
Personal tools