<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
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/"
> <channel><title>Comments on: How to: Linux reset the permissions of the installed rpm packages with &#8211;setperms option</title> <atom:link href="http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html/feed" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html</link> <description>This is a Linux sys admin journal by Vivek about sys admin work, Linux tips &#38; tricks, hacks, news and more.</description> <lastBuildDate>Fri, 10 Feb 2012 20:37:43 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Kevin Andrews</title><link>http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-177208</link> <dc:creator>Kevin Andrews</dc:creator> <pubDate>Mon, 19 Dec 2011 22:02:53 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-177208</guid> <description>Thanks for taking the time to put this solution together... I was on my CentOS VPS changing permissions to secure down a drupal install and forgot for a moment that &quot;/&quot; meant the root of the server not the directory i was cd&#039;d to... I accidently started chmoding the entire server to 777 :-( not good..
SSH stopped working so i went onto the VPS web-based serial console and ran your commands... everything including ssh started working again!
Nearing the end of 2011 and yet again you&#039;ve saved a server :) thanks very much!</description> <content:encoded><![CDATA[<p>Thanks for taking the time to put this solution together&#8230; I was on my CentOS VPS changing permissions to secure down a drupal install and forgot for a moment that &#8220;/&#8221; meant the root of the server not the directory i was cd&#8217;d to&#8230; I accidently started chmoding the entire server to 777 :-( not good..</p><p>SSH stopped working so i went onto the VPS web-based serial console and ran your commands&#8230; everything including ssh started working again!</p><p>Nearing the end of 2011 and yet again you&#8217;ve saved a server :) thanks very much!</p> ]]></content:encoded> </item> <item><title>By: Tux Amit</title><link>http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-176144</link> <dc:creator>Tux Amit</dc:creator> <pubDate>Mon, 28 Nov 2011 10:36:52 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-176144</guid> <description>Gr8 work !!
Could you pls let us know.. how the rpm command gets installed rpm&#039;s files default permission details ..  there must some rpm db which will having permission details ..</description> <content:encoded><![CDATA[<p>Gr8 work !!</p><p>Could you pls let us know.. how the rpm command gets installed rpm&#8217;s files default permission details ..  there must some rpm db which will having permission details ..</p> ]]></content:encoded> </item> <item><title>By: Paul Reiber</title><link>http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-175957</link> <dc:creator>Paul Reiber</dc:creator> <pubDate>Wed, 23 Nov 2011 19:38:57 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-175957</guid> <description>...let&#039;s change that to _definitely_ rather than &quot;may&quot;.
You DEFINITELY want to flip the order in which you run these.
Permissions corrections enacted by --setperms will get blown away by subsequent u/g corrections enacted by --setugids.
Getting the order correct, and combining this into a one-liner, we have:
&lt;strong&gt;&lt;blockquote&gt;
for p in $(rpm -qa); do rpm –setugids $p; rpm –setperms $p; done
&lt;/blockquote&gt;&lt;/strong&gt;</description> <content:encoded><![CDATA[<p>&#8230;let&#8217;s change that to _definitely_ rather than &#8220;may&#8221;.</p><p>You DEFINITELY want to flip the order in which you run these.</p><p>Permissions corrections enacted by &#8211;setperms will get blown away by subsequent u/g corrections enacted by &#8211;setugids.</p><p>Getting the order correct, and combining this into a one-liner, we have:<br
/> <strong><br
/><blockquote><p>for p in $(rpm -qa); do rpm –setugids $p; rpm –setperms $p; done</p></blockquote><p></strong></p> ]]></content:encoded> </item> <item><title>By: marc</title><link>http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-174493</link> <dc:creator>marc</dc:creator> <pubDate>Thu, 29 Sep 2011 20:44:49 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-174493</guid> <description>for p in $(rpm -qa); do rpm --setugids $p; done
saves my ass !
after a wrong &quot;chmod 440 /&quot; i was&#039;nt able to ssh to the machine just root login works
this fix&#039;d it.</description> <content:encoded><![CDATA[<p>for p in $(rpm -qa); do rpm &#8211;setugids $p; done<br
/> saves my ass !<br
/> after a wrong &#8220;chmod 440 /&#8221; i was&#8217;nt able to ssh to the machine just root login works<br
/> this fix&#8217;d it.</p> ]]></content:encoded> </item> <item><title>By: Bryan Sutherland</title><link>http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-171751</link> <dc:creator>Bryan Sutherland</dc:creator> <pubDate>Sat, 04 Jun 2011 23:32:58 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-171751</guid> <description>Thanks for this article Vivek :D :D
As noted above, this saved me tonnes of time and a rebuild that I really didn&#039;t want to take on today :P</description> <content:encoded><![CDATA[<p>Thanks for this article Vivek :D :D<br
/> As noted above, this saved me tonnes of time and a rebuild that I really didn&#8217;t want to take on today :P</p> ]]></content:encoded> </item> <item><title>By: Pedro Sousa</title><link>http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-171245</link> <dc:creator>Pedro Sousa</dc:creator> <pubDate>Tue, 10 May 2011 09:23:52 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-171245</guid> <description>Almost middle of 2011 and your effort is still saving servers.
Thank you Vivek.</description> <content:encoded><![CDATA[<p>Almost middle of 2011 and your effort is still saving servers.</p><p>Thank you Vivek.</p> ]]></content:encoded> </item> <item><title>By: Chris</title><link>http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-159226</link> <dc:creator>Chris</dc:creator> <pubDate>Sat, 28 Aug 2010 11:14:32 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-159226</guid> <description>Thank you so much, your post has saved my server!</description> <content:encoded><![CDATA[<p>Thank you so much, your post has saved my server!</p> ]]></content:encoded> </item> <item><title>By: Paul</title><link>http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-154632</link> <dc:creator>Paul</dc:creator> <pubDate>Wed, 31 Mar 2010 04:06:26 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-154632</guid> <description>Thanks very much for this! Saved me a lot of time and effort!</description> <content:encoded><![CDATA[<p>Thanks very much for this! Saved me a lot of time and effort!</p> ]]></content:encoded> </item> <item><title>By: Semi</title><link>http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-148110</link> <dc:creator>Semi</dc:creator> <pubDate>Tue, 14 Apr 2009 05:30:05 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-148110</guid> <description>I prefer &quot;rpm --setperms -a&quot; to restore permissions of ALL packaged files.</description> <content:encoded><![CDATA[<p>I prefer &#8220;rpm &#8211;setperms -a&#8221; to restore permissions of ALL packaged files.</p> ]]></content:encoded> </item> <item><title>By: James</title><link>http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-146696</link> <dc:creator>James</dc:creator> <pubDate>Wed, 14 Jan 2009 16:45:04 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-146696</guid> <description>You may want to flip the order in which you change mod and u/gid since setting a mode like 2755 will be undone if you change the u/gid.
Run
for p in $(rpm -qa); do rpm --setugids $p; done
before
for p in $(rpm -qa); do rpm --setperms $p; done</description> <content:encoded><![CDATA[<p>You may want to flip the order in which you change mod and u/gid since setting a mode like 2755 will be undone if you change the u/gid.</p><p>Run</p><p>for p in $(rpm -qa); do rpm &#8211;setugids $p; done</p><p>before</p><p>for p in $(rpm -qa); do rpm &#8211;setperms $p; done</p> ]]></content:encoded> </item> <item><title>By: Magnus</title><link>http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-145908</link> <dc:creator>Magnus</dc:creator> <pubDate>Mon, 01 Dec 2008 14:13:11 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-145908</guid> <description>Thank you for publishing this information you saved me a bounch of hours of work :)
Thanks</description> <content:encoded><![CDATA[<p>Thank you for publishing this information you saved me a bounch of hours of work :)</p><p>Thanks</p> ]]></content:encoded> </item> <item><title>By: Adam</title><link>http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-143464</link> <dc:creator>Adam</dc:creator> <pubDate>Tue, 15 Apr 2008 00:29:18 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-143464</guid> <description>A HUGE thank you for saving me hours of time.
Just finished installing a Centos 5.1 server, and stupidly executed a CHMOD -R 770 * in the / directory.
You&#039;d be amazed at how many things that will break!  (well, I was).
This article saved me doing a rebuild.  THANK YOU!!
-Adam</description> <content:encoded><![CDATA[<p>A HUGE thank you for saving me hours of time.</p><p>Just finished installing a Centos 5.1 server, and stupidly executed a CHMOD -R 770 * in the / directory.</p><p>You&#8217;d be amazed at how many things that will break!  (well, I was).</p><p>This article saved me doing a rebuild.  THANK YOU!!</p><p>-Adam</p> ]]></content:encoded> </item> <item><title>By: Imran M Yousuf</title><link>http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-141672</link> <dc:creator>Imran M Yousuf</dc:creator> <pubDate>Sun, 11 Nov 2007 10:44:58 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-141672</guid> <description>Thanks for the tips. Will rpm --setperms`rpm -qa` work as well?</description> <content:encoded><![CDATA[<p>Thanks for the tips. Will rpm &#8211;setperms`rpm -qa` work as well?</p> ]]></content:encoded> </item> <item><title>By: vivek</title><link>http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-140941</link> <dc:creator>vivek</dc:creator> <pubDate>Wed, 29 Aug 2007 17:48:14 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-140941</guid> <description>@raj and Miguel,
Thanks for sharing your tips :)</description> <content:encoded><![CDATA[<p>@raj and Miguel,</p><p>Thanks for sharing your tips :)</p> ]]></content:encoded> </item> <item><title>By: Miguel Rozsas</title><link>http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-140940</link> <dc:creator>Miguel Rozsas</dc:creator> <pubDate>Wed, 29 Aug 2007 17:17:05 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-140940</guid> <description>I would like to add another usefull related rpm option: Verify. The verify rpm option could tell you what file was changed since it was installed.
For instance, &lt;code&gt;rpm -qV openssh&lt;/code&gt; tells you what and how the files from openssh package are different from the original installation:
&lt;code&gt;
root@bigslam:~&gt;rpm -qV openssh
S.5....T  c /etc/ssh/ssh_config
S.5....T  c /etc/ssh/sshd_config
root@bigslam:~&gt;
&lt;/code&gt;
In this case, the &lt;code&gt;c&lt;/code&gt; indicates a configuration file. The &lt;code&gt;S&lt;/code&gt; indicates the size differs, the &lt;code&gt;5&lt;code&gt; indicates a MD5SUM differs, and the &lt;code&gt;T&lt;/code&gt; indicates the mTime differs. Other characters, &lt;code&gt;MDLUG&lt;/code&gt;, could indicates the Mode differs, the Device major/minor differs, a Link differs, and the User and/or Group differs.</description> <content:encoded><![CDATA[<p>I would like to add another usefull related rpm option: Verify. The verify rpm option could tell you what file was changed since it was installed.<br
/> For instance, <code>rpm -qV openssh</code> tells you what and how the files from openssh package are different from the original installation:<br
/> <code><br
/> root@bigslam:~&gt;rpm -qV openssh<br
/> S.5....T  c /etc/ssh/ssh_config<br
/> S.5....T  c /etc/ssh/sshd_config<br
/> root@bigslam:~&gt;<br
/> </code><br
/> In this case, the <code>c</code> indicates a configuration file. The <code>S</code> indicates the size differs, the <code>5</code><code> indicates a MD5SUM differs, and the </code><code>T</code> indicates the mTime differs. Other characters, <code>MDLUG</code>, could indicates the Mode differs, the Device major/minor differs, a Link differs, and the User and/or Group differs.</p> ]]></content:encoded> </item> <item><title>By: raj</title><link>http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-140915</link> <dc:creator>raj</dc:creator> <pubDate>Tue, 28 Aug 2007 10:13:07 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/reset-rhel-centos-fedora-package-file-permission.html#comment-140915</guid> <description>nice tip. Here is how I verified by changing tar packag perms to raj:raj and again restored back the same:
&lt;pre&gt;f=`rpm -ql tar`
for p in $f; do chmod raj:raj $p; done
for p in $f; do ll $p; done
for p in `rpm -qa`; do rpm --setugids $p; done&lt;/pre&gt;
`` are back-ticks not single quotes (look under the tidle (~) character.)
babai!</description> <content:encoded><![CDATA[<p>nice tip. Here is how I verified by changing tar packag perms to raj:raj and again restored back the same:</p><pre>f=`rpm -ql tar`
for p in $f; do chmod raj:raj $p; done
for p in $f; do ll $p; done
for p in `rpm -qa`; do rpm --setugids $p; done</pre><p>&#8220; are back-ticks not single quotes (look under the tidle (~) character.)</p><p>babai!</p> ]]></content:encoded> </item> </channel> </rss>
