summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-12-04 15:32:42 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-12-04 15:42:35 -0800
commit103371d47c0d3ea4c28901810e11127de3855d5d (patch)
tree709027d429f428f55412027b9408a43153eee371 /lib
parentebe3578d23a80533f6db1247c8d98f37485256fc (diff)
downloadvyatta-cfg-quagga-103371d47c0d3ea4c28901810e11127de3855d5d.tar.gz
vyatta-cfg-quagga-103371d47c0d3ea4c28901810e11127de3855d5d.zip
Rearrange the public-key configuration schema
New syntax: system login user vyatta authentication public-key user@remote type ssh-rsa
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Vyatta/Login/User.pm21
1 files changed, 8 insertions, 13 deletions
diff --git a/lib/Vyatta/Login/User.pm b/lib/Vyatta/Login/User.pm
index 018e7e12..87dd4db4 100755
--- a/lib/Vyatta/Login/User.pm
+++ b/lib/Vyatta/Login/User.pm
@@ -115,7 +115,7 @@ sub _vyatta_users {
sub set_authorized_keys {
my $user = shift;
my $config = new Vyatta::Config;
- $config->setLevel("system login user $user authorized-keys");
+ $config->setLevel("system login user $user authentication public-keys");
my @keys = $config->listNodes();
return unless @keys;
@@ -139,19 +139,14 @@ sub set_authorized_keys {
return;
}
- select $auth;
- print "# Automatically generated by Vyatta configuration\n";
- print "# Do not edit, all changes will be lost\n";
- foreach my $key (@keys) {
- my $type = $config->returnValue("$key key-type");
- print "$type $key";
-
- my $comment = $config->returnValue("$key description");
- print " $comment" if $comment;
-
- print "\n";
+ print {$auth} "# Automatically generated by Vyatta configuration\n";
+ print {$auth} "# Do not edit, all changes will be lost\n";
+ foreach my $name (@keys) {
+ my $type = $config->returnValue("$name type");
+ my $key = $config->returnValue("$name key");
+ print {$auth} "$type $key $name\n";
}
- select STDOUT;
+
close $auth;
chmod (0640, "$sshdir/authorized_keys");
}