0

Task: "You have to configure the /home's filesystem-mounting-method in such a way, so that all I/O operations will be always done in a synchronic mode, without the possibility of using the SUID authorisation. The mount options' changes must be done so that they would still remain in place after rebooting. Then you have to remount the filesystem so that the changes will be "activated" without the need for the system reboot.

(Hinted commands and directories to be used: mount -o remount, fuser, sync, /proc/mounts, /etc/fstab)"

After long thinking I've only managed to come up with:

[root ~]# mount -o remount,sync,nosuid /dev/mapper/fedora_12345-home

(Where the "/dev/mapper/fedora_12345-home" is the file system found with the "df /home" command.)

But there was no message after this command, so I can't determine if I done it right. Did I do (the part of the task) right?

What other commands/modifications to files do I have to do? (And which commands should I use to confirm I've done things right?)

  • At least in Bash you can check value of $? variable after issuing a command. If it's 0 (zero) it means it succeeded. Normally in *nix world commands that succeeded don't print anything unless verbose mode is used. – Arkadiusz Drabczyk Apr 25 '15 at 11:01
1

Usually mount will print an error if there is one, otherwise it prints nothing.

However if you type the mount command without any options it will print out a description of all mounted filesystems, including the mount options.

Alternatively, you could try creating a setuid binary:

[root@xxxlin01 jad87]# cp /usr/bin/passwd /home/jad87
[root@xxxlin01 jad87]# chmod u+s passwd
[root@xxxlin01 jad87]# ll passwd
-rwsr-xr-x 1 root 90328 30768 Apr 25 06:58 passwd

And seeing if it works on that filesystem. sync might be a little trickier but I would assume that if setuid restrictions are in effect, sync probably is as well.

To make them permanent you have to update /etc/fstab as well.

  • Did I miss some requirements with the command+options I used? And I didn't use fuser command in any part of my code. How should I use it here? And how do I update the /etc/fstab? Do I use some command, or do I have to make some modifications to it with a text editor? (If so, what modifications?) And then there's the /proc/mounts directiory amongst the hinted-locations-to-be-used -- do I modify it too, or is it there for me to display its contents to confirm the changes? – dziadek1990 Apr 25 '15 at 11:18
  • 1
    The /proc/mounts file is an alternative to my proposed mount without any arguments. They should get you similar information. You edit /etc/fstab in a text editor. The format should be obvious but there's a man page (man fstab) if you're in doubt. – Bratchley Apr 25 '15 at 11:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.