using putty SSH connection how do I set a users home directory

I've jsut created a new user and set their password.

How do I set their home directory? Assuming the user is named 'usertest' and I want their home directory to be '/var/www/' what command would I enter?

Thanks
LVL 4
elliottbenzleAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
pilson66Connect With a Mentor Commented:
usermod -d /var/www/ username
0
 
pilson66Commented:
You need to edit /etc/passwd
Example:
rtorrent:x:117:100::/opt/rtorrent:/bin/bash

Edit to:
rtorrent:x:117:100::/var/www:/bin/bash

0
 
woolmilkporcCommented:
usermod -h /var/www userid
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
woolmilkporcConnect With a Mentor Commented:
Sorry, just saw it's Linux!

Under Linux use

usermod -d /var/www userid

and to create the directory should it not yet exist use

usermod -m -d /var/www userid

wmp
0
 
farzanjCommented:
Run the following commands as root

 
usermod -d /var/www userid

Open in new window


Then issue the following to allow him privileges to his files
 
chown user /var/www

Open in new window


0
 
elliottbenzleAuthor Commented:
Thank you
0
All Courses

From novice to tech pro — start learning today.