<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>usermod command &#8211; lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</title>
	<atom:link href="https://lifelinux.com/tag/usermod-command/feed/" rel="self" type="application/rss+xml" />
	<link>https://lifelinux.com</link>
	<description>All About Linux !</description>
	<lastBuildDate>Fri, 20 May 2011 06:21:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.5.15</generator>
	<item>
		<title>How To Add User To Group In Linux</title>
		<link>https://lifelinux.com/how-to-add-user-to-group-in-linux/</link>
					<comments>https://lifelinux.com/how-to-add-user-to-group-in-linux/#comments</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Thu, 19 May 2011 11:16:10 +0000</pubDate>
				<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[add user to group]]></category>
		<category><![CDATA[add user to group linux]]></category>
		<category><![CDATA[create user linux]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux add group]]></category>
		<category><![CDATA[linux add user]]></category>
		<category><![CDATA[linux add user to a group]]></category>
		<category><![CDATA[linux add user to group]]></category>
		<category><![CDATA[linux create user]]></category>
		<category><![CDATA[primary group]]></category>
		<category><![CDATA[secondary group]]></category>
		<category><![CDATA[setup password]]></category>
		<category><![CDATA[ubuntu add user to group]]></category>
		<category><![CDATA[unix add user to group]]></category>
		<category><![CDATA[user group]]></category>
		<category><![CDATA[user information]]></category>
		<category><![CDATA[useradd command]]></category>
		<category><![CDATA[usermod command]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=649</guid>

					<description><![CDATA[<p>There are two types of group. First is primary user group and other is secondary group. Group infomation is stored in /etc/group file contains basic group attributes. This is an ASCII file that contains records for system groups. useradd command You need to add new users to existing group. The syntax is as follows: # [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-add-user-to-group-in-linux/">How To Add User To Group In Linux</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>There are two types of group. First is primary user group and other is secondary group. Group infomation is stored in <strong>/etc/group</strong> file contains basic group attributes. This is an ASCII file that contains records for system groups.<span id="more-649"></span></p>
<h3>useradd command</h3>
<p>You need to add new users to existing group. The syntax is as follows:</p>
<pre># useradd -g &lt;groupname&gt; &lt;username&gt;</pre>
<p>Example, create a new user called <strong>user1</strong> and add it to group called <strong>admin</strong>. First login as a root user (make sure group admin exists), type the following command</p>
<pre># useradd -g admin user1</pre>
<p>Ensure that user added properly to group admin, enter</p>
<pre># id user1</pre>
<p>Output</p>
<pre>uid=503(user1) gid=502(admin) groups=502(admin)</pre>
<h3>usermod command</h3>
<p>If you need to add a existing user to existing group, type the command with syntax is as follows</p>
<pre># usermod -G &lt;groupname&gt; &lt;username&gt;</pre>
<p>To add user to a list of supplementary groups, enter</p>
<pre># usermod -G group1, group2, group3 username</pre>
<p>How to remove existing Linux user from existing group? See example bellow</p>
<pre>#id test</pre>
<p>Output</p>
<pre>uid=503(test) gid=501(www) groups=501(www),4(adm),50(ftp)</pre>
<p>To remove adm group from user test, type the following command</p>
<pre># usermod -G www,ftp test</pre>
<p>Ensure that adm group removed from user test, enter</p>
<pre># id test</pre>
<p>Output</p>
<pre>uid=503(test) gid=501(www) groups=501(www),50(ftp)</pre>
<p>Change existing user test primary group to ftp, enter</p>
<pre>usermod -g ftp test</pre>
<p>Output</p>
<pre>uid=503(test) gid=50(ftp) groups=50(ftp),501(www)</pre>
<p>Please note that <strong>&#8220;-g&#8221;</strong> option add user to initial login group (primary group). The group name must exist. And <strong>&#8220;-G&#8221;</strong> option add user to a list of supplementary groups</p>
<g:plusone href="https://lifelinux.com/how-to-add-user-to-group-in-linux/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-add-user-to-group-in-linux/">How To Add User To Group In Linux</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/how-to-add-user-to-group-in-linux/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Setting Up Password Aging In Linux</title>
		<link>https://lifelinux.com/setting-up-password-aging-in-linux/</link>
					<comments>https://lifelinux.com/setting-up-password-aging-in-linux/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Wed, 18 May 2011 06:18:22 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[/etc/login.defs]]></category>
		<category><![CDATA[account password]]></category>
		<category><![CDATA[chage command]]></category>
		<category><![CDATA[configuration name]]></category>
		<category><![CDATA[configuration parameter]]></category>
		<category><![CDATA[enterprise linux]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux users]]></category>
		<category><![CDATA[PAM]]></category>
		<category><![CDATA[pass max days]]></category>
		<category><![CDATA[pass min days]]></category>
		<category><![CDATA[pass warn age]]></category>
		<category><![CDATA[password expiry]]></category>
		<category><![CDATA[passwords]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[shadow password]]></category>
		<category><![CDATA[usermod command]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=611</guid>

					<description><![CDATA[<p>By default, all the account password expiration in Linux are disabled. There have two method to enable and disable password expiration, one of method by editing /etc/shadow file. Another method is using chage command. 1. Edit /etc/shadow Login as root and type the following command # vi /etc/shadow Sample outputs ... lifelinux:$1$UgE5i8uC$mtNxSoPOCl5G5.9mQOQLy.:15092:0:99999:7::: ... As with [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/setting-up-password-aging-in-linux/">Setting Up Password Aging In Linux</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>By default, all the account password expiration in Linux are disabled. There have two method to enable and disable password expiration, one of method by editing /etc/shadow file. Another method is using chage command.<span id="more-611"></span></p>
<h3>1. Edit /etc/shadow</h3>
<p>Login as root and type the following command</p>
<pre>
# vi /etc/shadow
</pre>
<p>Sample outputs</p>
<pre>
...
lifelinux:$1$UgE5i8uC$mtNxSoPOCl5G5.9mQOQLy.:15092:0:99999:7:::
...
</pre>
<p>As with the passwd file, each field in the shadow file is also separated with &#8220;:&#8221; colon characters, and are as follows:<br />
1. Username, up to 8 characters. Case-sensitive, usually all lowercase. A direct match to the username in the /etc/passwd file.<br />
2. Password, 13 character encrypted. A blank entry (eg. ::) indicates a password is not required to log in (usually a bad idea), and a &#8220;*&#8221; entry (eg. :*:) indicates the account has been disabled.<br />
3. The number of days (since January 1, 1970) since the password was last changed.<br />
4. The number of days before password may be changed (0 indicates it may be changed at any time)<br />
5. The number of days after which password must be changed (99999 indicates user can keep his or her password unchanged for many, many years)<br />
6. The number of days to warn user of an expiring password (7 for a full week)<br />
7. The number of days after password expires that account is disabled<br />
8. The number of days since January 1, 1970 that an account has been disabled<br />
9. A reserved field for possible future use<br />
<strong>Syntax:</strong></p>
<pre>
{userName}:{password}:{lastpasswdchanged}:{Minimum_days}:{Maximum_days}:{Warn}:{Inactive}:{Expire}:
</pre>
<h3>2. Using chage command</h3>
<pre>
Usage: chage [options] user

Options:
  -d, --lastday LAST_DAY        set last password change to LAST_DAY
  -E, --expiredate EXPIRE_DATE  set account expiration date to EXPIRE_DATE
  -h, --help                    display this help message and exit
  -I, --inactive INACTIVE       set password inactive after expiration
                                to INACTIVE
  -l, --list                    show account aging information
  -m, --mindays MIN_DAYS        set minimum number of days before password
                                change to MIN_DAYS
  -M, --maxdays MAX_DAYS        set maximim number of days before password
                                change to MAX_DAYS
  -W, --warndays WARN_DAYS      set expiration warning days to WARN_DAYS
</pre>
<p>To list current aging type chage command for particular user account, example lifelinux, enter</p>
<pre>
# chage -l lifelinux
</pre>
<p>Sample outputs</p>
<pre>
Last password change                                    : Apr 28, 2011
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 99999
Number of days of warning before password expires       : 7
</pre>
<p><strong>Example:</strong> Set password aging for lifelinux, force password change every 60 days (-M 60), and prevent password changes for seven days (-m 7). Login users will receiving warnings 7 days (-W 7) and account will be locked after 7 days (-I 7).</p>
<pre>
# chage -m 7 -M 60 -W 7 -I 7 lifelinux
</pre>
<p>To Disable password aging, enter</p>
<pre>
# chage -m 0 -M 99999 -I -1 lifelinux
</pre>
<p>Force user to change password at first login, enter</p>
<pre>
# chage -d 0 lifelinux
</pre>
<g:plusone href="https://lifelinux.com/setting-up-password-aging-in-linux/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/setting-up-password-aging-in-linux/">Setting Up Password Aging In Linux</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/setting-up-password-aging-in-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Deny Or Block User Login In Linux</title>
		<link>https://lifelinux.com/how-to-deny-or-block-user-account-in-linux/</link>
					<comments>https://lifelinux.com/how-to-deny-or-block-user-account-in-linux/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Sun, 15 May 2011 01:24:35 +0000</pubDate>
				<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[account password]]></category>
		<category><![CDATA[allow login]]></category>
		<category><![CDATA[deny login]]></category>
		<category><![CDATA[encrypted password]]></category>
		<category><![CDATA[passwd command]]></category>
		<category><![CDATA[usermod command]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=560</guid>

					<description><![CDATA[<p>Deny user login by /etc/shadow Default, Linux systems use /etc/shadow to store the encrypted user passwords. The quickest way to block a user is to alter is password stored in /etc/shadow. Normally an active user account will have one line in /etc/shadow that will look like: files:$1$x52JQZle$82KTK0hbzozR3BRuwEWLF.:14970:0:99999:7::: Where the second field is the encrypted password. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-deny-or-block-user-account-in-linux/">How To Deny Or Block User Login In Linux</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><h3>Deny user login by /etc/shadow</h3>
<p>Default, Linux systems use /etc/shadow to store the encrypted user passwords. The quickest way to block a user is to alter is password stored in /etc/shadow. Normally an active user account will have one line in /etc/shadow that will look like:</p>
<pre>
files:$1$x52JQZle$82KTK0hbzozR3BRuwEWLF.:14970:0:99999:7:::
</pre>
<p><span id="more-560"></span><br />
Where the second field is the encrypted password. If we replace the password with &#8220;*&#8221; or &#8220;!&#8221; this will make the account unusable, and it will mean that no login is permitted for the user</p>
<pre>
files:!:14970:0:99999:7:::
</pre>
<h3>Deny user login by passwd command</h3>
<p>Use flag -l to lock the specified account and it is available to root only, example deny user1 login</p>
<pre>
# passwd -l user1
</pre>
<h3>Deny user login by usermod command</h3>
<p>The /sbin/nologin command politely refuse a login. It displays a message that an account is not available and exits non-zero. This is prefreed method these days to deny login access to account. You can also change shell to /sbin/nologin, type the following command</p>
<pre>
# usermod -s /sbin/nologin user1
</pre>
<p>Verify with these commands:</p>
<pre>
# cat /etc/passwd | grep user1
</pre>
<p>Shown as follows</p>
<pre>
user1:x:607:605::/home/user1:/sbin/nologin
</pre>
<g:plusone href="https://lifelinux.com/how-to-deny-or-block-user-account-in-linux/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-deny-or-block-user-account-in-linux/">How To Deny Or Block User Login In Linux</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/how-to-deny-or-block-user-account-in-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
