Solved

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

Posted on 2011-03-25
6
321 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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now