sudoできるユーザの作成
$ useradd -m -d /home/ansible_deploy_user/ -s /bin/bash -G sudo ansible_deploy_user $ touch /etc/sudoers.d/ansible_deploy_user $ echo "ansible_deploy_user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/ansible_deploy_user
SSHで接続する為の設定
$ sudo su - ansible_deploy_user $ mkdir /home/ansible_deploy_user/.ssh $ echo "公開鍵の中身" > /home/ansible_deploy_user/.ssh/authorized_keys $ chmod 700 /home/ansible_deploy_user/.ssh $ chmod 600 /home/ansible_deploy_user/.ssh/authorized_keys