- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Show logins on Red Hat Linux
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2005 08:04 PM
тАО09-07-2005 08:04 PM
Show logins on Red Hat Linux
On HP/UX we have the command "logins" which shows the user logins on the system. Does anybody know a similar command for Red Har Linux.
Thanks...
- Tags:
- logins
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2005 10:09 PM
тАО09-07-2005 10:09 PM
Re: Show logins on Red Hat Linux
we run several Linux boxes with RHEL3.
To my knowing a logins command or act-alike doesn't come with the standard distros.
I guess you could obtain sources from logins
(maybe GNU or similar) and try to build it on RH.
However the functionality logins offers can easily be scripted by parsing /etc/passwd
(shell, awk, perl, python, or C getpw* syscalls).
Mostly a mere shell alias will suffice.
So I think it isn't really necessary to have a logins implementation for Linux.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2005 10:22 PM
тАО09-07-2005 10:22 PM
Re: Show logins on Red Hat Linux
// logins.c
#include
#include
#include
main()
{
struct passwd *pwd;
pwd=getpwent();
while (pwd != NULL )
{
printf ("%-15s %-6d %-15s %-6d %s\n",pwd->pw_name,pwd->pw_uid,pwd->pw_name,pwd->pw_gid,pwd->pw_gecos);
pwd=getpwent();
}
endpwent();
}
# make logins
# ./logins
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-08-2005 12:01 AM
тАО09-08-2005 12:01 AM
Re: Show logins on Red Hat Linux
telnet ip_address
telnet host_name
Which one is slow, if second then it may be the way host name resolution is configured. If first, you need to explore more to know the problem of it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-08-2005 01:02 AM
тАО09-08-2005 01:02 AM
Re: Show logins on Red Hat Linux
awk -F ":" '{ print $1 }'
If you do not use local authentication:
getent passwd |awk -F ":" '{ print $1 }'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-08-2005 03:41 AM
тАО09-08-2005 03:41 AM
Re: Show logins on Red Hat Linux
This example will list the UIDs in use and will present the information so you can see if duplicate UIDs are in use.
- Tags:
- awk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-08-2005 05:57 AM
тАО09-08-2005 05:57 AM
Re: Show logins on Red Hat Linux
awk script will have to be used.
or.
last | sort -u | more
That will provide you a list of accounts that were actually used.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2005 06:55 AM
тАО09-09-2005 06:55 AM
Re: Show logins on Red Hat Linux
lastlog
Or for currently logged in users:
who
If you want to see a password file style list of all users that can log into a system run:
getent passwd
--Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2005 09:58 PM
тАО09-09-2005 09:58 PM
Re: Show logins on Red Hat Linux
Here it is :
# sort -t: -k 3n,3 passwd | awk -F ":" '{printf ("%-20s %7s %7s %s\n", $1,$3,$4,$5)}'
Enjoy , Have fun,
Cheers ,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-13-2005 03:09 AM
тАО09-13-2005 03:09 AM
Re: Show logins on Red Hat Linux
who -u
OR
finger