<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Find it and mod it in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158897#M684305</link>
    <description>Thanks to both of you! I have to add a couple things but you have me on the proper path. Thanks Guys!!!!&lt;BR /&gt;&lt;BR /&gt;Last question How would I do this and only do the entries in /home/"whoever" without using the /etc/password  ?</description>
    <pubDate>Mon, 23 Feb 2009 17:53:03 GMT</pubDate>
    <dc:creator>Adam W.</dc:creator>
    <dc:date>2009-02-23T17:53:03Z</dc:date>
    <item>
      <title>Find it and mod it</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158890#M684298</link>
      <description>Guru's,&lt;BR /&gt;   I am hopelessly lost here. I need a script that will local all initiation files like .login .cschrc .logout .profile .bash_profile and so on..... in every users home directory and execute a chown to that user, while also setting those files permissions to absolute 740. I am lost.</description>
      <pubDate>Mon, 23 Feb 2009 17:11:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158890#M684298</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2009-02-23T17:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Find it and mod it</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158891#M684299</link>
      <description>If you are using /etc/passwd &lt;BR /&gt;&lt;BR /&gt;Test whether it lists the home directories:&lt;BR /&gt;&lt;BR /&gt;for i in `cat /etc/passwd |grep bnoble |awk -F ":" '{print $6}'`;  do echo $i; done&lt;BR /&gt;&lt;BR /&gt;chmod the files:&lt;BR /&gt;&lt;BR /&gt;for i in `cat /etc/passwd |awk -F ":" '{print $6}'`;  do chmod 740 .profile;chmod 740 .bashrc ;chmod 740 .cshrc; done</description>
      <pubDate>Mon, 23 Feb 2009 17:29:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158891#M684299</guid>
      <dc:creator>T G Manikandan</dc:creator>
      <dc:date>2009-02-23T17:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: Find it and mod it</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158892#M684300</link>
      <description>Sorry no bnoble, I was testing.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;for i in `cat /etc/passwd |awk -F ":" '{print $6}'`;  do echo $i; done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;for i in `cat /etc/passwd |awk -F ":" '{print $6}'`;  do chmod 740 .profile;chmod 740 .bashrc ;chmod 740 .cshrc; done</description>
      <pubDate>Mon, 23 Feb 2009 17:30:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158892#M684300</guid>
      <dc:creator>T G Manikandan</dc:creator>
      <dc:date>2009-02-23T17:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Find it and mod it</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158893#M684301</link>
      <description>for i in `cat /etc/passwd |awk -F ":" '{print $6}'`;  do chmod 740 $i/.profile;chmod 740 $i/.bashrc ;chmod 740 $i/.cshrc; done</description>
      <pubDate>Mon, 23 Feb 2009 17:35:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158893#M684301</guid>
      <dc:creator>T G Manikandan</dc:creator>
      <dc:date>2009-02-23T17:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Find it and mod it</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158894#M684302</link>
      <description>&lt;!--!*#--&gt;Hi Adam:&lt;BR /&gt;&lt;BR /&gt;Try:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;awk -F":" '$3&amp;gt;100 {print $3,$4,$6}' /etc/passwd | \&lt;BR /&gt;    while read UID GID DIR X&lt;BR /&gt;    do&lt;BR /&gt;        chown ${UID}:$GID ${DIR}/.profile&lt;BR /&gt;        chmod 740 ${DIR}/.profile &lt;BR /&gt;       done&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;...add whatever files you need to "fix"...&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Mon, 23 Feb 2009 17:38:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158894#M684302</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-02-23T17:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Find it and mod it</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158895#M684303</link>
      <description>James, in your example where you listed&lt;BR /&gt;&lt;BR /&gt;chown ${UID}:$GID ${DIR}/.profile&lt;BR /&gt;        chmod 740 ${DIR}/.profile &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Would I simply add another line like :&lt;BR /&gt;&lt;BR /&gt;chmod 740 ${DIR}/.forward     and &lt;BR /&gt;chmod 740 ${DIR}/.ssh2    and so on? or can I list them all on the same line?</description>
      <pubDate>Mon, 23 Feb 2009 17:46:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158895#M684303</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2009-02-23T17:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: Find it and mod it</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158896#M684304</link>
      <description>You could do either.  &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 23 Feb 2009 17:49:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158896#M684304</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2009-02-23T17:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: Find it and mod it</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158897#M684305</link>
      <description>Thanks to both of you! I have to add a couple things but you have me on the proper path. Thanks Guys!!!!&lt;BR /&gt;&lt;BR /&gt;Last question How would I do this and only do the entries in /home/"whoever" without using the /etc/password  ?</description>
      <pubDate>Mon, 23 Feb 2009 17:53:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158897#M684305</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2009-02-23T17:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: Find it and mod it</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158898#M684306</link>
      <description>Hi (again) Adam:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Last question How would I do this and only do the entries in /home/"whoever" without using the /etc/password ?&lt;BR /&gt;&lt;BR /&gt;Why?  It's '/etc/password' that holds the account's location for the HOME direcotory, so that's why I used it and that's how I drove it.  &lt;BR /&gt;&lt;BR /&gt;The '/etc/password' file should be world-readable so that shoudn't be any issue.&lt;BR /&gt;&lt;BR /&gt;Notice too, that I skipped accounts with UID&amp;lt;100 since by convention these are sytsem accounts setup during a cold-install (or added later as for 'ssh').&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 23 Feb 2009 18:56:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158898#M684306</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-02-23T18:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Find it and mod it</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158899#M684307</link>
      <description>James, I only ask because we have several "generic accounts" that have a higher than 100 UID and would possibly need to be excluded, but since their home directories are listed in the /etc/passwd file, (and aren't /home/"name") I was hoping to exclude them, by only doing those accounts who's home directories reside in /home.</description>
      <pubDate>Mon, 23 Feb 2009 18:59:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158899#M684307</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2009-02-23T18:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Find it and mod it</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158900#M684308</link>
      <description>&lt;!--!*#--&gt;&amp;gt;by only doing those accounts who's home directories reside in /home.&lt;BR /&gt;&lt;BR /&gt;You could look at /home/*.  Or you could change JRF's script to look at the home directory:&lt;BR /&gt;awk -F":" '$3 &amp;gt; 100 &amp;amp;&amp;amp; index($6, "/home/") {&lt;BR /&gt;   print $3, $4, $6&lt;BR /&gt;}' /etc/passwd | \</description>
      <pubDate>Mon, 23 Feb 2009 20:52:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158900#M684308</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-02-23T20:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Find it and mod it</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158901#M684309</link>
      <description>&lt;!--!*#--&gt;Hi (again) Adam:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I only ask because we have several "generic accounts" that have a higher than 100 UID and would possibly need to be excluded.&lt;BR /&gt;&lt;BR /&gt;Given that you know the UID's of the accounts you want to exclude, just do:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;awk -F":" '{if ($3&amp;gt;100 &amp;amp;&amp;amp; $3 != 107 &amp;amp;&amp;amp; $3 != 108) {print $3,$4,$6}}' /etc/passwd | \&lt;BR /&gt;    while read UID GID DIR X&lt;BR /&gt;    do&lt;BR /&gt;        print "chown ${UID}:$GID ${DIR}/.profile"&lt;BR /&gt;    done&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;...which in this example, would exclude accounts whose UID is less than 100 along with accounts having UID=107 and UID=108.  You can form any boolean condition you need.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 23 Feb 2009 20:58:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158901#M684309</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-02-23T20:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Find it and mod it</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158902#M684310</link>
      <description>Right on James, Thanks again!!!</description>
      <pubDate>Mon, 23 Feb 2009 21:08:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-it-and-mod-it/m-p/5158902#M684310</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2009-02-23T21:08:40Z</dc:date>
    </item>
  </channel>
</rss>

