Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to figure out a way to pull the user information from local users on a Linux server. I have approximately 40 servers running SUSE and Ubuntu that are using Microsoft Active Directory in order to authenticate. Our internal auditing group has made us disable root ssh ability, I was doing this with clusterssh, but I can login as me then su on the server to conduct root, admin, work. This is an ongoing request to get the local users and it is a painfully slow process since I have to login to each server to get the /etc/passwd file. Is there another way to get the local user information? They are now asking about seeing the last logon date or if the account is disabled, any thoughts there as well?
Most of our auditors think Windows and I am trying to make my life easier but not sure what options I have. I need to get local accounts and if they are active or disabled plus last logon date. I'm sure there will be more but if I can get the basics adding more shouldn't be too difficult but I guess I'll cross that bride when I get there. Oh yeah, any way to just pick out the local users and not the service daemons would also be helpful.
I am trying to figure out a way to pull the user information from local users on a Linux server. I have approximately 40 servers running SUSE and Ubuntu that are using Microsoft Active Directory in order to authenticate. Our internal auditing group has made us disable root ssh ability, I was doing this with clusterssh, but I can login as me then su on the server to conduct root, admin, work. This is an ongoing request to get the local users and it is a painfully slow process since I have to login to each server to get the /etc/passwd file. Is there another way to get the local user information? They are now asking about seeing the last logon date or if the account is disabled, any thoughts there as well?
Most of our auditors think Windows and I am trying to make my life easier but not sure what options I have. I need to get local accounts and if they are active or disabled plus last logon date. I'm sure there will be more but if I can get the basics adding more shouldn't be too difficult but I guess I'll cross that bride when I get there. Oh yeah, any way to just pick out the local users and not the service daemons would also be helpful.
Any and all feedback welcomed. I am at a loss!
/etc/passwd is word-readable, so you can use scp originated on your central box "as you" to get it from other Linux boxes. Am I missed something ?
I understand the /etc/passwd file is readable but I am looking for an automated way, script or something, that would allow me to pull this file down to my local machine. I am trying to prevent having to login to each and every machine in order to get this file or the lastlog file, I really would like to get the output of lastlog since it has the last time the user logged in.
I understand the /etc/passwd file is readable but I am looking for an automated way, script or something, that would allow me to pull this file down to my local machine. I am trying to prevent having to login to each and every machine in order to get this file or the lastlog file, I really would like to get the output of lastlog since it has the last time the user logged in.
Nothing is wrong with scp but would I be able to have scp read a text file that contains a list of all my servers and pull down the /etc/passwd file to my local machine? I just don't want to login to each individual server in order to get this file or the lastlog file. I think this is going to be a reoccurring task so I am trying to simplify my life with a simple process to get this information. Would scp work, if so, do you have any recommendations on how I can accomplish what I am trying to do?
Nothing is wrong with scp but would I be able to have scp read a text file that contains a list of all my servers and pull down the /etc/passwd file to my local machine? I just don't want to login to each individual server in order to get this file or the lastlog file. I think this is going to be a reoccurring task so I am trying to simplify my life with a simple process to get this information. Would scp work, if so, do you have any recommendations on how I can accomplish what I am trying to do?
You can do something like that
Code:
#!/bin/sh
while read SERVER; do
scp $SERVER:/etc/passwd passwd.$SERVER
done < SERVER_LIST
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.