<?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>Admon Home &#187; password</title>
	<atom:link href="http://www.admon.org/tag/password/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.admon.org</link>
	<description>Linux System Administration</description>
	<lastBuildDate>Sat, 19 May 2012 03:36:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Password-Only Login for SSH and SCP</title>
		<link>http://www.admon.org/password-only-login-for-ssh-and-scp/</link>
		<comments>http://www.admon.org/password-only-login-for-ssh-and-scp/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 02:57:42 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[public keys]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://planet.admon.org/?p=825</guid>
		<description><![CDATA[Public key authentication is very common way when we have to access remote Linux/UNIX servers. Normally, we add the public keys to the authentication agent on local side (e.g. by ssh-add), to simply the login process. But there might be problems, like this one: debian@controller:~$ scp pub.admon.org:/tmp/2012.tgz . Received disconnect from 10.195.15.37: 2: Too many [...]]]></description>
			<content:encoded><![CDATA[<p>Public key authentication is very common way when we have to access remote Linux/UNIX servers. Normally, we add the public keys to the authentication agent on local side <em>(e.g. by <a href="http://linux.die.net/man/1/ssh-add">ssh-add</a>)</em>, to simply the login process. <span id="more-825"></span>But there might be problems, like this one:</p>
<pre>debian@controller:~$ scp pub.admon.org:/tmp/2012.tgz .
Received disconnect from 10.195.15.37: 2: Too many authentication failures for debian</pre>
<p>How can we bypass this issue without removing the keys from our authentication agent?</p>
<p>A direct way is to enable password authentication and force client to use it instead of public keys auth. To enable password authentication is very simple, you can just add the parameter &#8220;<em>-o PubkeyAuthentication=no</em>&#8221; to your ssh based command like ssh, scp and sftp.</p>
<pre>debian@controller:~$ scp -o PubkeyAuthentication=no debian@pub.admon.org:/tmp/2012.tgz .
debian@parser.minivps.com's password:
2012.tgz                                                           100%    20MB     22.5MB/s   00:01
</pre>
<p>The option&#8217;s parameter is case insensitive, so you just need to remember it&#8217;s <em>pubkey</em> and <em>authentication</em>. If you face additional errors, please have a check and make sure you have password authentication enabled at the server side. Normally, that&#8217;s an active directive &#8220;<em>PasswordAuthentication no</em>&#8221; in <em>/etc/ssh/sshd_config</em>.</p>
<p>If you&#8217;re not sure how to enable public key authentication to harden your servers, you can refer to <a href="http://www.cyberciti.biz/faq/ssh-password-less-login-with-dsa-publickey-authentication/">this link</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/password-only-login-for-ssh-and-scp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate random password in Linux Command Line</title>
		<link>http://www.admon.org/generate-random-password-linux-command-line/</link>
		<comments>http://www.admon.org/generate-random-password-linux-command-line/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 05:37:24 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[System Tuning]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[random password]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://planet.admon.org/?p=715</guid>
		<description><![CDATA[Password is widely used in a production environment, for example, when we created a system account, we need to set an initial password for it, and When email / database / Subversion / LDAP (..etc.) accounts created, random passwords are needed as well. As the random password is common, there are many ways to generate [...]]]></description>
			<content:encoded><![CDATA[<p>Password is widely used in a production environment, for example, when we created a system account, we need to set an initial password for it, and When email / database / Subversion / LDAP (..etc.) accounts created, random passwords are needed as well.<br />
<span id="more-715"></span>As the random password is common, there are many ways to generate random passwords in Linux/UNIX. We&#8217;ll show some examples here on how to generate a strong password on Linux command line.</p>
<p>Please note that this post does not cover the topics on <a href="http://en.wikipedia.org/wiki/Password_strength" target="_blank">password strength</a>. you can use some <a href="http://www.passwordmeter.com/" target="_blank">online tools</a> to check password strength.</p>
<p style="text-align: center;"><a href="http://planet.admon.org/wp-content/uploads/2010/07/Gmail-PassWord-Strength.png"><img class="aligncenter size-full wp-image-734" title="Gmail-PassWord-Strength" src="http://planet.admon.org/wp-content/uploads/2010/07/Gmail-PassWord-Strength.png" alt="Gmail passWord strength check" width="553" height="288" /></a><em>GMail Password Strength Check</em></p>
<p>You can use the following four commands directly in most of Linux distributions with default install.</p>
<pre>joseph@test:~$ &lt; /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c8
3saMDFXB</pre>
<p>I personally prefer to use this command. The other commands work great too, check below:</p>
<pre>cat /dev/urandom | tr -cd 'a-f0-9' | head -c 16
dd if=/dev/random count=10 bs=1 | hexdump  | cut -d   -f 2-| head -n 1 | tr -d " "</pre>
<p>uuencode which is supplied by <a href="http://www.gnu.org/software/sharutils/">sharutils</a> is needed by this command (Sharutils is not installed by default):</p>
<pre>head -c 12 /dev/random | uuencode -m - | tail -n 2 | head -n 1</pre>
<p>By using the following command, you need to get <em>mkpasswd</em> installed. It&#8217;s man page is <a href="http://linux.about.com/library/cmd/blcmdl_mkpasswd.htm">available here</a>. It can be run like this:</p>
<pre>mkpasswd -l 16 -s 0 -C 0|sed 's/[0ol1]/f/g'</pre>
<p>Finally, if you have <a href="http://sourceforge.net/projects/pwgen/" target="_blank">pwgen</a> installed, you can also generate a random password in linux command line like this:</p>
<pre>pwgen -ycn 16 1</pre>
<p>PWGen supports Windows platform as well, you just need to install <a href="http://sourceforge.net/projects/pwgen-win/" target="_blank">pwgen-win</a> instead, it has a nice GUI.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/generate-random-password-linux-command-line/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ways to reset MySQL user password</title>
		<link>http://www.admon.org/ways-to-reset-mysql-user-password/</link>
		<comments>http://www.admon.org/ways-to-reset-mysql-user-password/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 06:10:26 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[DBA]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[permission]]></category>

		<guid isPermaLink="false">http://planet.admon.org/?p=517</guid>
		<description><![CDATA[How can I change user password under MySQL server when I lost my password? Here&#8217;s I&#8217;ll show two examples. The first example is about how to change password for normal user using Linux command line option, and the second example is on how to reset MySQL DBA password (By default, this user is called root). [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://planet.admon.org/wp-content/uploads/2010/01/mysql.jpg"><img class="alignleft size-full wp-image-758" title="mysql" src="http://planet.admon.org/wp-content/uploads/2010/01/mysql.jpg" alt="MySQL database" width="150" height="150" /></a>How can I change user password under MySQL server when I lost my password?<br />
Here&#8217;s I&#8217;ll show two examples. The first example is about how to change password for normal user using Linux command line option, and the second example is on how to reset MySQL DBA password (By default, this user is called root).<span id="more-517"></span></p>
<p><strong>Reset user password in MySQL</strong><br />
Let&#8217;s assume the normal user&#8217;s name is fatman, follow these steps to start:<br />
1), Login to MySQL server, type following command at shell prompt to login as root</p>
<pre>$ mysql -u root -p</pre>
<p>2), Choose the right database mysql database, it&#8217;s mysql:</p>
<pre>mysql&gt; use mysql;</pre>
<p>3), Change password for user fatman:</p>
<pre>mysql&gt; update user set password=PASSWORD("NEW-PASSWORD-HERE") where User='fatman';</pre>
<p>4), Finally,dont forget to flush privileges:</p>
<pre>mysql&gt; flush privileges;</pre>
<p>You can also use grant to reset a user&#8217;s password, the command is like this:</p>
<pre>mysql&gt; grant select,update,delete,insert on somedb.* to fatman@'somehost' identified by 'NEW-PASSWORD-HERE';</pre>
<p><strong>Reset DBA password in MySQL</strong><br />
When the DBA&#8217;s password lost, things become a little difficult, a restart might needed which is not so good for productive servers. There still have some possibilites to retrieval it without restart mysql service:</p>
<p>1), Is there any user has insert permission on the database &#8220;mysql&#8221;?<br />
If so, he can insert into mysql.user and create another DBA account.</p>
<p>2), Is there any user has super user permissions?<br />
For example, when the user was create like &#8220;<em>GRANT ALL ON *.* TO user@&#8217;localhost&#8217; WITH GRANT OPTION</em>&#8220;, then this use is actually another DBA, you can ask him to reset root&#8217;s password.</p>
<p>If you got no luck till now, we have a common way here to fix the password. We can ask mysql server to bypass its grant tables when starting it. Thus it will not verify user passwords and permissions when they logon. That means all users will have <a href="http://dev.mysql.com/doc/refman/5.1/en/privileges-provided.html">full access to all databases</a> as a database administrator.</p>
<pre>$ /usr/sbin/mysqld --verbose --help | grep skip-grant-tables -A1
  --skip-grant-tables Start without grant tables. This gives all users FULL
                      ACCESS to all tables!
--
skip-grant-tables                 FALSE
skip-slave-start                  FALSE
</pre>
<p>Before making this changes, you need to make sure there&#8217;s no queries running on mysql. Then shutdown mysql instance first (mysql&#8217;s control script will help do that. In RPM based systems, it&#8217;s <em>/etc/init.d/mysql</em>) , and apply this option in the script, and start the service again.</p>
<p>When the DBA password got reset, do forget to remove the changes in mysql&#8217;s control script. If there any issue occures, please dont hesitate to <a href="http://forum.admon.org/linux-databases/">create a topic</a> in our support forum!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/ways-to-reset-mysql-user-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

