Welcome to the Linux Foundation Forum!

Lab 18.2: copying ls to noexec mounted folder does not bring any error


I made a ext4 partition on drive /dev/vdb as partition number 1 and mounted it with the noexec option. Still I am able to copy ls (an executable file) to it. I am using UbuntuServer 20.04 as an virtual machine. Any ideas here. Exercise says, I should get an error while trying to copy ls. That's what I do expect also, but I do not get an error.


  • luisviveropena
    luisviveropena Posts: 1,173

    Hi @FrankHeuer ,

    I was able to reproduce the issue. It seems there was a confusion, because the "noexec" prevents the direct execution of any binaries in the mounted filesystem (as you can see in the man page for mount). So, you should be able to copy the binary but not able to run it (and that works of course).

    We'll take care of it. Thanks for notifying it!


  • coop
    coop Posts: 915
    edited June 2021

    I fail to see a problem here. The exercise says:

    Then remount the filesystem and copy an executable file (such as /bin/ls ) to /mnt/tempdir and try to run it. You should get an error: why?

    Which is exactly correct -- you can copy it but not run it. No modification is needed as far as I can see. (it would not even make sense to say "try to run it" if you cannot copy it first.


Upcoming Training