Fix useradd linux bash script
$10-30 USD
$10-30 USD
Paid on delivery
#!/bin/bash
if [ $(id -u) -eq 0 ];
then
Sudo echo "Enter username: "
Sudo useradd -d /home/user1 -s /usr/lib/sftp-server -M -N user1
[ $? -eq 0 ] && echo "User has been added to system!"|| echo "Failed to add a user!"
Sudo mkdir -p /home/user1/public_html /home/user1/WebApp /home/user1/.ssh
Sudo chown user1 /home/user1/public_html /home/user1/WebApp /home/user1/.ssh
Sudo chmod 700 /home/user1/.ssh
Sudo passwd user1
else
echo "Only root may add a user to the system"
exit 2
fi
Project ID: 17608104
About the project
1 proposal
Remote project
Active 6 yrs ago
Looking to make some money?
Benefits of bidding on Freelancer
Set your budget and timeframe
It's free to sign up and bid on jobs