File permissions on linux are traditionally Read (r), Write (w), and Execute (x) permissions associated with users and groups. Providing appropriate permissions, especially as an ordinary user, is more often complicated than we think.
Let me illustrate this with an example. User "tom" creates a file named "hoohaha" and wants to give "dick" and "harry" permissions to read and execute it. Ofc this is fairly simple if dick and harry were exclusively part on one group. What if that group dosent exist? tom will have to ask the "already overloaded" system administrator to create a group consisting of just dick and harry. This, like you can see dosent sound too good.
To overcome this limitation, Linux has implemented support for Access Control Lists (ACLs). ACLs serve as an extension to traditional Unix permissions, giving end-users the ability to specify special access rights to a file and provide desired users and groups with appropriate permissions. To use ACLs you should have at least kernel version 2.6.x (some manual steps are required with older kernel versions), a filesystem that supports ACL, and additional user tools to create, view and modify ACLs. ext3 filesystems natively support ACLs, and support can be added to ext2 filesystem by performing some additional steps. ACL support is native on RHEL5, Fedora 9, Ubuntu Fiesty and SuSE 8.1 (there would be more).
The setfacl utility sets ACLs for files and directories, and getfacl can be used to determine the existing ACLs for a file or directory. The cp and mv commands do preserve the ACLs. tar and dump dont, so use star instead.
tom $ getfacl hoohaha
# file: hoohaha
# owner: tom
# group: tom
user::rwx
group::r--
other::r--
The requirement is realized when tom sets ACLs for the file hoohaha
tom $ setfacl -m user:dick:rx hoohaha
tom $ setfacl -m user:harry:rx hoohaha
__tipped__
Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts
Wednesday, July 23, 2008
Monday, July 21, 2008
ATAD #2 - linux swap space
Swap space is used when a system requires memory greater the physical memory (RAM) available. Physical memory is divided into chunks of memory called pages. When the amount of RAM is full, a page of memory which is relatively less used is moved to a preconfigured swap space on the hard drive (HDD).
Swap space can be a dedicated swap partition (recommended), a swap file, or a combination of swap partitions and swap files. The combined sizes of the physical memory and the swap space constitute the amount of virtual memory available.
RedHat recommends swap size be equal to 2x physical RAM for up to 2 GB of physical RAM, and then an additional 1x physical RAM for any amount above 2 GB, but never less than 32 MB.
So, if:
M = Amount of RAM in GB, and S = Amount of swap in GB, then
If M < 2
then
S = M * 2
else
S = M + 2
fi
However, if you think you will be upgrading the RAM sometime in the near future, consider the total amount of RAM you would be having after your upgrade and decide on the swap space during install time. swap space can also be altered post installation by
1. creating a new swap partition
# lvm lvcreate -n -L (size_in_mb)M
2. creating a new swap file
# dd if=/dev/zero of=/swapfile bs=1024 count=(size)
3. extend swap on an existing logical volume (recommended)
# lvm lvresize (lvol) -L +(size_in_mb)M
Remember to boot the system in rescue mode before altering the swap space as the swap space can not be in used when being modified.
Further reading: swapoff, mkswap, swapon
__tipped__
Swap space can be a dedicated swap partition (recommended), a swap file, or a combination of swap partitions and swap files. The combined sizes of the physical memory and the swap space constitute the amount of virtual memory available.
RedHat recommends swap size be equal to 2x physical RAM for up to 2 GB of physical RAM, and then an additional 1x physical RAM for any amount above 2 GB, but never less than 32 MB.
So, if:
M = Amount of RAM in GB, and S = Amount of swap in GB, then
If M < 2
then
S = M * 2
else
S = M + 2
fi
However, if you think you will be upgrading the RAM sometime in the near future, consider the total amount of RAM you would be having after your upgrade and decide on the swap space during install time. swap space can also be altered post installation by
1. creating a new swap partition
# lvm lvcreate
2. creating a new swap file
# dd if=/dev/zero of=/swapfile bs=1024 count=(size)
3. extend swap on an existing logical volume (recommended)
# lvm lvresize (lvol) -L +
Remember to boot the system in rescue mode before altering the swap space as the swap space can not be in used when being modified.
Further reading: swapoff, mkswap, swapon
__tipped__
Saturday, March 29, 2008
Why we use Linux
Vlad Dolezal blogs about "Why we use Linux"
I can't agree any lesser.
Since the day i migrated to this brighter face of the planet, ive been spending more fun, 1 on 1 time with my computer in tweaking stuff to my likes. Of course there were the troughs with undesired effects, but recovering from them and bringing about the desired change was a cherished learning experience by itself.
Open up and live free.
We tell people we use Linux because it's secure. Or because it's free, because it's customizable, because it's free (the other meaning), because it has excellent community support...
But all of that is just marketing bullshit. We tell that to non-Linuxers because they wouldn't understand the real reason. And when we say those false reasons enough, we might even start to believe them ourselves.
But deep underneath, the real reason remains.
We use Linux because it's fun!
I can't agree any lesser.
Since the day i migrated to this brighter face of the planet, ive been spending more fun, 1 on 1 time with my computer in tweaking stuff to my likes. Of course there were the troughs with undesired effects, but recovering from them and bringing about the desired change was a cherished learning experience by itself.
Open up and live free.
Sunday, August 26, 2007
Ubuntu'd and luvin it
More experiments with Ubuntu are up on Gadget7 and you can check it out here
For sheer expandability and customization, im totally addicted to this OS. This is fun :)
For sheer expandability and customization, im totally addicted to this OS. This is fun :)
Thursday, July 26, 2007
Rough tide leads to pleasant discovery
The last month was a period of experiments with my computer, starting with the fact that I was running on a ‘going to break’ HDD and the DST short test was failing repeatedly. So before anything, I backed up all my data (which also includes my windows partition) after running openSUSE in recovery mode; and trust me it was quite a breeze, reinforcing my crush on Linux. Later that day I called DELL support and they promptly shipped me a replacement hard drive one working day later, but the OEM OS that id also asked them to ship was going to take a few days longer as the package which includes WinXP, device drivers, sonic, win backup and a few others were flying in from Netherlands. Nevertheless I was happy with their prompt and ‘no questions asked’ service, afterall I guess ive already paid them quite a sum when I took the 3 yr complete care support for my inspiron 6400.
A few months before this day I had installed the vista transformation pack just to see what the hype was all about. Must say, I was impressed by the freshness it gave to the aeging, yet stable XP. So I decided to head to the nearest and dearest electronics shop to get the Vista Home Premium. I like the way it installed, M$soft finaly decided to keep it simple and voila!! I also have my disk management utility inbuilt right into the installer, and without second thought retained 20gigs of free space for Linux. Two weeks passed and I liked the way vista felt, till I realized that I need more memory for what started to seem like a dying computer. I think I can quite easily point the finger at vista that required ~500 MB just to boot and get running. I ‘tried’ installing Halo for vista, and not to my surprise it didn’t quite go on well. You already get the picture, don’t you? Nevertheless 2Gigs of memory is on its way..
A jobless Sunday afternoon, and what more could I do when I find the ubuntu feisty fawn media lying around, 10GB of free space and a geeky mind. No prizes for guessing right, im now happily ubutun’d with a fresh and functional desktop. And here is a trailer of what could be done with Ubuntu and Beryl
Tell me that you still aren’t impresses by just the eye candy, and then here is more from a functionality pov. The ubuntu installation is done with a couple of user inputs that loads off a Live CD making life much easier, then comes the best part, the apt-get application is used to install any application from the command prompt, all u need to know is the name of the application and a simple `apt-get app_name` will look for the application online, download it, resolve dependencies and install the app. Ive got two words, “luvin it”
Next adventure would be tweaking and compiling the G15 drivers to get my Logitech Z10 working, and then Vmware to get virtual servers running. More later …
Live free, or die.
Linux!!
A few months before this day I had installed the vista transformation pack just to see what the hype was all about. Must say, I was impressed by the freshness it gave to the aeging, yet stable XP. So I decided to head to the nearest and dearest electronics shop to get the Vista Home Premium. I like the way it installed, M$soft finaly decided to keep it simple and voila!! I also have my disk management utility inbuilt right into the installer, and without second thought retained 20gigs of free space for Linux. Two weeks passed and I liked the way vista felt, till I realized that I need more memory for what started to seem like a dying computer. I think I can quite easily point the finger at vista that required ~500 MB just to boot and get running. I ‘tried’ installing Halo for vista, and not to my surprise it didn’t quite go on well. You already get the picture, don’t you? Nevertheless 2Gigs of memory is on its way..
A jobless Sunday afternoon, and what more could I do when I find the ubuntu feisty fawn media lying around, 10GB of free space and a geeky mind. No prizes for guessing right, im now happily ubutun’d with a fresh and functional desktop. And here is a trailer of what could be done with Ubuntu and Beryl
Tell me that you still aren’t impresses by just the eye candy, and then here is more from a functionality pov. The ubuntu installation is done with a couple of user inputs that loads off a Live CD making life much easier, then comes the best part, the apt-get application is used to install any application from the command prompt, all u need to know is the name of the application and a simple `apt-get app_name` will look for the application online, download it, resolve dependencies and install the app. Ive got two words, “luvin it”
Next adventure would be tweaking and compiling the G15 drivers to get my Logitech Z10 working, and then Vmware to get virtual servers running. More later …
Live free, or die.
Linux!!
Thursday, November 30, 2006
linuxed !!
Joblessly sittin and watchin tv post mindnight. Thought id might as well spend the sleepless night and do somethin productive. Rbered that i got the ubuntu media a few days back. Ok, good thing to start off with. did the needed partitions and linuxed the lappy. Its 2am now and all excided. It came with OpenOffice as well, neat, but missed the windows fonts, but no issues, simple solution ..
sudo apt-get install msttcorefontscd /homewget http://www.auriance.com/docs/fonts/fontconfig.tbz
tar -xvjpf fontconfig.tbz
ok.. done, and now thought id set up the networking , figgerd out that ubuntu is built on Debian. now i have no clue as to where to start fiddling arnd, so ditched that and reserved it for the last. All devices were funtioning fine and so was yappy.
remote logged into the office, xterm, clearcase, clearmake .. eyerythin works. cool.. and then ...
% make love
Make: Don't know how to make love. Stop.
crashed into bed. eod.
sudo apt-get install msttcorefontscd /homewget http://www.auriance.com/docs/fonts/fontconfig.tbz
tar -xvjpf fontconfig.tbz
ok.. done, and now thought id set up the networking , figgerd out that ubuntu is built on Debian. now i have no clue as to where to start fiddling arnd, so ditched that and reserved it for the last. All devices were funtioning fine and so was yappy.
remote logged into the office, xterm, clearcase, clearmake .. eyerythin works. cool.. and then ...
% make love
Make: Don't know how to make love. Stop.
crashed into bed. eod.
Subscribe to:
Posts (Atom)