<?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>passwd command &#8211; lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</title>
	<atom:link href="https://lifelinux.com/tag/passwd-command/feed/" rel="self" type="application/rss+xml" />
	<link>https://lifelinux.com</link>
	<description>All About Linux !</description>
	<lastBuildDate>Sun, 15 May 2011 02:37:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.5.3</generator>
	<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>
