[SOLVED] Wrong user/group of subdir and file created in /home/usernamedir/tmp
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Script "ampli" returns text output to stdout. The content of output is ok.
But both "/home/debian/tmp" dir and "/home/debian/tmp/ampli" file have user/group - root/root. Should be debian/debian. Why is not? Any idea?
Last edited by mackowiakp; 11-10-2020 at 11:09 AM.
Of course NOT. I running it as user "debian". It is very strange for me. The same situation is when I try to create such file in /dev/shm/ (more useful for me). Can not access the file created by the script because once has root/root uid/gid.
/dev/shm/ and everything in it does belong to root. I don't understand why that is more useful, but you don't want to change the owner & group of anything in /dev. I ran your script (modified) from my home, and while it didn't entirely work because of not having packages installed, it did create the directories in my home, and they are owned by me. If you're running the script from outside your home, that may be why the directories are owned by root. Try running it as your user, from your home directory, and see what you get.
The case was cleared up. Never in my life would I have guessed the reason.
Well, due to a problem with QNAP CloudSync app, I had an open online support session with QNAP Support. As I learned from the QNAP Helpdesk, such a session causes each console session (no matter how initialized) to run it with root privileges.
And it doesn't matter that the system shows that I am a normal user and not root. Only that I do not work on the "native" QNAP partition, but in the LXC container. But according to the QNAP Helpdesk, it doesn't matter.
I don't understand it at all. Nevertheless, after disconnecting the support session, the script works fine. Complete quirk ...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.