Fix ssh_authorized_key

When one uses the $name to define the user that should receive an SSH
key, setting $user to a negative value, ssh_authorized_key currently
creates the authorized_keys file under /home/.ssh/authorized_keys

Fix this by changing ${user} to ${real_user} in the key's path.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
This commit is contained in:
Gabriel Filion 2011-01-19 20:45:59 -05:00
parent 35768ed1e8
commit 5bb61c2761

View file

@ -22,7 +22,7 @@ define sshd::ssh_authorized_key(
undef,'': { undef,'': {
case $real_user { case $real_user {
'root': { $real_target = '/root/.ssh/authorized_keys' } 'root': { $real_target = '/root/.ssh/authorized_keys' }
default: { $real_target = "/home/${user}/.ssh/authorized_keys" } default: { $real_target = "/home/${real_user}/.ssh/authorized_keys" }
} }
} }
default: { default: {