閉じる - インストール場所(SMB共有)からrootとしてファイルを削除することはできません。

閉じる - インストール場所(SMB共有)からrootとしてファイルを削除することはできません。

更新:この問題はsmbに関連しない他のサービスが原因であるようです。適切な解決策が見つからず申し訳ありません。質問を閉じます。


Ubuntu 17.10 VMにSMB共有をマウントし、/mnt/smb_mntマウント場所()からファイルを削除してみました。

最初はゲストとしてインストールし、ゲスト sudo mount -t cifs //ipaddress/share /mnt/smb_mnt/ -oguest,vers=2.0としてもインストールしましたが、rootどちらも機能しませんでした。また、mount -o remount,rw /mnt/smb_mnt読み取りおよび書き込み権限で再度マウントしようとしましたが、ファイルを削除することはできません。

ファイルに777の権限を付与し、ファイルの所有者でもあるため、rmコマンドを実行します。root確認してみると、ls -l権限は私がファイルと親ファイル(smb_mnt)に割り当てた権限です。

chattr -i私が見つけた他の関連する質問に基づいてコマンドを試しましたが、次のような結果が得られましたchattr: Permission denied while setting flags on /mnt/smb_mnt/file

削除のために何を試すことができますか?

私は自分のコンピュータからローカルで簡単にファイルを削除できることを知っていますが、テストしたいモジュールはsmbでのみ機能するため、インストール場所からファイルを削除する必要があるため、コンピュータにアクセスしてファイルをssh削除することはできません。手動で。

SMB 構成ファイルは次のとおりです。

[global]
# Include the base global configuration options. These don't usually change.
include = /etc/samba/base_global.conf
# These are configurable via the module
max protocol = SMB2
hide files = //:2eDS_Store/:2eFBCLockFolder/.FBCLockFolder/:2eFBCIndex/.FBCIndex/TheVolumeSettingsFolder/TheFindByContentFolder/Temporary Items/Network Trash Folder/.AppleDB/:2eVolumeIcon.icns/.VolumeIcon.icns/Icon/.AppleDouble/.AppleDesktop/desktop.ini/RECYCLER//

# (Options from the currently enabled Global Profile. Will overwrite any previous options)
# Enabled Global profile: Default Global
# Authentication is handled by the UserDirectory module.
# The "security" option is put in this file as well.
include = /etc/samba/auth.conf

[Space]
# Profile: Guest Read/Write
path = /share/Space
guest ok = True
read only = False
browseable = True
preexec = /opt/space/modules/SMB/bin/scripts/event.py --event connect --profile 105 --service %S --user %u --client-ip %I --server-ip %i --path %P --pid %d
root preexec = /opt/space/modules/SMB/bin/scripts/event.py --root --event connect --profile 105 --service %S --user %u --client-ip %I --server-ip %i --path %P --pid %d
postexec = /opt/space/modules/SMB/bin/scripts/event.py --event disconnect --profile 105 --service %S --user %u --client-ip %I --server-ip %i --path %P --pid %d

# Optional extra definitions created by other programs.
# Will scan /etc/samba/includes.d/ for extra configuation files as well
# A SMB.createConf() will need to be run for it to detect new SMB config files
# The first line (includes.conf) is included for backwards compatibility. Modules should use the includes.d folder and make their own files.
include = /etc/samba/includes.conf

ベストアンサー1

Samba は、クライアントコンピュータの Samba 共有に対する正しいファイル権限を表しません。
Sambaサーバー上のファイルはSamba接続を介してアクセスされ、クライアントコンピュータにrootSambaユーザーとしてログインしてもそのファイルにアクセスできます。
Samba 接続を介してファイルを変更すると、この方法で Samber サーバーに反映されません。

sshSambaサーバーにログインして確認してください。本物ファイル権限。
これらのファイルは、Sambaサーバー上の他のユーザーおよび/または他のグループに属することができます。

Samba共有構成では[Space]ユーザーまたはグループの割り当ては定義されていないため、同じSamba共有に接続している他のユーザーは、自分のシステムユーザーアカウントとユーザーファイル権限を使用してこれらのファイルを作成できます。

おすすめ記事