Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I can't change a user's home directory using usermod;

[root@server ~]# usermod -d /some/opther/path userfoo
usermod: user userfoo is currently logged in
[root@server ~]$ who
myuser  pts/0        2013-06-17 11:29 (1.2.3.4)

As you can see, I am the only person logged in, userfood isn't logged in anywhere.

[root@waccoe-web ~]$ ps aux | grep userfoo
root  16724  0.0  0.0 103236   884 pts/0    S+   11:36   0:00 grep userfoo

userfoo also has no processes running.

userfoo exists purely for FTP access to the server. I have stopped, started, and restarted the FTP server (ProFTPD) to ensure there are no hanging FTP connections. This server still thinks userfoo is logged in.

How can I either convince the usermod command userfoo isn't logged in, or remove any trace of that account being in use? I suppose I could edit /etc/passwd but that seems like working around the problem to me. Or is that infact going ot be OK? I would have thought that if the system believes the user is still logged in, this isn't going to work until all their sessions have been terminated.

[root@server ~]# cat /etc/issue
CentOS release 6.3 (Final)
share|improve this question
1  
I'm not 100% sure how usermod determines if a user is logged in but you could try and use "lsof" to see if there are any files being held open in the user's home directory. –  Fred Clausen Jun 17 '13 at 11:16
    
Try stopping proftpd, making the change, then starting it. –  Nathan C Jun 17 '13 at 11:16
    
@NathanC As I said in the question "I have stopped, started, and restarted the FTP server (ProFTPD) to ensure there are no hanging FTP connections." - If that wasn't clear enough, I have restarted proftpd many times. –  jwbensley Jun 17 '13 at 11:39
2  
It's clear that you have restarted it. It's not clear whether you tried to make the changes while it was stopped. –  Jenny D Jun 17 '13 at 11:41
    
@JennyD Ah, I see! Before stopping it, once it was stopped, and after restarting it :) –  jwbensley Jun 17 '13 at 12:39

1 Answer 1

up vote 0 down vote accepted

A couple of weeks later I compiled a newer Kernel so I had to reboot the box anyway, this was unsolved essentially, but now we can no longer continue exploring this issue.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.