<?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: Executing command from script as root. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-command-from-script-as-root/m-p/2440628#M768992</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Actually it's root and the owner of a file that can change the permissions on a file.&lt;BR /&gt;&lt;BR /&gt;No, there is no way to do what you want without providing a password.&lt;BR /&gt;&lt;BR /&gt;Apparently, you map the root user to root by using the 'root=....' option in your /etc/exports file. This is not so good from a security point of view. The default behaviour for NFS is to map the root user to user 65534.&lt;BR /&gt;&lt;BR /&gt;Maybe you can describe exactly why you have to chmod/chgrp those files. Maybe there is a way to prevent you from having to do it.&lt;BR /&gt;&lt;BR /&gt;Bye,&lt;BR /&gt;Rik.</description>
    <pubDate>Tue, 29 Aug 2000 04:42:30 GMT</pubDate>
    <dc:creator>RikTytgat</dc:creator>
    <dc:date>2000-08-29T04:42:30Z</dc:date>
    <item>
      <title>Executing command from script as root.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-command-from-script-as-root/m-p/2440627#M768991</link>
      <description>I am having a problem with the chown/chgrp&lt;BR /&gt;commands on NFS file systems.  Apparently,&lt;BR /&gt;only root can do it correctly.&lt;BR /&gt;&lt;BR /&gt;As a result I have written a script that is&lt;BR /&gt;executing the chown/chgrp commands using the&lt;BR /&gt;following syntax:&lt;BR /&gt;&lt;BR /&gt;su root -c "/usr/bin/chown -R &lt;USER&gt;:&lt;GROUP&gt; /&lt;MYPATH&gt;/&lt;MYDIR&gt;"&lt;BR /&gt;&lt;BR /&gt;Is there a way to have this script execute&lt;BR /&gt;the command without prompting for a password?&lt;/MYDIR&gt;&lt;/MYPATH&gt;&lt;/GROUP&gt;&lt;/USER&gt;</description>
      <pubDate>Tue, 29 Aug 2000 02:50:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-command-from-script-as-root/m-p/2440627#M768991</guid>
      <dc:creator>Thomas Amwoza</dc:creator>
      <dc:date>2000-08-29T02:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Executing command from script as root.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-command-from-script-as-root/m-p/2440628#M768992</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Actually it's root and the owner of a file that can change the permissions on a file.&lt;BR /&gt;&lt;BR /&gt;No, there is no way to do what you want without providing a password.&lt;BR /&gt;&lt;BR /&gt;Apparently, you map the root user to root by using the 'root=....' option in your /etc/exports file. This is not so good from a security point of view. The default behaviour for NFS is to map the root user to user 65534.&lt;BR /&gt;&lt;BR /&gt;Maybe you can describe exactly why you have to chmod/chgrp those files. Maybe there is a way to prevent you from having to do it.&lt;BR /&gt;&lt;BR /&gt;Bye,&lt;BR /&gt;Rik.</description>
      <pubDate>Tue, 29 Aug 2000 04:42:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-command-from-script-as-root/m-p/2440628#M768992</guid>
      <dc:creator>RikTytgat</dc:creator>
      <dc:date>2000-08-29T04:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Executing command from script as root.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-command-from-script-as-root/m-p/2440629#M768993</link>
      <description>No, it is no way to su to root without providing the password. See as well: &lt;BR /&gt;&lt;A href="http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0x1dbb119c3420d411b66300108302854d,00.html" target="_blank"&gt;http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0x1dbb119c3420d411b66300108302854d,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;But, your case doesn't seem to be ok. What file system are you importing? How the export line in /etc/exports looks like?&lt;BR /&gt;&lt;BR /&gt;You can try to enable SUID bit (s permission) if you like and security is not a concern</description>
      <pubDate>Tue, 29 Aug 2000 05:19:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-command-from-script-as-root/m-p/2440629#M768993</guid>
      <dc:creator>Antoanetta Naghiu</dc:creator>
      <dc:date>2000-08-29T05:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Executing command from script as root.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-command-from-script-as-root/m-p/2440630#M768994</link>
      <description>If you want to su -c root without passwd asked the safest way is to install and configure sudo, you can dowload a version at your archive and porting center.&lt;BR /&gt;There are other alternatives but they are security breeches...&lt;BR /&gt;On which machine are you trying to chown?&lt;BR /&gt;&lt;BR /&gt;On the importing NFS FS ?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 29 Aug 2000 08:08:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-command-from-script-as-root/m-p/2440630#M768994</guid>
      <dc:creator>Victor BERRIDGE</dc:creator>
      <dc:date>2000-08-29T08:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Executing command from script as root.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-command-from-script-as-root/m-p/2440631#M768995</link>
      <description>You are probably looking at the use of sudo if you want the script to run as root with no passwd. Can be obtained from the porting archieves or from &lt;A href="http://www.courtesan.com" target="_blank"&gt;www.courtesan.com&lt;/A&gt;</description>
      <pubDate>Tue, 29 Aug 2000 12:22:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-command-from-script-as-root/m-p/2440631#M768995</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2000-08-29T12:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Executing command from script as root.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-command-from-script-as-root/m-p/2440632#M768996</link>
      <description>A would advocate using sudo for this purpose.&lt;BR /&gt;Sudo provides a number advantages. Auditing, containability,  and flexibility are the main advantages to using sudo.</description>
      <pubDate>Tue, 29 Aug 2000 13:31:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-command-from-script-as-root/m-p/2440632#M768996</guid>
      <dc:creator>Vince Inman</dc:creator>
      <dc:date>2000-08-29T13:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: Executing command from script as root.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-command-from-script-as-root/m-p/2440633#M768997</link>
      <description>Instead of su, have you considered increasing the privileges of user executing the script?  You can use setprivgrp(1M) to allow a user to change the ownership of a file that the user owns.</description>
      <pubDate>Tue, 29 Aug 2000 16:40:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-command-from-script-as-root/m-p/2440633#M768997</guid>
      <dc:creator>Richard Henriques</dc:creator>
      <dc:date>2000-08-29T16:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Executing command from script as root.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-command-from-script-as-root/m-p/2440634#M768998</link>
      <description>I have created a kind of executable file like that some years ago on HP-UX v9&lt;BR /&gt;&lt;BR /&gt;loook at the included "chmodutils"  file.&lt;BR /&gt;make changes you need, &lt;BR /&gt;put yourfile    in     /usr/sbin    directory&lt;BR /&gt;chown root yourfile , chgrp sys yourfile&lt;BR /&gt;look at man 1m chmod command&lt;BR /&gt;probably your solution will be&lt;BR /&gt;chmod 4555 yourfile&lt;BR /&gt;(set-user-id  on file execution)&lt;BR /&gt;&lt;BR /&gt;I wich attached file is well attached, it's first time I do that&lt;BR /&gt;&lt;BR /&gt;Tourlou ;-)&lt;BR /&gt;Bruno&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 30 Aug 2000 15:02:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-command-from-script-as-root/m-p/2440634#M768998</guid>
      <dc:creator>Bruno Dostie</dc:creator>
      <dc:date>2000-08-30T15:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Executing command from script as root.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-command-from-script-as-root/m-p/2440635#M768999</link>
      <description>I think that your problem is not fixable at the level you are trying to do.  The NFS server is where this script should run.  You are running this on an NFS client.  If you must run this from an NFS client, then the client must be specified with root access in the servers export list.  There are several ways to have this done in at least a semi-secure fashion.  Best to read the man pages for exportfs, but you want several things.&lt;BR /&gt;&amp;gt; exportfs /directory -root=client1,anon=0,rw=host1:host2:host3,ro=host4:host5&lt;BR /&gt;This restricts access to known hosts.  You can also use an "access=netgroup" for read-write access.&lt;BR /&gt;If root is specified in the exports file, your problem is solved.  While I use sudo for several tasks, I would not use sudo for this task.  This gives that user(s) global access then to chmod, chown, chgrp anything.  It is a root level task, which should really be done by root's cron on the server.&lt;BR /&gt;I have the same task running on one of my servers.  The only other thing to mention of this is LOG LOG LOG.  (should go without saying).&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Shannon</description>
      <pubDate>Wed, 30 Aug 2000 19:17:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-command-from-script-as-root/m-p/2440635#M768999</guid>
      <dc:creator>Shannon Petry</dc:creator>
      <dc:date>2000-08-30T19:17:04Z</dc:date>
    </item>
  </channel>
</rss>

