- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Checking for $LOGNAME on another server
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
Forums
Discussions
Discussions
Discussions
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
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
06-03-2003 07:27 AM
06-03-2003 07:27 AM
Checking for $LOGNAME on another server
Is there an easy way to identify if a given $LOGNAME or $(whoami)or $(logname), whatever exists on another server?
I am developing a distributed application in Java and for testing purposes, I need this functionality. The production version is always as ops. However, for testing, I want that anyone installing the test app should have an account on every box/server where the app is running.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 07:32 AM
06-03-2003 07:32 AM
Re: Checking for $LOGNAME on another server
Assuming remote shell is allowed/setup:
# remsh thehost grep username /etc/passwd
...or:
# remsh thehost finger username
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 07:33 AM
06-03-2003 07:33 AM
Re: Checking for $LOGNAME on another server
finger command would do it (see man finger). But fingerd must be enabled on the remote system which is not very secured ...
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 07:34 AM
06-03-2003 07:34 AM
Re: Checking for $LOGNAME on another server
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 07:45 AM
06-03-2003 07:45 AM
Re: Checking for $LOGNAME on another server
Now I am doing this:
exists=$(remsh omni pwget -n $LOGNAME)
test -n "$exists" || echo $LOGNAME is not in omni
I feel that doing the string checking is a bit awkword, nevertheless it does the job.
Here's a thought but I am not sure if this is possible, is there a way with mail/mailx/sendmail and some options where you can simply tickel the othere side and ask for if a user exists. This way the above can be done like this:
mail -option $LOGNAME@omni || echo $LOGNAME is not in omni
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 07:59 AM
06-03-2003 07:59 AM
Re: Checking for $LOGNAME on another server
If you're going to be using pwget -n I'd suggest that you check using the error code rather than testing for a string being returned. return code is 0 for found, 1 for not found, 2 for an error as per the man page.
Otherwise a different way of approaching this is to consider something like NIS to keep account authentication across different boxes.
regards,
Darren.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 09:14 AM
06-03-2003 09:14 AM
Re: Checking for $LOGNAME on another server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2003 10:55 PM
06-03-2003 10:55 PM
Re: Checking for $LOGNAME on another server
I think that Darren meant something like :
[ -z $(remsh omni "pwget -n $LOGNAME >&- || echo 1" ) ] || echo $LOGNAME is not in omni
Regards