How can I mount a tmpfs to /tmp via fstab, writable to anyone?











up vote
1
down vote

favorite












I want to mount a tmpfs to /tmp and make it writable to users (or a specific user). The machine is a Raspberry Pi 3 with Debian 8.0 (Raspian). Whatever I try, /tmp is always mounted with permissions only for root.



I've tried the following fstab entries:



tmpfs           /tmp            tmpfs   nosuid,nodev,noatime   0       0
tmpfs /tmp tmpfs nosuid,nodev,noatime,user,uid=1000,gid=1001,mode=1777 0 0


This always results in the following permissions:



$ ls -alh /tmp
total 36K
drwxr-xr-x 14 root root 500 Jul 19 10:17 .


But if I mount a tmpfs to any other location instead of /tmp (eg. /var/opt), it is writable to everyone:



$ ls -alh /var/opt
total 4.0K
drwxrwxrwt 2 root root 40 Jul 3 12:18 .


How can I mount a tmpfs to /tmp so that it is writable to everyone?



Output of mount:



tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime)
tmpfs on /var/opt type tmpfs (rw,nosuid,nodev,relatime)


If mounted with all the uid, gid and mode options:



tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noexec,noatime,uid=1000,gid=1001)


Edit: Does any Linux service set permissions to 755 on the /tmp directory on boot? Because these permissions are set even if I just symlink /tmp to /var/opt, which by itself was writable to anyone. After booting with a symlink from /tmp to /var/opt, the permissions on /var/opt are set to 755.










