<?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: change mode in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/change-mode/m-p/2875794#M99588</link>
    <description>Very important Unix concept: the ability to write to a file (including deleting the contents) is controlled by the FILE's permission. But the ability to delete, move or rename a file has absolutely nothing to do with the FILE's permissions.  Put it another way: the existence of a file completely depends on the permissions of the directory, not the file!&lt;BR /&gt;&lt;BR /&gt;For example, create a directory owned by root with 755 permissions. Then touch a file inside the directory and give it 666 permissions. Now as an ordinary user, you can do anything to the file EXCEPT remove it! The directory permissions control the existence, while the file permissions control the contents. Set the directory ownership to the user that can actually remove the file and you've protected the file(s).&lt;BR /&gt;&lt;BR /&gt;As mentioned the sticky bit may be set on a globally writable directory such as /tmp (normally 777 permission, set sticky with 1777 permissions) and this will disable the ability of everyone except the owner of the file from removing the file. Now the file can be 666 permissions and the contents changed by anyone but not removed (or renamed) except by the owner. This is commonly done for /tmp and /var/tmp</description>
    <pubDate>Tue, 07 Jan 2003 13:45:24 GMT</pubDate>
    <dc:creator>Bill Hassell</dc:creator>
    <dc:date>2003-01-07T13:45:24Z</dc:date>
    <item>
      <title>change mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-mode/m-p/2875786#M99580</link>
      <description>I would like to change the mode as all users can write something to this file ,  but only root can delete this file , what is the approiprate mode in this case? Thx.</description>
      <pubDate>Tue, 07 Jan 2003 07:50:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-mode/m-p/2875786#M99580</guid>
      <dc:creator>Cheung_2</dc:creator>
      <dc:date>2003-01-07T07:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: change mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-mode/m-p/2875787#M99581</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Once write bit is set on the file for all the users , anybody can also delete/overwrite that file. SO your requirement is not possible.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;U.SivaKumar</description>
      <pubDate>Tue, 07 Jan 2003 07:56:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-mode/m-p/2875787#M99581</guid>
      <dc:creator>U.SivaKumar_2</dc:creator>
      <dc:date>2003-01-07T07:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: change mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-mode/m-p/2875788#M99582</link>
      <description>Hi there&lt;BR /&gt;&lt;BR /&gt;I am not sure if I understand your question correctly.&lt;BR /&gt;&lt;BR /&gt;If you DO NOT want others to write to this file, do "chmod 755 &lt;FILENAME&gt;".&lt;BR /&gt;&lt;BR /&gt;If you WANT all users to write to this file, do "chmod 777 &lt;FILENAME&gt;"&lt;BR /&gt;&lt;BR /&gt;Then after that, login as root, do "chmod root:sys &lt;FILENAME&gt;. This will ensure only root can delete this file.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;/FILENAME&gt;&lt;/FILENAME&gt;&lt;/FILENAME&gt;</description>
      <pubDate>Tue, 07 Jan 2003 07:56:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-mode/m-p/2875788#M99582</guid>
      <dc:creator>sycncs</dc:creator>
      <dc:date>2003-01-07T07:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: change mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-mode/m-p/2875789#M99583</link>
      <description>You can control this from the permission/ownership of the directory where the file is located. For example ..&lt;BR /&gt;# cd /tmp&lt;BR /&gt;# mkdir dirA&lt;BR /&gt;# chmod 750 dirA&lt;BR /&gt;# chown root:users dirA&lt;BR /&gt;# cd /tmp/dirA&lt;BR /&gt;# touch fileA&lt;BR /&gt;# chmod 777 fileA&lt;BR /&gt;Now as normal user (assuming group ownership is "users"), fileA can be modified by anyone but cannot be deleted by anyone except root. Ignore if this is not what you're looking for.&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Jan 2003 08:06:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-mode/m-p/2875789#M99583</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2003-01-07T08:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: change mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-mode/m-p/2875790#M99584</link>
      <description>I have test it -  use root to create a file ( touch file ) , change it to 666 ( chmod 666 file ) , change the owner as root (chown root:sys file ) then everyone can modify and delete , how can I prevent users  can delete it? Thx.</description>
      <pubDate>Tue, 07 Jan 2003 08:26:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-mode/m-p/2875790#M99584</guid>
      <dc:creator>Cheung_2</dc:creator>
      <dc:date>2003-01-07T08:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: change mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-mode/m-p/2875791#M99585</link>
      <description>The case you can do here is the sticky bit.&lt;BR /&gt;&lt;BR /&gt;setting sticky bit on a file will provide a way where only the owner or the super user can delete the file.&lt;BR /&gt;&lt;BR /&gt;Create a file /tmp/a as root user and set sticky bit for the file with 777 permissions.&lt;BR /&gt;&lt;BR /&gt;That should be fine.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;chmod 1777 &lt;FILE-NAME&gt;&lt;BR /&gt;Also make sure the owner is root&lt;/FILE-NAME&gt;</description>
      <pubDate>Tue, 07 Jan 2003 09:06:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-mode/m-p/2875791#M99585</guid>
      <dc:creator>T G Manikandan</dc:creator>
      <dc:date>2003-01-07T09:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: change mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-mode/m-p/2875792#M99586</link>
      <description>Hi Manikandan,&lt;BR /&gt;&lt;BR /&gt;sticky bit wont work for regular files&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;U.SivaKumar</description>
      <pubDate>Tue, 07 Jan 2003 09:55:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-mode/m-p/2875792#M99586</guid>
      <dc:creator>U.SivaKumar_2</dc:creator>
      <dc:date>2003-01-07T09:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: change mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-mode/m-p/2875793#M99587</link>
      <description>Yes Siva Just did not think more...&lt;BR /&gt;&lt;BR /&gt;It works only for dir.&lt;BR /&gt;Then you should think of ACL's.</description>
      <pubDate>Tue, 07 Jan 2003 10:08:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-mode/m-p/2875793#M99587</guid>
      <dc:creator>T G Manikandan</dc:creator>
      <dc:date>2003-01-07T10:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: change mode</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/change-mode/m-p/2875794#M99588</link>
      <description>Very important Unix concept: the ability to write to a file (including deleting the contents) is controlled by the FILE's permission. But the ability to delete, move or rename a file has absolutely nothing to do with the FILE's permissions.  Put it another way: the existence of a file completely depends on the permissions of the directory, not the file!&lt;BR /&gt;&lt;BR /&gt;For example, create a directory owned by root with 755 permissions. Then touch a file inside the directory and give it 666 permissions. Now as an ordinary user, you can do anything to the file EXCEPT remove it! The directory permissions control the existence, while the file permissions control the contents. Set the directory ownership to the user that can actually remove the file and you've protected the file(s).&lt;BR /&gt;&lt;BR /&gt;As mentioned the sticky bit may be set on a globally writable directory such as /tmp (normally 777 permission, set sticky with 1777 permissions) and this will disable the ability of everyone except the owner of the file from removing the file. Now the file can be 666 permissions and the contents changed by anyone but not removed (or renamed) except by the owner. This is commonly done for /tmp and /var/tmp</description>
      <pubDate>Tue, 07 Jan 2003 13:45:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/change-mode/m-p/2875794#M99588</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2003-01-07T13:45:24Z</dc:date>
    </item>
  </channel>
</rss>

