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.
I have installed a new command line utility. I downloaded it and compiled it successfully, and have made a symbolic link from my home/bin directory to the exectuable. I have (as root) done:
chmod 777 /tmp/
but when I run the new program (as me), it doesn't work:
[bananaman@servername]dosomething -h
Couldn't create temporary file in /tmp/
I don't understand this because surely if I anyone can write in that directory? I have checked:
Dunno if it's simple. What app are you trying to run?
AFAIK /tmp needs the sticky bit: chmod 1777 /tmp
If that ain't doin it, and you're damn sure you got all the required configs, supplied the right flags, files and whatnot, (and double checked it all) then I'd run a strace on it: "strace -v -o <logfile> <dosomething flags, etc etc>", then peruse <logfile> for errors. If unsure, post here.
Ok. I've solved it now. I think it was the chmod 1777 that did the trick. Thanks.
Just out of interest, is it best practice to solve this type of problem in this way? I mean, surely it is not good to have any directories that anyone can read or write anything in?
Yes, anyone can read, but if you're exporting a sane umask from /etc/profile no other user should be able to write to your files.
If you're concerned with having a public tempdir, you change it so every human user uses it's ~/tmp in /etc/profile, like:
# Assert UID for human user accounts on not heavily populated boxen starts at 500:
if [ "${UID}" -gt "500" ]; then
TMP="$HOME/tmp"; TMPDIR=${TMP}; export TMP TMPDIR
fi
Watch out for unprivileged system user UID's >500 tho.
AFAIK there's also a PAM module out there that handles tmpdir creation.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.