How to add a user with a home directory and profile?
- I've unslung, installed tools, and am almost ready to try compiling
"Hello, World" level proggies.
In aid of this, I need to create a "normal" non-root user and give it
a home directory and profile. No sweat on a non-embedded system, BUT
the Linksys add-user tool on the Web admin system creates a user with
no default directory; when I try to log in via Telnet with this user,
it fails. Also, there's no way to set the user's default shell (no
surprise, as Linksys didn't anticipate users actually logging into the
slug via Telnet).
Can someone tell me how to do this properly? With the passwd file
echoed and mirrored and overwritten five ways from Sunday by the boot
code, I'd like to get it right the first time (and add the
instructions to the HowTo page so the question needn't be asked
I am also attempting to write a shell script to set the environment
variables to use the native toolchain, and while I can get the "export
PATH=$PATH:/opt/bin" type stuff to work from a command line, the SAME
commands don't do anything when executed as a shell script. I've tried
1) writing the shell script on a Mandrake box with KEdit and copying
it to the slug, and 2) creating the shell script line-by-line viw
Telnet by appending the output of "echo" to a disk file. File LOOKS
fine, should have the right kind of line terminations, gives no errors
when run, but has no effect. Suggestions?
- My /etc/passwd is a symlink to /share/hdd/conf/passwd.
I create new users via the web interface. After that I change the /etc/passwd
with the jove editor such that new users have a home directory in /share/hdd/data
and get /opt/bin/bash as shell. Make sure /opt/bin/bash is listed in /etc/shells.
If you didn't install the bash ipkg package then you can use /opt/bin/sh from
the new busybox package (and when lacking that you can use /bin/sh).
Here is a line for a user in /etc/passwd:
You must manually create /share/hdd/data/rab and give it the correct permissions
and ownership: chown rab.rab /share/hdd/data/rab and
chmod 700 /share/hdd/data/rab.