I'm trying to make a script where it makes a test user with a home dir and the rights he needs but everytime I run the script I get the following error:
/home/thomas/Scripts/CreateUser.sh: line 2: useradd: command not found
passwd: user 'password' does not exist
/home/thomas/Scripts/CreateUser.sh: line 4: mkhomedir_helper: command not found
chmod: cannot access ‘/home/Test/’: No such file or directory
Script:
#!/bin/bash
useradd Test
passwd password
mkhomedir_helper Test
chmod 700 /home/Test/
I'm new to linux so I don't know why this happens, any solutions?
find / -iname useradd
? – 13dimitar Feb 03 '17 at 11:50more /etc/*-release
andecho $PATH
– 13dimitar Feb 03 '17 at 11:57more /etc/*-release
– 13dimitar Feb 03 '17 at 12:01