![]() | ![]() | ![]() | ![]() |
|
faq search add article cool-stuff how-to main tips |
Posted by Jason on Saturday April 14, @10:55AMfrom the System-Control dept. *** Revised Post *** The sysctl utility allows you to view and set system variables. For example you can view how much memory the system has, or set the maximum number of kernel processes. I use it to give standard users the ability to mount floppy disks and cdroms. Example I To view all the sysctl parameters try: sysctl -a Example II To view how much memory is installed in your system try: sysctl | grep hw.physmem There are four steps to allowing a regular user to mount a filesystem. 1. Set the vfs.usermount variable with sysctl. 2. Set permissions for the actual device. 3. Create a mount point that the user can use for mounting the filesystem. 4. Mount the filesystem. [Set the vfs.usermount variable] Like many FreeBSD system parameters, sysctl variables are set in a configuration file in the /etc directory. In this case it's /etc/sysctl.conf. By default the vfs.usermount parameter is set to 0, by setting it to one you are allowing users to mount filesystems. Login as root and create or edit this file with your favorite editor (ee or vi). # cd /etc # ee sysctl.conf Add the statement: vfs.usermount=1 Save the file and reboot the system. [Set Permissions for the Device] In order for a user to use a device, they will need to have the read and execute permission. Here is how to set the permissions for the floppy disk drive and cdrom devices. You will need to login as root # chmod o+rx /dev/cdrom # chmod o+rwx /dev/fd0 [Create a Mount Point for the Users] Login as root, create the mount point directories and set their permissions. In order for users to mount a filesystem, they must own the mount point. You may want to have mount points in your users home directories (jason in my case). # mkdir /usr/home/jason/floppy # mkdir /usr/home/jason/cdrom # chown jason /usr/home/jason/floppy # chown jason /usr/home/jason/cdrom # chmod 775 /usr/home/jason/floppy # chmod 755 /usr/home/jason/cdrom [Mounting the filesystem] Here is how a regular user can mount a floppy diskette (msdos formatted for this example), and a cdrom (cd9660). Login: someuser Password: ******** $ mount -t cd9660 /dev/cdrom /usr/home/jason/cdrom $ mount -t msdos /dev/fd0 /usr/home/jason/floppy That's all there is to it. If you would like more information on the sysctl command, try the man pages. man sysctl < | >
|
|
||||||||||||||||||
|
||||||||||||||||||||
| "You never know how many friends you have until you own a Condo on the beach." -- Jason's Postulate |
|
| All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest ©2001 Jason Neumann. |