As a web devloper you tend to wear a lot of hats. In this case it is a Linux admin – and I use that term very very loosely. It was always about installing the latest version of Ubuntu and once it was installed sitting there and going “now what” and then I was format and install windows.
In my current job, all the web servers were running on Windows with IIS. While this isn’t necessarily bad, it’s very limiting and for things like mod-rewrite just not happening. So I convinced them to let me at least run Apache on windows which was great, but then I got greedy.
Understand, this is a Microsoft shop, and so we have Windows admins, not Linux admins. So as my greed grew and I convinced them to run Linux web servers, the admin hat fell to me. Yes, I’m over my head, but I’m slowly getting my head above the surface. I’ve made some mistakes a long the way, but through the help of good friends I’ve managed to get things in a pretty decent working order. But the fun is right around the corner and my arch nemesis is lurking in the shadows (SSL).
My latest triumph was getting proftpd up and running the way I wanted it to. It’s not terribly hard to begin with – but I did get stuck in one area Umask. It took the help of Dan Langford to get a handle on it and once you get it, it’s not so bad.
So here’s my take on it, and you kind of have to know it from the goal – I wanted to make sure directories created by the ftp user would default to 0775 and that files would default to 0664. A quick note, giving directories Execute privileges really means that someone can go inside them and see the files in the website perspective, not that you can run anything in them.
So if you look in the proftpd.conf (/etc/proftpd/proftpd.conf) you’ll notice a Umask line:
Umask 022 022
Doesn’t that make sense? Yeah to me either. So Dan had sent me some links to read, like this one that kind went over it but still left me feeling rather uncertain about what to do. Then as you read along, you find that directories start at 0777 and files start at 0666 (base mod). It does talk about some math in there like 4+2+1 = 7 and once you see how it works it does make sense, but I just wasn’t grasping it – until this. My goal for directories is 0775 which really turns into this 777 – 775 = 002, and for files it’s 0666 – 0664 = 002. Did you see that? Very simple. So if you wanted 755 as the default (actually happens to be the default for directories) it would 777 – 755 = 022. I don’t know if this is true for every installation of proftpd, but for Unbuntu 9.10 server it read dir files for my Umask looks like this:
Umask 002 002
And that is Umask dir{param} file{param}
Now when the ftp use creates a directory it automatically gets 0775 permissi0ns and the files get 0664 permissions.
What’s even more exciting? I did this all through vi and as anyone who knew me previously would know that I absolutely hated vi, but the more I dig into being a Linux admin, and tear myself away from a GUI, the more I’m finding it very easy to use.


Welcome! Glad to see another of the Ubuntu converted around. I’m still stuck with windows so I can help the people still stuck with it but I love Ubuntu.
I was also stuck with Umask, like so many things in Linux it was really so simple, I was over-thinking it.
What do you think of Webmin? Do you use it?
.-= Richard´s last blog ..Cell Phone Antenna Project =-.
That is simple more than you say, on internet you have a lot of information about it, linux is difficult, but it’s is only know about it. Then you can do that you want of one very simple way.
As an Linux user for over 10 years now, I feel very stupid in front of a windows computer. Don’t worry, when you get the hang of it, you won’t want to go back. Real servers run on Linux. Just ask Cray. :รพ
Thank you for sharing these ideas. This is helpful!
Keith´s last [type] ..Toddler Girl Bedding