我需要一个解决方案,以便能够向一个用户添加多个 SSH“密钥”。
class user {
user { 'k':
ensure => present,
comment => 'bogo user',
home => '/home/k',
managehome => true
}
ssh_authorized_key { 'k_ssh':
user => 'k',
type => 'rsa',
key => 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDk656+4Ivl5MnFBSmQw+hnsd7DsueGbZ5HbVlzE8BvYxbwlWAO5DiVw2p1qae/WLJNJDDl7unZemLApR+YkKIL6HXbCUj8V8+KHqSyE9pshMiRj/Lh2lNhZQPFbE8cc6TNY3YVSeyKY0mw8Uj4MBGWnv62DWoO5QuM17CJrD6gH1VlkCqVt8c7jSd9ijmCume5QExwlUtMjl60ZyfbTRbz16aQJNKbqdeIGKA6rB97xet1cHNZ08cCd37GqtMyMiqYwgxxaG87y9DekotLQ9Zw12gyMVgaeGuihZfIV+F6HS1vKNjiL+av+zKxWPidSjlQf2qhthnaMnfPWGjjQfJ7',
}
}
答案1
应该可以添加第二个ssh_authorized_key
资源:
ssh_authorized_key { '[email protected]':
user => 'k',
type => 'rsa',
key => 'AAAAB3Nz.... ',
}
ssh_authorized_key { '[email protected]':
user => 'k',
type => 'rsa',
key => 'BBBBBB3Nz..... ',
}
重要的是资源名称不同。