share|improve this question




























    up vote
    1
    down vote

    favorite












    I want to mount a tmpfs to /tmp and make it writable to users (or a specific user). The machine is a Raspberry Pi 3 with Debian 8.0 (Raspian). Whatever I try, /tmp is always mounted with permissions only for root.



    I've tried the following fstab entries:



    tmpfs           /tmp            tmpfs   nosuid,nodev,noatime   0       0
    tmpfs /tmp tmpfs nosuid,nodev,noatime,user,uid=1000,gid=1001,mode=1777 0 0


    This always results in the following permissions:



    $ ls -alh /tmp
    total 36K
    drwxr-xr-x 14 root root 500 Jul 19 10:17 .


    But if I mount a tmpfs to any other location instead of /tmp (eg. /var/opt), it is writable to everyone:



    $ ls -alh /var/opt
    total 4.0K
    drwxrwxrwt 2 root root 40 Jul 3 12:18 .


    How can I mount a tmpfs to /tmp so that it is writable to everyone?



    Output of mount:



    tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime)
    tmpfs on /var/opt type tmpfs (rw,nosuid,nodev,relatime)


    If mounted with all the uid, gid and mode options:



    tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noexec,noatime,uid=1000,gid=1001)


    Edit: Does any Linux service set permissions to 755 on the /tmp directory on boot? Because these permissions are set even if I just symlink /tmp to /var/opt, which by itself was writable to anyone. After booting with a symlink from /tmp to /var/opt, the permissions on /var/opt are set to 755.










    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I want to mount a tmpfs to /tmp and make it writable to users (or a specific user). The machine is a Raspberry Pi 3 with Debian 8.0 (Raspian). Whatever I try, /tmp is always mounted with permissions only for root.



      I've tried the following fstab entries:



      tmpfs           /tmp            tmpfs   nosuid,nodev,noatime   0       0
      tmpfs /tmp tmpfs nosuid,nodev,noatime,user,uid=1000,gid=1001,mode=1777 0 0


      This always results in the following permissions:



      $ ls -alh /tmp
      total 36K
      drwxr-xr-x 14 root root 500 Jul 19 10:17 .


      But if I mount a tmpfs to any other location instead of /tmp (eg. /var/opt), it is writable to everyone:



      $ ls -alh /var/opt
      total 4.0K
      drwxrwxrwt 2 root root 40 Jul 3 12:18 .


      How can I mount a tmpfs to /tmp so that it is writable to everyone?



      Output of mount:



      tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime)
      tmpfs on /var/opt type tmpfs (rw,nosuid,nodev,relatime)


      If mounted with all the uid, gid and mode options:



      tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noexec,noatime,uid=1000,gid=1001)


      Edit: Does any Linux service set permissions to 755 on the /tmp directory on boot? Because these permissions are set even if I just symlink /tmp to /var/opt, which by itself was writable to anyone. After booting with a symlink from /tmp to /var/opt, the permissions on /var/opt are set to 755.










      share|improve this question















      I want to mount a tmpfs to /tmp and make it writable to users (or a specific user). The machine is a Raspberry Pi 3 with Debian 8.0 (Raspian). Whatever I try, /tmp is always mounted with permissions only for root.



      I've tried the following fstab entries:



      tmpfs           /tmp            tmpfs   nosuid,nodev,noatime   0       0
      tmpfs /tmp tmpfs nosuid,nodev,noatime,user,uid=1000,gid=1001,mode=1777 0 0


      This always results in the following permissions:



      $ ls -alh /tmp
      total 36K
      drwxr-xr-x 14 root root 500 Jul 19 10:17 .


      But if I mount a tmpfs to any other location instead of /tmp (eg. /var/opt), it is writable to everyone:



      $ ls -alh /var/opt
      total 4.0K
      drwxrwxrwt 2 root root 40 Jul 3 12:18 .


      How can I mount a tmpfs to /tmp so that it is writable to everyone?



      Output of mount:



      tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime)
      tmpfs on /var/opt type tmpfs (rw,nosuid,nodev,relatime)


      If mounted with all the uid, gid and mode options:



      tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noexec,noatime,uid=1000,gid=1001)


      Edit: Does any Linux service set permissions to 755 on the /tmp directory on boot? Because these permissions are set even if I just symlink /tmp to /var/opt, which by itself was writable to anyone. After booting with a symlink from /tmp to /var/opt, the permissions on /var/opt are set to 755.







      linux raspberry-pi






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jul 20 '16 at 10:49

























      asked Jul 20 '16 at 10:38









      Chris Hager

      613




      613






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          My tmpfs setting is:



          tmpfs           /tmp            tmpfs   rw,mode=1777,size=12g


          The sizing is for a system with much more memory and swap that you are likely to have. noatime or relatime shouldn't matter as the inodes will be memory structures and unlikely to be written to disk. tmpfs is paged out to swap if necessary.



          The permissions of 755 on /tmp are likely the default permissions on the mount point. The traditional permissions are 1777 allowing anyone to create files, but securing them from manipulation by other users.






          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1103101%2fhow-can-i-mount-a-tmpfs-to-tmp-via-fstab-writable-to-anyone%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            My tmpfs setting is:



            tmpfs           /tmp            tmpfs   rw,mode=1777,size=12g


            The sizing is for a system with much more memory and swap that you are likely to have. noatime or relatime shouldn't matter as the inodes will be memory structures and unlikely to be written to disk. tmpfs is paged out to swap if necessary.



            The permissions of 755 on /tmp are likely the default permissions on the mount point. The traditional permissions are 1777 allowing anyone to create files, but securing them from manipulation by other users.






            share|improve this answer

























              up vote
              0
              down vote













              My tmpfs setting is:



              tmpfs           /tmp            tmpfs   rw,mode=1777,size=12g


              The sizing is for a system with much more memory and swap that you are likely to have. noatime or relatime shouldn't matter as the inodes will be memory structures and unlikely to be written to disk. tmpfs is paged out to swap if necessary.



              The permissions of 755 on /tmp are likely the default permissions on the mount point. The traditional permissions are 1777 allowing anyone to create files, but securing them from manipulation by other users.






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                My tmpfs setting is:



                tmpfs           /tmp            tmpfs   rw,mode=1777,size=12g


                The sizing is for a system with much more memory and swap that you are likely to have. noatime or relatime shouldn't matter as the inodes will be memory structures and unlikely to be written to disk. tmpfs is paged out to swap if necessary.



                The permissions of 755 on /tmp are likely the default permissions on the mount point. The traditional permissions are 1777 allowing anyone to create files, but securing them from manipulation by other users.






                share|improve this answer












                My tmpfs setting is:



                tmpfs           /tmp            tmpfs   rw,mode=1777,size=12g


                The sizing is for a system with much more memory and swap that you are likely to have. noatime or relatime shouldn't matter as the inodes will be memory structures and unlikely to be written to disk. tmpfs is paged out to swap if necessary.



                The permissions of 755 on /tmp are likely the default permissions on the mount point. The traditional permissions are 1777 allowing anyone to create files, but securing them from manipulation by other users.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jul 20 '16 at 13:49









                BillThor

                8,68421718




                8,68421718






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1103101%2fhow-can-i-mount-a-tmpfs-to-tmp-via-fstab-writable-to-anyone%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Plaza Victoria

                    Puebla de Zaragoza

                    Musa