I have some questions on how I can perform the following actions from the terminal in CentOS 5.5 final. My Google searches aren't helping and I keep seeing references to the command 'useradd' but this isn't present on my box; -How to add a new user? $ useradd -bash: useradd: command not found (This is the same for my normal user and when logged in as root) -How to set/change an existing users home folder path -How to list all users -How to list all groups Sorry if this seems trivial but I am actually stuck on this :) -- Regards, James. http://www.jamesbensley.co.cc/ There are 10 kinds of people in the world; Those who understand Vigesimal, and J others...?
On Thu, Feb 03, 2011 at 11:12:19AM +0000, James Bensley wrote:> I have some questions on how I can perform the following actions from > the terminal in CentOS 5.5 final. My Google searches aren't helping > and I keep seeing references to the command 'useradd' but this isn't > present on my box; > > -How to add a new user? > $ useradd > -bash: useradd: command not found > (This is the same for my normal user and when logged in as root)See my page http://home.roadrunner.com/~computertaijutsu/rhpath.html -- Scott Robbins PGP keyID EB3467D6 ( 1B48 077D 66F6 9DB0 FDC2 A409 FA54 EB34 67D6 ) gpg --keyserver pgp.mit.edu --recv-keys EB3467D6 Buffy: Okay, well, how long before you un-crypt it? Willow: Hours. Days maybe. Anyone suggesting months would not be accused of crazy talk.
From: James Bensley <jwbensley at gmail.com>>-How to add a new user? > $ useradd > -bash: useradd: command not found > (This is the same for my normal user and when logged in as root)First, normal user not finding useradd is normal. And it would not be able to use it for obvious security reasons... Second: use 'su -' instead of 'su'. locate 'x' finds 'x' on your filesystem... Third: http://www.google.fr/search?q=unix+tutorial JD
On Thu, Feb 3, 2011 at 6:12 AM, James Bensley <jwbensley at gmail.com> wrote:> I have some questions on how I can perform the following actions from > the terminal in CentOS 5.5 final. My Google searches aren't helping > and I keep seeing references to the command 'useradd' but this isn't > present on my box; > > -How to add a new user? > $ useradd > -bash: useradd: command not found > (This is the same for my normal user and when logged in as root)If you look up the "File System Hierarchy", you'll find out that system administration tools that normal users don't really "need" are in /sbin or /usr/sbin or /usr/local/sbin. Those directories are not in a user's default "PATH" on RedHat based operating systems. They're added to the root user's PATH by a bit of scripting in /etc/profile. Personally, I consider this silly and add a copy of this code, edited to enable it for me, to my personal $HOME/.bashrc. But the result for normal users is that command like "useradd", "chkconfig", and "service" need to be typed out with their full path, such as "/usr/sbin/useradd" or "/sbin/chkconfig". This also means that if you become root by doing a "sudo' command, it doesn't get added to your PATH. without some additional options.> -How to set/change an existing users home folder path/usr/sbin/useradd -d [new directory]> -How to list all usersgetent passwd> -How to list all groupsgetent group These getent commands will also pull NIS or certain types of LDAP data, and mix it with the contents of /etc/passwd or /etc/group, just for your information. Unsorting them can be awkward.> Sorry if this seems trivial but I am actually stuck on this :)Sounds like you could use some time with some basic UNIX or Linux manuals, or benefit from the "man useradd" command.