[PLUG] useradd issue

King Beowulf kingbeowulf at gmail.com
Sat Jun 13 22:50:57 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/13/2015 03:04 PM, Rich Shepard wrote:
> For some reason I've not been able to discern, when I add me as a
> user to the netbook it looks OK until I log in. Then I get the
> message that 'no directory, logging in with HOME=/'.
> 
> The useradd command I use is: useradd -m -d /home/rshepard -u 1000
> -g 100 -s /bin/bash rshepard
> 
> The /home/ directory contains ftp/, lost+found, and rshepard. The
> first two are owned by root.root, the last by rshepard.users.
> /etc/passwd has the line
> 'rshepard:x:1000:100::/home/rshepard:/bin/bash' and group 100 is 
> 'users'. As root, the password for rshepard is created and works to
> log in.
> 
> There's nothing I see in the useradd man page or my Web searches
> that explains why this time I cannot log in to /home/rshepard/ on
> the netbook. Prior to my negligent error of wiping out /etc/ the
> same command worked as it's supposed to work and when I log in as a
> user it's in /home/rshepard/.
> 
> I've no idea where to look for a solution since everything appears
> correct but it's just not working.
> 
> Your thoughts are needed.
> 
> Rich

That is odd.  Your "passwd" entry appears wrong. it should read
something like

rshepard:x:1000:100:,,,:/home/rshepard:/bin/bash

Some of the the default options (/etc/default/useradd) appears screwy
and/or then didn't get overridden with your options.  Does the file
/etc/default/useradd exist:

# useradd defaults file
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
CREATE_MAIL_SPOOL=yes

Its been awhile since I used "useradd", Slackware has the better
script "adduser" front-end invoked via

# adduser rshepard

Then just follow the prompts to set up the account, groups and
password in one fell swoop.  You cna look inside that script to see if
you forgot to invoke an option.

Have fun ;-)
- -Ed

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlV8s88ACgkQXvwMaW61dLeg/QCfR6PbmEK2/HXL00IfTIpBXyyf
3uUAoJbWOqnB03KNnOjVybgAOFydnOMa
=KtxB
-----END PGP SIGNATURE-----



More information about the PLUG mailing list