Usermod:user Lee currently logged in home directory cannot change the solution

Source: Internet
Author: User
Tags linux

In front of a short time to play the Samba service, the above all the services are done, the home directory is not accessible, delete their own smb.conf files, to other services on the synchronization of the file with Rsync, start the service home directory or can not visit, a row of the afternoon, and finally found

The home directory of the user in the/etc/passwd file has changed, so the home directory cannot be accessed.

When using Usermod–d Lee Lee, the error is:

Usermod:user Lee currently logged in

is to add an absolute path

Usermod–d/home/lee Lee still can't change the error.

Usermod:user Lee currently logged in

Anyway, this is the error, how to make it is this error, of course, can also directly modify the configuration file, but that is not fun to play, Linux play is the wrong, right.

After looking for a night's information, I finally solved the problem.

Solution:

Cat/dev/null >/var/run/utmp Empty this file

Restart the reboot and then execute the above command OK.

/var/run/utmp

Utmp is a file, in addition to the UTMP program you can not edit this file, delete his words, the current login information will be lost. It is like the system will be opened after the information of the members of the system quickly recorded, after a period of time it will no longer record, to confirm the system's user configuration is so ...

This file will be recreated every time the machine reboot up.

Author: cnblogs Linuxsuper Meng

Back to the column page: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.