– Command to Create a user in linux is
1 2 3 4 5 |
# useradd [username] Replace [username] with the name of user you want to set. Lets make a testuser |
1 |
# useradd testuser |
– Setup the password for user
1 |
# passwd useradd |
This will make a user directory in /home
However if you have a directory already and want to assign it to user then the command is
1 |
#useradd [username] -d [path to direcotry] |
Lets make a user “testuser”
1 |
#useradd testuser -d /var/www/html/downloads/ |
Assign permission to directory
1 2 |
# chown -R root:testuser /var/www/html/downloads/ # chmod 775 -R /var/www/html/downloads/ |
-R option is to recursivity into directory
Comment Policy:
Your words are your own, so be nice and helpful if you can. Please, only use your real name, not your business name or keywords. Using business name or keywords instead of your real name will lead to the comment being deleted. Anonymous commenting is not allowed either. Limit the amount of links submitted in your comment. We accept clean XHTML in comments, but don't overdo it please.