:~# ssh-keygen -t rsa -b 4096
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
19:3e:2f:fe:47:28:a6:af:1f:c5:7b:04:6a:36:dc:c7
:~# cd /root/.ssh/
# mv id_rsa tts
下载公钥、私钥文件
使用securecrt 的tools--convert private key to openssh
puppet
cat 导入,避免出现空格
增加公钥
/etc/puppet/modules/user/templates
用户
/etc/puppet/modules/user/templates
more tts.pp
class user::add::tts inherits user::add {
add_user {"tts":
useruid => "655",
username => "tts",
userhome => "tts",
groups => "admin",
gid => "610",
usershell => "/bin/bash",
}
}
~
最后重启目标服务器的sshd服务
阅读(3055) | 评论(0) | 转发(0) |