OPNsense Forum

Archive => 16.7 Legacy Series => Topic started by: cake on September 03, 2016, 12:03:01 pm

Title: [SOLVED] authorized_keys keeps getting deleted somehow
Post by: cake on September 03, 2016, 12:03:01 pm
I took a quick search all I found was this https://forum.opnsense.org/index.php?topic=1930.msg5996#msg5996 which doesnt help me.

Anyways, I created a new user on OpnSense, and authorized SSH logins for the user (not admin). I then copied a key over to  ~/.ssh/authorized_keys of the new user. I check that it is added. I checked I can log in (ssh) without the password to the new user on OpnSense.

I tested it out scp to transfer a file automatically as working with out password. Well later on one of my machines can't automatically scp into OpnSense, and I find the key I added earlier to the user account with ssh privileges is missing twice now. (empty file)

I may have rebooted the OpnSense box twice in between testing and sorting stuff out.
Am I missing something or is this operator error and I need to sniff around the logs?
Title: Re: authorized_keys keeps getting deleted somehow
Post by: franco on September 03, 2016, 12:19:30 pm
Authorized keys are set in the GUI for each user (edit), then automatically carried over to the file. Since it's empty for your user, it probably wipes the file?
Title: Re: authorized_keys keeps getting deleted somehow
Post by: cake on September 03, 2016, 01:04:51 pm
ok Franco I'll give it a try.

Your very helpful around here. Thanks!

Edit: It worked!
Title: Re: [SOLVED] authorized_keys keeps getting deleted somehow
Post by: franco on September 03, 2016, 01:40:50 pm
Yay, sure thing. :)
Title: Re: [SOLVED] authorized_keys keeps getting deleted somehow
Post by: reep on September 03, 2016, 08:32:36 pm
I think you can generally add keys to /rooot/.ssh/authorized_keys2

This would not be overwritten by any templating

B. Rgds
Johm