Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 331
  • Last Modified:

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
0
elliottbenzle
Asked:
elliottbenzle
2 Solutions
 
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
 
pilson66Commented:
usermod -d /var/www/ username
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
woolmilkporcCommented:
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

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now