LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 01-25-2007, 01:43 PM   #1
Mangenius
Member
 
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
fooks
Member
 
Registered: Jan 2007
Location: Ukraine
Posts: 47

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

Code:
$ who -a
$ w
$ man who
$ man w


to check if user with specified username exists on the system:
Code:
$ 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:
Code:
$ cat /etc/passwd | grep skiff
skiff:x:545:545::/home/skiff:/bin/bash

or 

$ grep skiff /etc/passwd
skiff:x:545:545::/home/skiff:/bin/bash

$ cat /etc/passwd | grep fakeskiff

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

Code:
$ 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
Mangenius
Member
 
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.
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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