0

I am writing a shell script that will create a user that I will use for deployments. I want to add that user to be able to use sudo without a password. How can I create this user from a shell script or from the command line?

This is what I have so far (this script is run as the root user):

# create user
useradd deploy -m -s /bin/bash

# copy authorized keys
mkdir -p /home/deploy/.ssh
cat ~/.ssh/authorized_keys > /home/deploy/.ssh/authorized_keys
chown -R deploy:deploy /home/deploy/.ssh
Andrew
  • 299
  • @Andrew - Is this link of help for further commands in next steps (like in Debian) ? : http://www.pathin.org/tutorials/howto-enable-sudo-on-user-account-debian-6-squeeze/ – dschinn1001 Sep 17 '13 at 19:21
  • I think that I tried adding the user to the sudo group useradd deploy sudo but it still asked for a password when using sudo – Andrew Sep 18 '13 at 19:30

0 Answers0