Solved

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

Posted on 2011-03-25
6
325 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
trouble on installing syslog-ng on CentOS 7 7 157
Apache module 5 87
CentOs root password/fsck issue 7 61
Bash script to include windows servers 13 40
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

734 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