Dropbearkey fail after new firmware

I was able to use dropbearkey for automate reboot my linux box from vera secure. After installing last firmware (VeraPlus 1.7.4955) I cannot use dropbearkey, actually I can not create dropbear key. Is there anybody else have that issue? I always get the same return

root@MiOS:~# dropbearkey -t rsa -f ~/.ssh/id_rsa
Generating 2048 bit rsa key, this may take a while...
Couldn't create new file /root/.ssh/id_rsa.tmp10188: No such file or directory
Exited: Failed to generate key.

Confirm that the directory /root/.ssh exists. If it doesn’t, you can create it with mkdir .ssh and you will need to set the perms to drwx------

Did the new firmware delete my old settings? If yes, can you help me for creating /root/.ssh and set permissions ? I do not want to do it by myself without an expert guidance :slight_smile:

He’s just told you :slight_smile:

But!
ssh into your Vera
ls -a

Can you see .ssh in that listing?

If not:
mdir .sssh
chmod 700 .ssh

Try
dropbearkey -t rsa -f ~/.ssh/id_rsa
again

But! Why do you think you need to generate a new key? Curious unless you’re trying to connect to a new device as immediately after the upgrade.

Or did you never have a key?

C

I already have a key and have working ssh connection before new firmware install. After new firmware I see that my vera does not send os.execute(" ssh -y -i ~/.ssh/id_rsa xubu@192.168.1.7 sudo /sbin/poweroff" ) and decide to see if dropbearkey exist.

root@MiOS:~# dropbearkey -y -f ~/.ssh/id_rsa
Failed reading ‘/root/.ssh/id_rsa’

What do you think about it?

Right gotcha

ls -a /root/

See what that says

C

root@MiOS:~# ls -a
. … .ash_history 1

root@MiOS:~# ls -a /root/
. … .ash_history 1

Yep, looks like your settings have been overwritten :frowning:

Oh just do
pwd

As well?

C

root@MiOS:~# pwd
/root

Yeah, so lost your key :frowning:

You’re gonna have to start again. You probably need to
mkdir /root/.ssh
chmod 700 /root/.ssh

Before you generate a new key, though :frowning:
C

I’ve not updated to the new release firmware yet. But it sounds like this issue is gonna break my integration with my Asus Merlin router to control my VPN connection on / off via Vera.

Thanks to you again my linux HERO, you solve again one of my issue. But need to know something for my improvement.
Before os.execute(" ssh -y -i ~/.ssh/id_rsa xubu@192.168.4.61 sudo /sbin/poweroff" ) script shut down computer but now it does not works but
os.execute(" ssh -y -i ~/root/.ssh/id_rsa xubu@192.168.4.61 sudo /sbin/poweroff" ) works. Why?

1 Like

You created the .ssh folder in the root user home directory… if you moved it to the xubu home directory, then your “silent ssh” session should work. However, you may need to recreate keys with the xubu user.

~/.ssh is not ~/root/.ssh

But is you are logged in as root (the default for Vera)

~/.ssh = /root/.ssh

~ basically is short hand for ‘My user’s home directory’ for user root ~ is /root

If it was me I would probably specify /root/.ssh not ~/.ssh to avoid just this kind of scenario where you’re not quite sure where your folders are. It’s also why I asked you to run pwd (print working directory) to check which folder you were in :wink:

Hope that’s of some help

C

Thank you very much, yes that’s really help me :smile:

1 Like

I also thank to you, those kind of issues improve my linux knowledge :smile:

Hi… I flashed the 19.07.0 image. Still no SSH. Then I restored my backup config that I took immediately after upgrading and configuring 19.07.0. This step has restored SSH connectivity. My wife is currently trying to get some work done so I have to postpone my next upgrade attempts for a while.