Operating System - HP-UX
1831496 Members
3557 Online
110025 Solutions
New Discussion

Finding user name through uid number

 
SOLVED
Go to solution
Chern Jian Leaw
Regular Advisor

Finding user name through uid number

HI,

I have the /var/src/yp/passwd file from my local NIS master server. Some of the users in my passwd file do have accounts in another remote site with a different NIS server.

I'd like to find if other users on the remote site do have the same uid as my users having the accounts locally and at the particular remote site.

Is there a utility which enables us to search for the usernames based on the uid ?

I do not know the remote NIS server name, so that's why I'm trying other alternatives.

Thanks.
8 REPLIES 8
T G Manikandan
Honored Contributor

Re: Finding user name through uid number

cat /etc/passwd|grep

or

logins|grep


Paula J Frazer-Campbell
Honored Contributor

Re: Finding user name through uid number

Hi

cat /etc/passwd | grep ":UID No:"


Paula
If you can spell SysAdmin then you is one - anon
Chern Jian Leaw
Regular Advisor

Re: Finding user name through uid number

TG,

Thanks for the response. However, as I've mentioned in my msg, I only have the passwd file from the local NIS server, in which I can do just what you have showed.

I'd need to also access the uid of the same user at a remote site, with a different NIS server.

Please advice.
Thanks.
Ruediger Noack
Valued Contributor

Re: Finding user name through uid number

List the nis passwd file with:
ypcat passwd

Ruediger
Chern Jian Leaw
Regular Advisor

Re: Finding user name through uid number

Ruediger,

Thanks for the response. But as I mentioned in the last paragraph of my msg, I do not know the remote NIS server, i.e the NIS server which is not in my domain. So, I'm afraid I can't gain access to the passwd file on that remote NIS server.

Please advice.
Thanks.
steven Burgess_2
Honored Contributor
Solution

Re: Finding user name through uid number

Hi

ypcat passwd.byname | grep

Regards

Steve
take your time and think things through
steven Burgess_2
Honored Contributor

Re: Finding user name through uid number

Chern

Unless others can respond with a better answer, i can't see how your going to get the uid's from another NIS server , if you don't know the name of that NIS master. Do you know the clients they log into ? If so they may be configured to use the local passwd file before refering to the master

If thats the case they would have the same uid on the client and the master

Use the remsh or rexec commands to cat the the passwd file on the remote client

If you can't do that send an email to administrator of that NIS server and ask him/her

What do you think ?

Steve
take your time and think things through
Chern Jian Leaw
Regular Advisor

Re: Finding user name through uid number

Steve,

I'm able to get the uid's of all the necessary users from the remote NIS server, which I do not its name by just using the command which you showed:
ypcat passwd.byname |grep uid

Thanks also to everyone for their help. Is there a way which I could reassign points to all of you?

Thanks.