sshfsのfstabでは、「exec」オプションは無視されます。コマンドラインで "mount"を指定する必要がありますか?

sshfsのfstabでは、「exec」オプションは無視されます。コマンドラインで

fstabでsshfsを使用してUbuntu 18.04.04 LTSにファイルシステムをマウントします。

sshfs#[email protected]:/remote-dir /mnt/local-mnt  fuse    rw,exec,user,allow_other,noauto,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3  0 0

うまくインストールされていますが、パスから何でも実行しようとすると、次のような結果が表示されます。

./some-executable: Permission denied.

ファイルには実行権限があります(実際にシステムにSSHで接続すると正常に動作します)。

fstab を使用しているが -oexec オプションを再度含める場合:

mount /mnt/local-mnt -oexec

だとしたら大丈夫です。 fstab 'exec'が無視されるのはなぜですか?

ベストアンサー1

このオプションは無視されません。後続のオプションに関して暗黙的に上書きされますexec。この動作は次のとおりです。noexecuserman mount

   user   Allow an ordinary user to mount the filesystem.  The name of the
          mounting user is written to the mtab file  (or  to  the  private
          libmount  file  in /run/mount on systems without a regular mtab)
          so that this same user can unmount the filesystem  again.   This
          option  implies  the  options  noexec, nosuid, and nodev (unless
          overridden  by  subsequent  options,  as  in  the  option   line
          user,exec,dev,suid).

execoptionsの後にオプションを指定すると、目的の動作を取得できますuser

また、見ることができます

おすすめ記事