Re: Adding users - two quick questions
On Mon, Jul 19, 1999 at 02:01:48PM +0100, Patrick Kirk wrote: > Hi all, > > When I add users, they get this when they login: > > enterprise login: newuser > Password: > No directory, logging in with HOME=/ > No mail. That is very strange. What command did you use to add the user? Check out your /etc/passwd to see what home dir they are in. My entry looks like: shao:x:1000:1000:Shao Zhang,,,:/home/shao/./:/bin/bash > > Why is no home directory available for them and how do I get the system to > create default directories by appending the username to /home? > > I need to be able to print off a log of when they were logged on and what > commands were used. Printing .bash_history will do half of this but I'd > like to be able to link commands and dates. How do I do this? > > Thanks in advance! > > Patrick Kirk > > Real Trekkies work out at the 'He's Dead Gym' > > > -- > Unsubscribe? mail -s unsubscribe [EMAIL PROTECTED] < /dev/null > > -- Shao Zhang - Running Debian 2.1 ___ _ _ Department of Communications/ __| |_ __ _ ___ |_ / |_ __ _ _ _ __ _ University of New South Wales \__ \ ' \/ _` / _ \ / /| ' \/ _` | ' \/ _` | Sydney, Australia |___/_||_\__,_\___/ /___|_||_\__,_|_||_\__, | Email: [EMAIL PROTECTED] |___/ _
Re: Adding users - two quick questions
*- On 19 Jul, Patrick Kirk wrote about "Re: Adding users - two quick questions" > Thanks. I didn't even know there was a command adduser! Why is it better > than useradd? > adduser is just a perl script that was written by Debian developers. It ends up calling adduser as well as taking care of and handling many other 'normal' defaults. The fact that it is it's own package says a little about it's worthiness compared to the useradd util that is in the passwd package. However, I agree, it doesn't make it more obvious to the less experienced user since it is part of the base system. # grep useradd /usr/sbin/adduser &systemcall('useradd', '-d', $home_dir, '-g', $ingroup_name, '-s', &systemcall('useradd', '-d', $home_dir, '-g', $ingroup_name, '-s', -- Brian - Mechanical Engineering [EMAIL PROTECTED] Purdue University http://www.ecn.purdue.edu/~servis -
Re: Adding users - two quick questions
Thanks! Patrick
Re: Adding users - two quick questions
On Mon, Jul 19, 1999 at 03:06:59PM +0100, Patrick Kirk wrote: > > > > > > About the 'no home' ting: it means that the system couldn't cd to the > user's > > homedir after assuming the identity of the user. Usually this means > > that /home isn't mounted, or wasn't mounted when you added the user, but > > you may have other reasons. Just make sure that the entry in /etc/passwd > > for the user accurately reflects their homedir, then 'chown -R user ~user' > > and 'chmod -R u+rwX ~user'. > Question is why useradd john -d /home/john doesn't work You should use -m option. useradd john -d /home/john -m. From useradd man page: -m The user's home directory will be created if it does not exist. The files contained in skeleton_dir will be copied to the home directory if the -k option is used, otherwise the files contained in /etc/skel will be used instead. Any directories contained in skeleton_dir or /etc/skel will be cre ated in the user's home directory as well. The -k option is only valid in conjunction with the -m option. The default is to not create the directory and to not copy any files. -- o--o ___ |Leszek Gerwatowski|_/_|_\ o--o (o\__/o)=) "Don't fix it if it isn't broken"
Re: Adding users - two quick questions
Quoting Patrick Kirk ([EMAIL PROTECTED]): > > > > > > About the 'no home' ting: it means that the system couldn't cd to the > user's > > homedir after assuming the identity of the user. Usually this means > > that /home isn't mounted, or wasn't mounted when you added the user, but > > you may have other reasons. Just make sure that the entry in /etc/passwd > > for the user accurately reflects their homedir, then 'chown -R user ~user' > > and 'chmod -R u+rwX ~user'. > Question is why useradd john -d /home/john doesn't work Maybe you need -m as well. (In answer to your email, that's partly why I use adduser: less switches to remember, better defaults.) > > I am not sure that listing the users' commands is legal (but I'm not a > > lawyer so don't ask me) or desirable. It's called 'process accounting' in > I would hope that logging what contractors are doing on my machine is legal > or else I could be charged for work that was never done and/or liable for > abuse of the system. Perhaps you could mention this in /etc/issue or whatever (like stating that you're recording a telephone call). Cheers, -- Email: [EMAIL PROTECTED] Tel: +44 1908 653 739 Fax: +44 1908 655 151 Snail: David Wright, Earth Science Dept., Milton Keynes, England, MK7 6AA Disclaimer: These addresses are only for reaching me, and do not signify official stationery. Views expressed here are either my own or plagiarised.
Re: Adding users - two quick questions
Thanks. I didn't even know there was a command adduser! Why is it better than useradd? Patrick
Re: Adding users - two quick questions
Hm. usually the home directory is set up and created in the adduser sequence. You usually get something like: home directory: (/home/$logname) what you can do by hand is check your "/etc/passwd" file and make sure the home directory field (ie the field before the shell path) points to an existing directory. For the command logging I'm not sure... There must be some utilities outthere that are meant for that. I "think" but don't take my words as cash on that, that "script" (see man script) might be a way to solve the problem. (remember that "bash_history" can always be deleted or change by the user unless you do some regular backups of it.) _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
Re: Adding users - two quick questions
> > > About the 'no home' ting: it means that the system couldn't cd to the user's > homedir after assuming the identity of the user. Usually this means > that /home isn't mounted, or wasn't mounted when you added the user, but > you may have other reasons. Just make sure that the entry in /etc/passwd > for the user accurately reflects their homedir, then 'chown -R user ~user' > and 'chmod -R u+rwX ~user'. Question is why useradd john -d /home/john doesn't work > > I am not sure that listing the users' commands is legal (but I'm not a > lawyer so don't ask me) or desirable. It's called 'process accounting' in I would hope that logging what contractors are doing on my machine is legal or else I could be charged for work that was never done and/or liable for abuse of the system. Thanks. Patrick
Re: Adding users - two quick questions
Quoting Patrick Kirk ([EMAIL PROTECTED]): > Hi all, > > When I add users, they get this when they login: > > enterprise login: newuser > Password: > No directory, logging in with HOME=/ > No mail. > > Why is no home directory available for them and how do I get the system to > create default directories by appending the username to /home? Perhaps you used useradd without enough switches. I prefer adduser. Create then as root and copy the contents of /etc/skel to them. > I need to be able to print off a log of when they were logged on and what > commands were used. Printing .bash_history will do half of this but I'd > like to be able to link commands and dates. How do I do this? Install admin/acct, I guess. I've had trouble in the past with /var/account/pacct growing out of control, so I don't use it. .bash_history is useless because you can prevent commands appearing if there's an initial space by setting HISTCONTROL (man bash). Cheers, -- Email: [EMAIL PROTECTED] Tel: +44 1908 653 739 Fax: +44 1908 655 151 Snail: David Wright, Earth Science Dept., Milton Keynes, England, MK7 6AA Disclaimer: These addresses are only for reaching me, and do not signify official stationery. Views expressed here are either my own or plagiarised.
Re: Adding users - two quick questions
About the 'no home' ting: it means that the system couldn't cd to the user's homedir after assuming the identity of the user. Usually this means that /home isn't mounted, or wasn't mounted when you added the user, but you may have other reasons. Just make sure that the entry in /etc/passwd for the user accurately reflects their homedir, then 'chown -R user ~user' and 'chmod -R u+rwX ~user'. To get a log of when the users logged on, there are many utilities. 'last' provides a short listing; the 'sac' program can analyze the logins in several ways and is probably more than you will need. I am not sure that listing the users' commands is legal (but I'm not a lawyer so don't ask me) or desirable. It's called 'process accounting' in Unix-land, so try searching for that term and see if you can find anything. Note that .bash_history was NOT meant for this purpose, so any non-trivial use of it will have problems. Carl
Adding users - two quick questions
Hi all, When I add users, they get this when they login: enterprise login: newuser Password: No directory, logging in with HOME=/ No mail. Why is no home directory available for them and how do I get the system to create default directories by appending the username to /home? I need to be able to print off a log of when they were logged on and what commands were used. Printing .bash_history will do half of this but I'd like to be able to link commands and dates. How do I do this? Thanks in advance! Patrick Kirk Real Trekkies work out at the 'He's Dead Gym'