Project

General

Profile

Bug #218

admin's SSH key written to wrong location

Added by Chris Buechler over 9 years ago. Updated almost 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
User manager
Target version:
Start date:
12/13/2009
Due date:
% Done:

100%

Estimated time:
Affected Version:
2.0
Affected Architecture:

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.

Associated revisions

Revision 5b631e88 (diff)
Added by Pierre POMES over 9 years ago

Home directory of uid 0 should be /root. Ticket #218

Revision 2708e399 (diff)
Added by Jim Pingle almost 9 years ago

Remove some redundant code and make sure admin's home directory is /root - Fixes #218

History

#1 Updated by Pierre POMES over 9 years ago

I tried to add a SSH key to the default admin user, the authorized_key files is created successfully:

  1. pwd
    /home
  2. ls la admin/.ssh/authorized_keys
    -rw-r--r-
    1 root wheel 604 Dec 13 21:11 admin/.ssh/authorized_keys

I also tried to define a new user and add a SSH key, this also works:

  1. ls la ppomes/.ssh/authorized_keys
    -rw-r--r-
    1 ppomes nobody 604 Dec 13 21:18 ppomes/.ssh/authorized_keys

Can you confirm you are talking about the ${HOME}/.ssh/authorized_keys file ?

#2 Updated by Chris Buechler over 9 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.

[]/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.

#3 Updated by Chris Buechler over 9 years ago

Same on a different box, running a Dec. 6 snapshot.

#4 Updated by Pierre POMES over 9 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:

  1. pwd
    /home/admin
  2. rm -rf .ssh/

In the gui, I simply saved the user (the ssh key as already entered). And then:

  1. ls la .ssh/
    total 6
    drwx-----
    2 root wheel 512 Dec 13 21:29 .
    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 ?

#5 Updated by Chris Buechler over 9 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.

#6 Updated by Pierre POMES over 9 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

#7 Updated by Chris Buechler over 9 years ago

  • Status changed from Feedback to Resolved

fixed, thanks!

#8 Updated by Erik Fonnesbeck almost 9 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.

#9 Updated by Chris Buechler almost 9 years ago

  • Status changed from Resolved to New

#10 Updated by Jim Pingle almost 9 years ago

  • Status changed from New to Feedback

#11 Updated by Chris Buechler almost 9 years ago

  • Status changed from Feedback to Resolved

fixed

Also available in: Atom PDF