Bug #218
closedadmin's SSH key written to wrong location
100%
Description
After adding authorized keys in the user manager and saving, these keys are not written out to the authorized_keys file.
To replicate:
edit admin, add SSH key, save.
Updated by Pierre POMES over 15 years ago
I tried to add a SSH key to the default admin user, the authorized_key files is created successfully:
- pwd
/home - ls
la admin/.ssh/authorized_keys1 root wheel 604 Dec 13 21:11 admin/.ssh/authorized_keys
-rw-r--r-
I also tried to define a new user and add a SSH key, this also works:
- ls
la ppomes/.ssh/authorized_keys1 ppomes nobody 604 Dec 13 21:18 ppomes/.ssh/authorized_keys
-rw-r--r-
Can you confirm you are talking about the ${HOME}/.ssh/authorized_keys file ?
Updated by Chris Buechler over 15 years ago
This is the first I've tried it on 2.0 (in a long while at least, maybe ever). I don't have a .ssh directory at all.
[admin@pfsense.local]/root(4):ls -l ~admin/.ssh
ls: /root/.ssh: No such file or directory
Running a snapshot from today, could be something that broke recently.
Updated by Chris Buechler over 15 years ago
Same on a different box, running a Dec. 6 snapshot.
Updated by Pierre POMES over 15 years ago
Strange ! I'am also running a snapshot from today (the first one of the day: http://snapshots.pfsense.org/FreeBSD_RELENG_8_0/i386/pfSense_HEAD/updates/pfSense-Full-Update-2.0-ALPHA-20091213-0603.tgz).
I tried again:
- pwd
/home/admin - rm -rf .ssh/
In the gui, I simply saved the user (the ssh key as already entered). And then:
- ls
la .ssh/2 root wheel 512 Dec 13 21:29 .
total 6
drwx-----
drwxr-xr-x 3 root wheel 512 Dec 13 21:29 ..rw-r--r-1 root wheel 604 Dec 13 21:29 authorized_keys
Are you looking in /home/admin/.ssh or /root/.ssh ?
Updated by Chris Buechler over 15 years ago
- Subject changed from SSH keys not written out to admin's SSH key written to wrong location
Oh, I see what the problem is, admin's home directory is /root but the key gets written to /home/admin/ so it doesn't work.
Updated by Pierre POMES over 15 years ago
- Status changed from New to Feedback
- % Done changed from 0 to 100
Updated by Erik Fonnesbeck almost 15 years ago
As of 38564fde256e83e26f1f65d28ff064e835206ec9 this has regressed. The fix was reverted for some reason in that commit. I don't really know whether there was any particular reason for that or if it needs to go somewhere else now.
Updated by Chris Buechler almost 15 years ago
- Status changed from Resolved to New
Updated by Jim Pingle almost 15 years ago
- Status changed from New to Feedback
Applied in changeset 2708e3997d81f8a755d6b6a31247c2c120b4b4de.