VizeL Posted September 16, 2015 Share Posted September 16, 2015 Is there any guide to getting SSH working? I don't believe my daemon is running, and when I tried manually running it (/etc/rc.d/rc.sshd) it tells me key_load_public: invalid format Could not load host key: /etc/ssh/ssh_host_rsa_key key_load_public: invalid format Could not load host key: /etc/ssh/ssh_host_dsa_key key_load_public: invalid format Could not load host key: /etc/ssh/ssh_host_ecdsa_key key_load_public: invalid format Could not load host key: /etc/ssh/ssh_host_ed25519_key Disabling protocol version 2. Could not load host key sshd: no hostkeys available -- exiting. I tried moving the generated keys from /boot/config/ssh to /etc/ssh but that didnt work either. Quote Link to comment
ken-ji Posted September 17, 2015 Share Posted September 17, 2015 Your current host keys might be corrupt. delete them with rm /etc/ssh/ssh_host_*key* /boot/config/ssh/ssh_host_*key* then start sshd with /etc/rc.d/rc.sshd start Quote Link to comment
VizeL Posted September 17, 2015 Author Share Posted September 17, 2015 Thanks! that worked in starting it up. ah...as a side note, do you know if theres a default username/password? When attempting to login I'm getting Access denied! (using root) Quote Link to comment
ken-ji Posted September 17, 2015 Share Posted September 17, 2015 The web login is the same as the shell login. so the default is no password needed when a password is set in the web GUI, this password will be needed to login over telnet or SSH or the console as well. Quote Link to comment
VizeL Posted September 17, 2015 Author Share Posted September 17, 2015 hmm, thanks. for some reason the same password as my web GUI isn't working. Do you happen to know if theres anyway to reset it? (either that, or I cant recall my password at all ) telnet works, but SSH keeps giving me access denied Quote Link to comment
CommandLionInterface Posted September 6, 2017 Share Posted September 6, 2017 Okay, so I ran into a similar issue, found this post when googling, and normally I don't like to resurrect dead posts but I figured I'd round out the answer for future users who may find it helpful. On 9/16/2015 at 5:53 PM, ken-ji said: Your current host keys might be corrupt. delete them with rm /etc/ssh/ssh_host_*key* /boot/config/ssh/ssh_host_*key* then start sshd with /etc/rc.d/rc.sshd start This works. When you start sshd it will generate keys appropriately. The problem is that it's storing them in /etc/ssh/, which isn't preserved across reboots. The solution is to move the newly generated keys to the flash drive, where unraid will copy them into their proper location as part of its booting process. cp /etc/ssh/ssh_host_*key* /boot/config/ssh/ I tested by rebooting and sshing after I did this copy command and it does indeed work, but I didn't test before copying the keys so if unraid auto copies the keys on shutdown or anything like that and my advice is redundant I apologize, but I know for a fact this works. Quote Link to comment
ken-ji Posted September 6, 2017 Share Posted September 6, 2017 Quote sshd_start() { # make sure ssh dir exists on flash mkdir -p /boot/config/ssh # restore saved keys, config file, etc. cp /boot/config/ssh/* /etc/ssh &>/dev/null chmod 600 /etc/ssh/* &>/dev/null # Create host keys if needed. ssh-keygen -A # copy any new/generated key back to flash drive cp /etc/ssh/ssh_host*_key* /boot/config/ssh/ /usr/sbin/sshd } Its redundant... the snippet above is from the /etc/rc.d/rc.sshd script Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.