Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
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.
to install the daemon. It compiled just fine and it is now installed. My problem is that when I try to run it, it doesn't accept my host keys running chmod 644. Whatever I try to set it to, it says it is unprotected and then ignores it, or it does not find the file at all when I set the chmod to for instance 400 or 700. What on earth am I supposed to do? I have generated the host keys with the following commands
Sshd's own host keys /etc/ssh/ssh_host_* are chmod 0600, their public counterparts (/etc/ssh/ssh_host_*.pub) are 0644. Please post the actual and full errors.
root@mendocino locazor # sshd -h /etc/ssh/ssh_host_rsa_key.pub
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0640 for '/etc/ssh/ssh_host_rsa_key.pub' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /etc/ssh/ssh_host_rsa_key.pub
Could not load host key: /etc/ssh/ssh_host_rsa_key.pub
Disabling protocol version 1. Could not load host key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.
root@mendocino locazor #
root@mendocino locazor # sshd -h /etc/ssh/ssh_host_rsa_key.pub
Try running "/etc/init.d/sshd start".
If it fails try "/etc/init.d/sshd status" and post the errors.
BTW, if you *must* a host key, then use /etc/ssh/ssh_host_dsa_key, not the dot pub one.
root@mendocino locazor # /etc/init.d/sshd start
* Starting sshd...
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0640 for '/etc/ssh/ssh_host_key' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /etc/ssh/ssh_host_key
Could not load host key: /etc/ssh/ssh_host_key
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0640 for '/etc/ssh/ssh_host_rsa_key' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_rsa_key
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0640 for '/etc/ssh/ssh_host_dsa_key' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /etc/ssh/ssh_host_dsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Disabling protocol version 1. Could not load host key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting. [ !! ]
If chmodding doesnt work, please post the init script in BB "code" tags (to preserve the format) and the output of "ls -al /etc/ssh". Bit awkward, this.
chmod didn't help either, but I deleted all my host keys and ran the /etc/init.d/sshd start script, then it generated the keys for itself and it worked. Thanks for your help
chmod didn't help either, but I deleted all my host keys and ran the /etc/init.d/sshd start script, then it generated the keys for itself and it worked. Thanks for your help
thanks for posting that. it resolved an issue I have had (fighting intermittently) for three days.
I guess using the script to start it allows for a little more interaction that just firin it up.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.