2

Unix の特定のフォルダに転送されたファイルにデフォルトのアクセス許可を適用する必要があります。インターネットで調べたところ、2つの方法が見つかりました。ただし、次の理由で使用できません。

1. umask

This command can only be used in user login level by mentioning it
in .bashrc / .profile file.  Won't work for me because I want the
permissions to be applied regardless of the logged in user, and only
to a specific folder.
enter code here

2.setfacl

This command can only be used when the drive on which the folder is
located, is mounted with file access listing enabled. This won't for
me because I can't involve Unix system admins in this activity at my
workplace.

私の要件の解決策を達成するための別の(そしておそらく簡単な)方法があるかどうかを提案してください。

4

1 に答える 1

0

MIDES についての知識はありませんが、ユーザーが cron の実行を許可されている場合、次のような cron エントリが表示されます。

          • /usr/bin/chmod /dir_name/*

例えば

          • /usr/bin/chmod 750 /export/xfr/*

毎分実行され、ディレクトリ内のすべてのファイルのアクセス許可を希望するものに変更します。

転送されたファイルだけでなく、そのディレクトリ内のすべてのファイルに対して実行されるため、求めているものとは正確に異なる場合があります。

そのディレクトリ内の特定のファイルでのみ実行する必要がある場合は、find などを使用して、操作するファイルをより適切に定義できます。例えば

          • /usr/bin/find -user -exec /usr/bin/chmod {} \;

例えば

          • /usr/bin/find /export/xfr -user narayanf1 -exec /usr/bin/chmod 750 {} \;

ユーザー narayanf1 が所有する /export/xfr 内のファイルの権限のみを変更します。

男は見つける

作成時間、変更時間、サイズ、名前など、他のオプションに関するさらなるオプションが表示されます。

于 2014-06-18T04:04:05.140 に答える