Solved

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

Posted on 2011-03-25
6
324 Views
Last Modified: 2012-05-11
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
Comment
Question by:elliottbenzle
6 Comments
 
LVL 8

Expert Comment

by:pilson66
ID: 35215544
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
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 35215548
usermod -h /var/www userid
0
 
LVL 8

Accepted Solution

by:
pilson66 earned 250 total points
ID: 35215587
usermod -d /var/www/ username
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 250 total points
ID: 35215611
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
 
LVL 31

Expert Comment

by:farzanj
ID: 35215642
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
 
LVL 4

Author Closing Comment

by:elliottbenzle
ID: 35219233
Thank you
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Fine Tune your automatic Updates for Ubuntu / Debian
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question