标签:sshd public key
【用户】create_user_with_sshkey.sh
#!/bin/bash # $ ssh-keygen -t rsa -b 2048 -C you_comment_here -f filename # create user with ssh public key # 20140214 username=‘yourname‘ useradd ${username} id ${username} [ -d /home/${username}/.ssh ] || mkdir -p /home/${username}/.ssh cat <<_PUBKEY >> /home/${username}/.ssh/authorized_keys your public key _PUBKEY chmod 700 /home/${username}/.ssh chmod 600 /home/${username}/.ssh/authorized_keys chown -R ${username}:${username} /home/${username}/.ssh cat /home/${username}/.ssh/authorized_keys
【用户】create_user_with_sshkey.sh
标签:sshd public key
原文地址:http://nosmoking.blog.51cto.com/3263888/1594647