Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Tq for ur promptly feedback.But how to makesure that this /cheng cannot access by other user?I log in by using root but i still can go to cheng and view all the directory and file.
Tq for ur promptly feedback.But how to makesure that this /cheng cannot access by other user?I log in by using root but i still can go to cheng and view all the directory and file.
HI
i want umount the file system /cheng in /dev/hda1.I did use umount /cheng command to umount.But how to makesure that this /cheng cannot access by other user?I log in by using root but i still can go to cheng and view all the directory and file.
Tq for ur promptly feedback.But how to makesure that this /cheng cannot access by other user?I log in by using root but i still can go to cheng and view all the directory and file.
I think root has total control of the system, so I'm not sure if you can block "superuser" from anything. However, If you want to restrict others from accessing your "/cheng" directory, then you should add other users to your system. Read the man pages for chmod, adduser, addgrp. Restrict groups or user accounts from accessing /cheng by using chmod:
quick chmod lesson:
r-w-x= full access
4+2+1= 7
if you want to remove write access which is w, subtract the 2 and add the rest of the numbers and you have "5"
r - w - x= full access
4+2+1= 7 - 2= 5
This is the number you remove the 2 to get the sum of 5.
So 4 corresponds to r "read", 2 corresponds to w "write, 1 corresponds to x "execute". r-w-x= 7, r-w=5 ,r--=4, ---=0
chmod 755 filename
7 corresponds to the owner of the file, 5 corresponds to the group, 5 corresponds to everyone else.
I hope this helped you.
Last edited by marxist1984; 03-20-2005 at 12:40 AM.
[QUOTE]Originally posted by marxist1984 I think root has total control of the system, so I'm not sure if you can block "superuser" from anything. However, If you want to restrict others from accessing your "/cheng" directory, then you should add other users to your system. Read the man paged for chmod, adduser, addgrp. Restrict groups or user accounts from accessing /cheng by using chmod:
quick chmod lesson:
r-w-x= full access
4+2+1= 7
if you want to remove write access which in "w" subtract the 2 and add the rest of the numbers and you have "5"
r - w - x= full access
4+2+1= 5
^
This is the number you remove the 2 to get the sum of 5.
So 4 corresponds to r "read", 2 corresponds to w "write, 1 corresponds to x "execute". r-w-x= 7, r-w=5 ,r--=4, ---=0
chmod 755 filename
7 corresponds to the owner of the file, 5 corresponds to the group, 5 corresponds to everyone else.
User will not have access to the information that was mounted previous to your unmounting of the drive. Also make sure to cd out of the mount point directory, or else umount will complain that the directory/device is busy.
Last edited by marxist1984; 03-20-2005 at 12:44 AM.
Distribution: #1 PCLinuxOS -- for laughs -> Ubuntu, Suse, Mepis
Posts: 315
Rep:
Well .. it's not clear what you are saying, do you want to mount or unmount?
Etiher way,
first thing - you shouldn't mount/unmount file systems under "/" .. put them under /mnt/cheng .. that's generally advisable .. though there is no technical reason for it .. just to keep the root level directory clean.
The other problem you have is related to what's in your /etc/fstab .. any filesystem described there can be mounted/unmounted by giving out either it's mount point or
the device (or fs name) .. and it can be done by any user if "user" is set in the filed or can be automounted at boot .
do "man mount" and it should show you .. check out the man entry (if it exists) for "fstab" also ..
Second .. in Unix root is like a god, it can do ANYTHING .. and that includes reading anyones files and folder.
Luckily these days a new things is avaiable that "root" can't figure out .. its to use encryption .. 2.6 kernel comes with it .. you have to enable it on the file systems or files.
and each user can do it .. root can still mount/unmount the fs but it can't figure out the data.
unmount a file system? as far as my knowledge goes u don't unmount a file system, you can unmount a partition or a drive like floppy drive or cdrom drive.
I suppose u don't want /dev/hda1 to be seen when u log in as root . so just say umount /dev/hda1.I suppose you are rebooting the system before loging as root?in that case check your fstab file(/etc/fstab) and under the options coloumn give noauto command. go to the man page for further details.man umount
You could also add a group with the same name as your username. Then 'chgrp <groupname> /cheng will make you both the owner and group owner. Then make sure the the 'other' attributes are cleared for the partition: 'chmod o-wrx' .
Doing this another user will not be able to even enter the directory.
If this parition was a FAT32 partition, you could have added the options 'uid=cheng' and 'gid=cheng'. Because the VFAT filetype (FAT32 partitions) is not a unix/linux file system, you need to set the owner and group owner when the partition is being mounted. You would also need to set the default permissions in the mount statement also, with the 'umask=' option. However, I prefer using the 'fmask' and 'dmask' options instead of the 'umask' option.
You might want to read the 'man mount' page. Reading through the 'info coreutils' would be a good idea also.
Try this in the konqueror web browser! Enter in the address bar: info:coreutils
You may find this easier to read through.
Unmounting the filesystem means that you can't access the files. You mount the filesystem to be able to see the files on the device.
By the way, it sounds like you are using the root account for everyday functions. VERY bad idea. Like marxist1984 said, read the man pages for chmod, adduser, addgrp by doing:
Code:
# man chmod
--or--
# man adduser
--or--
# man addgrp
One typo while working at the command line as root can wipe your whole hard disk i.e.
In my fstab i edit it like this
/dev/hda1 /cheng ext3 noauto 1 2
If the /dev/hda1 is no mounted,what will be happen?
What i want is when the user log in his/her username,then he/she only can access to their home directory,they can not go to other directory.How to do it?
Quote:
Originally posted by bitt_u unmount a file system? as far as my knowledge goes u don't unmount a file system, you can unmount a partition or a drive like floppy drive or cdrom drive.
I suppose u don't want /dev/hda1 to be seen when u log in as root . so just say umount /dev/hda1.I suppose you are rebooting the system before loging as root?in that case check your fstab file(/etc/fstab) and under the options coloumn give noauto command. go to the man page for further details.man umount
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.