LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 09-22-2015, 03:02 PM   #1
doveman
LQ Newbie
 
Registered: Sep 2015
Posts: 1

Rep: Reputation: Disabled
usermod - Can't change home - user logged in?


Hello,
I am new on this forum so bear with me.
I am trying to change the home directory of a user. I logged in as another user and executed:
sudo usermod -d /var/newhome username

The response I get back is username is currently logged in.

When I do a who the only user logged in is myself. Not the user I am trying to change.

Is there a table somewhere that needs to be cleared or something else?

I am on ubuntu 12.04.4 LTS 64 bit.

Thank you.
 
Old 09-23-2015, 01:56 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
You might want to also employ the -m flag to "move" the contents from old to new.

I'd recommend that you do not have the newhome directory created because the usermod command will create it for you. Perhaps this is part of the problem in that you created it but the permissions are in the way of this action and you get a not helpful error.

I'm also assuming the username is not root. You cannot change root's home location. Well you "should not" strongly enough that it really is "cannot".

I'm sure there are other ways to determine if a user is logged in or has processes running, I personally would use the ps command:
Code:
$ ps -ef | grep username
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CHANGE HOME DIRECTORY USING usermod -dm crahuldba@gmail.com Linux - Newbie 5 11-01-2015 09:28 PM
How to determine if user is logged in (from anywhere) from just home dir contents? mikemorris Linux - Security 3 11-10-2013 04:44 AM
to change the home directory of a user by using usermod nerdy1 Linux - Newbie 7 12-25-2012 09:25 AM
Change User ID once logged in Nerdio Linux - Newbie 8 11-11-2011 07:28 AM
change password of a user using usermod command rahulchandrak Linux - Newbie 1 07-20-2010 12:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 12:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration