Slackware This Forum is for the discussion of Slackware Linux.
|
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
01-23-2014, 04:43 PM
|
#1
|
Member
Registered: Jan 2014
Posts: 81
Rep:
|
What are the Slackware Defaults for fstab
Hi guys,
So in my initial installation of Slackware, I mounted my Windows (NTFS) partition as read-only except for root. The fstab had the following for the NTFS partition:
/dev/sda2 /ntfs ntfs-3g fmask=133,dmask=022 1 0
And normal partitions had the following:
/dev/sda6 /home ext4 defaults 1 2
I tried to edit fstab in order to mount it read-write, and given the settings for /dev/sda6, I did the following:
/dev/sda2 /ntfs ntfs-3g defaults 1 0
However, this didn't have the intended effects. /dev/sda2 was not mounted read-write. I know how to edit the settings in order to mount it read-write, but I am wondering why changing it to defaults did not work.
What are the defaults in Slackware, and how could I have figured that out in the command line?
Thanks!
P.S., this is what I currently have in the fstab for the NTFS partition:
/dev/sda2 /ntfs ntfs-3g rw,suid,dev,exec,auto,user,async 1 0
|
|
|
01-23-2014, 04:47 PM
|
#2
|
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,255
Rep:
|
Code:
/dev/sda2 /ntfs ntfs-3g fmask=111,dmask=000 1 0
FYI this is how Slackware installer set it up if you request R/W for everyone:
Code:
dialog --backtitle "Setting permissions on NTFS partition $NEW_DIR" \
--title "SET SECURITY FOR NTFS PARTITION $NEW_DIR" \
--default-item "fmask=177,dmask=077" \
--menu "Because users could go snooping through (or destroy, depending on \
the settings) your Windows partition, you should choose how much access would you \
like your non-root users to have to partition $NEW_DIR. The access level can \
range from no access at all, to read-only for everyone, to read-write access \
for every user on the machine. A reasonable default (read-write for root only) \
is chosen, but you may set this any way that you like." \
18 77 4 \
"fmask=177,dmask=077" "Root has read/write access, users have no access (ntfs-3g)" \
"fmask=333,dmask=222" "Everyone has read only access (built-in kernel ntfs driver)" \
"fmask=133,dmask=022" "Everyone has read access, but only root can write (ntfs-3g)" \
"fmask=111,dmask=000" "All users can read/write to any file (ntfs-3g)" \
2> $TMP/ntfs_security
PS I almost forgot: Hi, and welcome to LQ.
Last edited by Didier Spaier; 01-23-2014 at 04:59 PM.
|
|
2 members found this post helpful.
|
01-23-2014, 05:01 PM
|
#3
|
Member
Registered: May 2009
Distribution: Slackware64-14.1
Posts: 138
Rep:
|
@Didier Spaier: my fstab uses "umask=000" for ntfs partitions. Which is the difference using user mask (umask) instead of file and directory masks (fmask and dmask)?
|
|
|
01-23-2014, 05:08 PM
|
#4
|
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,255
Rep:
|
Quote:
Originally Posted by neymac
@Didier Spaier: my fstab uses "umask=000" for ntfs partitions. Which is the difference using user mask (umask) instead of file and directory masks (fmask and dmask)?
|
Here is what says man ntfs-3g:
Code:
OPTIONS
Below is a summary of the options that ntfs-3g accepts.
uid=value and gid=value
Set the owner and the group of files and directories. The values are numerical. The
defaults are the uid and gid of the current process.
umask=value
Set the bitmask of the file and directory permissions that are not present. The value is
given in octal. The default value is 0 which means full access to everybody.
fmask=value
Set the bitmask of the file permissions that are not present. The value is given in
octal. The default value is 0 which means full access to everybody.
dmask=value
Set the bitmask of the directory permissions that are not present. The value is given in
octal. The default value is 0 which means full access to everybody.
So somehow umask=0 is equivalent to dmask=0 and fmask=0.
|
|
1 members found this post helpful.
|
01-23-2014, 05:22 PM
|
#5
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep:
|
|
|
|
01-23-2014, 06:30 PM
|
#6
|
Member
Registered: Jan 2014
Posts: 81
Original Poster
Rep:
|
Thank you very much for all the input. (I certainly learned something new - which is my goal in switching to Slackware).
I think I might have confused people with all the information I offered.
My question is as follows:
fstab contains the following "/dev/sda6 /home ext4 defaults 1 2". What are the options set to when a user specifies that fstab should use the 'defaults' setting?
P.S. @Habitual - I like your signature.
|
|
|
01-23-2014, 07:23 PM
|
#7
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep:
|
Quote:
Originally Posted by StevenXL
What are the options set to when a user specifies that fstab should use the 'defaults' setting?
|
Users don't specify anything in /etc/fstab.
You, as an administrator, can set the options for a particular user, but they themselves do not have control over it.
I'm not sure that regular users can even issue a mount without elevated privileges (an explicit directive in sudoers)...
If allowed (sudo privs) a user can mount using the -o <option> -o <option> (multiples are ok) eg:
Code:
mount -t ntfs-3g /dev/sda2 ~/Windows -o rw -o dmask=022 -o fmask=133 0 0
assuming the user has made a ~/Windows mount point.
man ntfs-3g shows:
Code:
Access Handling and Security
By default, files and directories are owned by the effective user and group of the mounting process, and everybody
has full read, write, execution and directory browsing permissions. You can also assign permissions to a single
user by using the uid and/or the gid options together with the umask, or fmask and dmask options.
So for example:
as root, I check the zabbix user's ID with
and I get
Code:
uid=101(zabbix) gid=156(zabbix) groups=156(zabbix)
I'd instruct the user, or create a script to use
Code:
mount -t ntfs-3g /dev/sda2 ~/Windows -o rw -o dmask=022 -o fmask=133 0 0
That should allow the <user> to mount with Read/Write privs and honor Linux file and directory permissions (files=644 and directories=755)
the uid stuff in /etc/fstab for the above user <zabbix> could be
Code:
/dev/sda2 /home/zabbix/Windows ntfs-3g rw,uid=101,gid=156,dmask=022,fmask=133 0 0
See http://linux.die.net/man/8/ntfs-3g
I probably got some of that wrong, but fortunately, there are better people than I at explaining this stuff. (also a "we" thing)
I don't get out much and live in a terminal.
Edit: "defaults" are conservative, probably to save the system from its users?
Subscribed with interest...
Last edited by Habitual; 01-23-2014 at 07:29 PM.
|
|
|
01-23-2014, 07:47 PM
|
#8
|
Member
Registered: Jan 2014
Posts: 81
Original Poster
Rep:
|
Thank you very much for your continued response Habitual. It is all very helpful and informative. However, it is not what I am looking for, so I will try to rephrase the question for others.
Ubuntu has a page that delineates what the defaults are ( https://help.ubuntu.com/community/Fstab).
Specifically, it reads: defaults = rw, suid, dev, exec, auto, nouser, and async.
What I would like to know is what are the defaults in Slackware.
What are the options being passed to mount when it finds the following line in fstab:
/dev/sda2 /ntfs ntfs-3g defaults 1 0
Thanks guys!
|
|
|
01-23-2014, 07:52 PM
|
#9
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep:
|
Quote:
Originally Posted by StevenXL
Thank you very much for your continued response Habitual. It is all very helpful and informative. However, it is not what I am looking for, so I will try to rephrase the question for others.
|
and I'll butt out.
|
|
|
01-23-2014, 09:20 PM
|
#10
|
Member
Registered: Oct 2012
Location: Germany
Distribution: Slackware, Salix, slarm64
Posts: 212
Rep:
|
Quote:
Originally Posted by StevenXL
What are the options being passed to mount when it finds the following line in fstab:
/dev/sda2 /ntfs ntfs-3g defaults 1 0
|
As you can see in the manpage for "mount", the defaults in Slackware are the same as in Ubuntu:
Code:
$ man mount
...
defaults
Use default options: rw, suid, dev, exec, auto, nouser, and
async.
...
Last edited by slacksam; 01-23-2014 at 09:23 PM.
|
|
|
01-23-2014, 09:39 PM
|
#11
|
Member
Registered: Jan 2014
Posts: 81
Original Poster
Rep:
|
@slackslam,
Thank you. I feel like a dummy. :-(
Quote:
Originally Posted by slacksam
As you can see in the manpage for "mount", the defaults in Slackware are the same as in Ubuntu:
Code:
$ man mount
...
defaults
Use default options: rw, suid, dev, exec, auto, nouser, and
async.
...
|
|
|
|
All times are GMT -5. The time now is 11:55 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|