samba에서 저장하는 파일을 같은 그룹소유로 만드는 방법

gauibauibo의 이미지

samba를 설치해서 폴더하나를 공유하고 있습니다.

공유폴더의 접근은 user id, password를 입력해서 접근하도록 했습니다.

그리고 공유폴더에 접근하는 user는 다 같은 users그룹에 속해 있습니다.

user가 공유폴더에 폴더를 생성하면 폴더의 소유자와 그룹이 user:user가 되는데

생성된 폴더의 소유자와 그룹을 user:users가 되게 만들고 싶습니다.

많은 도움 부탁드립니다.

무한포옹의 이미지

공유 디렉토리의 퍼미션을 2770 으로 맞추어 보세요.
ls -al 했을 때 그 디렉토리가 drwxrws--- 어쩌고 나오면 잘 설정된 것입니다.
그리고 smb.conf 의 해당 공유 디렉토리 설정 부분에서
create mask , directory mask 부분도 잘 확인 하세요.
-------------------------------
인생 뭐 있음!

-------------------------------
== warning 대부분 틀린 얘기입니다 warning ===

netj의 이미지

무한포옹님 설명처럼 chmod g+ws /path/to/smbdir 로 해당 디렉토리의 그룹 쓰기 및 setgid를 켜주시면 그룹이 보존됩니다.

하위폴더에서도 마찬가지로 그룹쓰기가 가능하게 하려면 directory mask를 조절하셔도 되나
아래와 같이 acl을 이용하시면 더 samba 외의 접근에서도 다 적용되니 유용한 경우가 많습니다.

OS마다 차이가 있을 수 있으나, Linux에 ext3를 쓰신다면
1. 해당 파일시스템 mount 옵션에 acls를 추가하시고 (/etc/fstab)
2. setfacl -m g:users:rwx /path/to/smbdir 로 users 그룹쓰기 권한을 켜주시고
3. setfacl -d -m g:users:rwx /path/to/smbdir 로 새로 만들어지는 디렉토리에 대해서도 users가 그룹쓰기가 가능하게 기본acl을 설정해줍니다.

Debian에서는 기본커널에 acl 지원이 켜져있으며 (아마 sarge 이후?), acl 패키지를 설치하면 setfacl, getfacl 등의 명령을 쓸 수 있습니다.

참고하세요 :)

--
Every truth is in the detail.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.