FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 02-03-2011, 11:01 AM
John Doe
 
Default User Details

From: James Bensley <jwbensley@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



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-03-2011, 11:06 AM
Always Learning
 
Default User Details

On Thu, 2011-02-03 at 04:01 -0800, John Doe wrote:

> From: James Bensley <jwbensley@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...

BUT, as someone helpfully mentioned on this list, ONLY if it has been
indexed by a routine which automatically runs at night.

find / -iwholename *xxxxxx*

also works. xxxxxx being the sought file name. Don't forget the first *
and add the second * if necessary.

> Third: http://www.google.fr/search?q=unix+tutorial

Google your question, en Anglais, and you will usually get answers.

Bon chance !


With best regards,

Paul.
England,
EU.


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-03-2011, 11:45 AM
Nico Kadel-Garcia
 
Default User Details

On Thu, Feb 3, 2011 at 6:12 AM, James Bensley <jwbensley@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 users

getent passwd

> -How to list all groups

getent 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.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-03-2011, 03:21 PM
Kai Schaetzl
 
Default User Details

Always Learning wrote on Thu, 03 Feb 2011 12:06:53 +0000:

> BUT, as someone helpfully mentioned on this list, ONLY if it has been
> indexed by a routine which automatically runs at night.

if you install mlocate that is the case! If you do not install mlocate you
cannot locate, anyway. So, this is a non-issue.

Kai


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-15-2011, 02:37 PM
James Bensley
 
Default User Details

On 3 February 2011 12:45, Nico Kadel-Garcia <nkadel@gmail.com> wrote:
> 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".

Thanks Nico, I was aware of this but I couldn't find the useradd
command at the time

> 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.

I see, I didn't know this, this is why I was being thrown because when
using sudo I wasn't temporarily inheriting root's $PATH. This makes
sense.

>> -How to set/change an existing users home folder path
>
> /usr/sbin/useradd -d [new directory]
>
>> -How to list all users
>
> getent passwd
>
>> -How to list all groups
>
> getent 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.
>

This is all very user, thanks very much

Despite being told here the answer, I found it myself when logged in
as root, 'which' showed me the full path, like 'locate' so logging
back in as my normal user I was able to 'sudo /usr/sbin/useradd ....'.

Many thanks all!

--
James.

http://www.jamesbensley.co.cc/
There are 10 kinds of people in the world; Those who understand
Vigesimal, and J others...?
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 07:33 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org