- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: .shosts File
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
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
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
01-10-2012 10:44 PM
01-10-2012 10:44 PM
Dear All,
I am using .shosts file for authentication between two Linux hosts. In order to track the usage of this file, I plan to add a comment with "#" sign after this shosts entry. So the file looks like below:
#more .shosts
serverA user1 #For testing purposes
However, after adding the comment with "#" sign, it's caused the passwordless is not working. Can anyone tell me how to add a comment in shosts file?
Thanks and Regards,
Negara
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2012 01:49 AM
01-11-2012 01:49 AM
Re: .shosts File
Hello
Why not using the following approach:
Create a local key using ssh-keygen, don't set a password and copy
your .ssh/identity.pub to .ssh/authorized_keys on the remote machine.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2012 03:21 AM
01-11-2012 03:21 AM
SolutionI looked at the sshd source code. In OpenSSH-5.9p1, the .rhosts and .shosts files are processed by the check_rhosts_file() function, which is located in source file auth-rhosts.c.
If I read the code correctly, comments are acceptable only if the comment character '#' is the first non-blank character on the line. If a comment is on the same line as a rhosts/shosts entry, the entire line will be ignored and if you have sshd in debug logging mode, you'll get a message "Found garbage in <filename>" in the debug output.
So, this should work:
# For testing purposes serverA user1 # For other purposes serverB user2
# having space and/or tab characters before the comment sign should be acceptable too
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2012 04:26 PM
01-11-2012 04:26 PM
Re: .shosts File
Hi Matti,
This is great. Thanks for your explanation. I got the idea.
Regards,
Dewa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2012 04:28 PM
01-11-2012 04:28 PM
Re: .shosts File
Thanks for your answer.
Regards,
Dewa