Ubuntu Samba Server Setup Procedure - Group and Permission
Ubuntu Samba Server Setup Procedure
1. Install Samba Server
2. Uninstall Samba Server
$ sudo apt-get autoremove --purge samba
$ sudo apt-get remove samba
$ sudo apt-get autoremove samba
3. Create User
a. Setup User in Ubuntu
$ useradd -m <user>
b. Setup User in Samba Server
c. Password Change
4. Create Group in Ubuntu
sambaでは、sambaが動作するLinux上に存在するグループ毎に、共有するファイルやディレクトリのアクセス権を変更できます。
a. Create Group
b. Add User to Group
User および Group 一覧は、/etc/フォルダーの group ファイルに記載されています。
5. Change ownership and Setup Permission
a. Change Ownership
or: chown [OPTION]... --reference=RFILE FILE...
With --reference, change the owner and group of each FILE to those of RFILE.
-f, --silent, --quiet suppress most error messages
-v, --verbose output a diagnostic for every file processed
--dereference affect the referent of each symbolic link (this is
the default), rather than the symbolic link itself
-h, --no-dereference affect symbolic links instead of any referenced file
(useful only on systems that can change the
ownership of a symlink)
--from=CURRENT_OWNER:CURRENT_GROUP
change the owner and/or group of each file only if its current owner and/or group match those specified here. Either may be omitted, in which case a match is not required for the omitted attribute
--preserve-root fail to operate recursively on '/'
--reference=RFILE use RFILE's owner and group rather than
specifying OWNER:GROUP values
-R, --recursive operate on files and directories recursively
option is also specified. If more than one is specified, only the final
one takes effect.
to a directory, traverse it
-L traverse every symbolic link to a directory
encountered
-P do not traverse any symbolic links (default)
--help display this help and exit
--version output version information and exit
to login group if implied by a ':' following a symbolic OWNER.
OWNER and GROUP may be numeric as well as symbolic.
Examples:
chown root:staff /u Likewise, but also change its group to "staff".
chown -hR root /u Change the owner of /u and subfiles to "root".
b. Change group ownership
chgrpコマンドによって、publicの所有グループをgroup1に変更します。
Usage: chgrp [OPTION]... GROUP FILE...
or: chgrp [OPTION]... --reference=RFILE FILE...
Change the group of each FILE to GROUP.
With --reference, change the group of each FILE to that of RFILE.
-c, --changes like verbose but report only when a change is made
-f, --silent, --quiet suppress most error messages
-v, --verbose output a diagnostic for every file processed
--dereference affect the referent of each symbolic link (this is
the default), rather than the symbolic link itself
-h, --no-dereference affect symbolic links instead of any referenced file
(useful only on systems that can change the
ownership of a symlink)
--no-preserve-root do not treat '/' specially (the default)
--preserve-root fail to operate recursively on '/'
--reference=RFILE use RFILE's group rather than specifying a
GROUP value
-R, --recursive operate on files and directories recursively
option is also specified. If more than one is specified, only the final
one takes effect.
to a directory, traverse it
-L traverse every symbolic link to a directory
encountered
-P do not traverse any symbolic links (default)
--help display this help and exit
--version output version information and exit
chgrp -hR staff /u Change the group of /u and subfiles to "staff".
number: read=4 write=2 execute=1
774 = owner read write excute
group read write excute
Usage: chmod [OPTION]... MODE[,MODE]... FILE...
or: chmod [OPTION]... OCTAL-MODE FILE...
or: chmod [OPTION]... --reference=RFILE FILE...
Change the mode of each FILE to MODE.
With --reference, change the mode of each FILE to that of RFILE.
-c, --changes like verbose but report only when a change is made
-f, --silent, --quiet suppress most error messages
-v, --verbose output a diagnostic for every file processed
--no-preserve-root do not treat '/' specially (the default)
--preserve-root fail to operate recursively on '/'
--reference=RFILE use RFILE's mode instead of MODE values
-R, --recursive change files and directories recursively
--help display this help and exit
--version output version information and exit
以上でgroup1に属するユーザのみがアクセス可能なディレクトリの作成は完了です。後はsamba側の設定によってグループ毎の管理が可能になります。
6. Permission の確認
Note: Windows との関連
Comments
Post a Comment