useradd vagrant -m -d /home/vagrant

echo "Defaults !requiretty
vagrant ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-vagrant
sed -i -r 's/.*UseDNS.*/UseDNS no/' /etc/ssh/sshd_config

mkdir -p /root/.ssh
cat /root/vagrant_pub_key >> /root/.ssh/authorized_keys
chown -R root: /root
chmod 0700 /root/.ssh
chmod 0600 /root/.ssh/authorized_keys

mkdir -p /home/vagrant/.ssh
cat /root/vagrant_pub_key >> /home/vagrant/.ssh/authorized_keys
chown -R vagrant: /home/vagrant
chmod 0700 /home/vagrant/.ssh
chmod 0600 /home/vagrant/.ssh/authorized_keys

useradd vagrant -u 5000 -m -d /home/vagrant

echo "Defaults !requiretty
vagrant ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-vagrant
sed -i -r 's/.*UseDNS.*/UseDNS no/' /etc/ssh/sshd_config

mkdir -p /root/.ssh
cat /root/vagrant_pub_key >> /root/.ssh/authorized_keys
chown -R root: /root
chmod 0700 /root/.ssh
chmod 0600 /root/.ssh/authorized_keys

mkdir -p /home/vagrant/.ssh
cat /root/vagrant_pub_key >> /home/vagrant/.ssh/authorized_keys
chown -R vagrant: /home/vagrant
chmod 0700 /home/vagrant/.ssh
chmod 0600 /home/vagrant/.ssh/authorized_keys

Use uid 5000 for vagrant user
Use uid 5000 for vagrant user

To reduce the possibility of conflicts. Some production boxes have
UIDs around 1000 already taken for users, and if developer wants
parity between the vagrant box and production box, having a vagrant
user with UID 1000 can be a problem.
