Skip to content

Instantly share code, notes, and snippets.

@navin-mohan
navin-mohan / add-new-user-passwordless.sh
Last active July 3, 2018 13:38
Shell script to add new user to a remote debian server and set up password less login
#!/bin/bash
# This script adds a new user to the remote server , adds it to sudoers list and enables passwordless login
# follow on my blog https://www.coderew.com/computers/ssh-add-user-remotely-script/
read -p "Enter your Server IP:" serverIP #get server IP address
read -p "Enter a new username:" newusername #username for the new user
read -s -p "Enter the password for $newusername:" password #password
printf "\nEnter the root password of the server when prompted\n"