이 콘텐츠는 선택한 언어로 제공되지 않습니다.

3.4.4. Modifying User Settings


When a user already exists and you need to specify any of the options now, use the usermod command. The logic of using usermod is identical to useradd as well as its syntax:
usermod option(s) username
If you need to change the user's user name, use the -l option with the new user name (or login).

Example 3.10. Changing User's Login

~]# usermod -l "emily-smith" emily
The -l option changes the name of the user from the login emily to the new login, emily-smith. Nothing else is changed. In particular, emily's home directory name (/home/emily) remains the same unless it is changed manually to reflect the new user name.
In a similar way you can change the user's UID or user's home directory. See the example below:

Note

Find all files owned by the specified UID in system and change their owner. Do the same for Access Control List (ACL) referring to the UID. It is recommended to check there are no running processes as they keep running with the old UID.

Example 3.11. Changing User's UID and Home Directory

~]# usermod -a -u 699 -d /home/dir_2 robert
The command with -a -u and -d options changes the settings of user robert. Now, his ID is 699 instead of 501, and his home directory is no longer /home/robert but /home/dir_2.
With the usermod command you can also move the content of the user's home directory to a new location, or lock the account by locking its password.

Example 3.12. Changing User's

~]# usermod -m -d /home/jane -L jane
In this sample command, the -m and -d options used together move the content of jane's home directory to the /home/dir_3 directory. The -L option locks the access to jane's account by locking its password.
For the whole list of options to be used with the usermod command, see the usermod(8) man page or run usermod --help on the command line.
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.