Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-25-2007, 01:43 PM   #1
Registered: Jan 2007
Posts: 30

Rep: Reputation: 15
change user and list of users accounted on system

This is a basic newbie question. I want to do two things.

I want to check what users and groups have been created for the system, as opposed to checking what users are currently logged on. I'm actually looking for a particular user, if it exists on the machine; so, that's where that question comes from.

I also want to know, once I find the user I'm seeking out, how do I log on as another user for a particular program. I'm running nagios, and it says it's running, but I can't interface with it. My guess is I started it with a user that has no business accessing it, if that makes any sense at all. I can use a command called chown, right, but I'm not sure how to use it to make it work for this particular situation.

thank you very much.
Old 01-25-2007, 02:04 PM   #2
Registered: Jan 2007
Location: Ukraine
Posts: 47

Rep: Reputation: 15
Hi, try this to check who is logged in:

$ who -a
$ w
$ man who
$ man w

to check if user with specified username exists on the system:
$ id skiff
uid=545(skiff) gid=545(skiff) groups=545(skiff)
$ id fakeskiff
id: fakeskiff: No such user

$ man id

More reliable is to check against /etc/passwd, /etc/group:
$ cat /etc/passwd | grep skiff


$ grep skiff /etc/passwd

$ cat /etc/passwd | grep fakeskiff

$ grep skiff /etc/group
To execute command as another user use sudo:

$ sudo -H -u skiff ls -la
$ man sudo

but mind, you need to have /etc/sudoers properly configured...
Old 01-25-2007, 02:28 PM   #3
Registered: Jan 2007
Posts: 30

Original Poster
Rep: Reputation: 15
Thank you so much! I don't even see sudoers; so, I guess that means it has to be configured to work.

Anyway, this stuff is great. I pointed to the correct IP for nagios and it worked. It was a social engineering mistake on my part. I presuppose root has the permissions to run anything it wants! And I'm also presupposing root cannot execute some magic command to see the users' passwords, except by doing some sort of password recovery.

The only thing I still don't quite get is the change owner or group for file permissions. How would one change ownership for an entire program, for instance?

thank you in advance.

Last edited by Mangenius; 01-25-2007 at 02:59 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
list users and user information MrSako Linux - Newbie 7 11-03-2006 10:24 PM
Newbie: How do I list the users on my system Merlyn Red Hat 2 10-02-2006 10:11 AM
how to list system users ygloo Linux - General 13 09-13-2006 07:22 AM
Debian AMD64 Users ... Change Your sources.list File NOW! rickh Debian 3 05-26-2006 08:30 PM
AMD64 Users need to change their sources.list file to exactly what? rickh Debian 2 04-11-2006 11:28 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:48 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration