精華區beta Linux 關於我們 聯絡資訊
as title... thank you... -- 奇哉!奇哉!大地眾生皆有如來智慧德性,只因妄想不能證得。 -- ※ Origin: 楓橋驛站<bbs.cs.nthu.edu.tw> ◆ From: star.imd.tmjcc.edu.tw > -------------------------------------------------------------------------- < 作者: chok1 (小軒軒) 看板: Linux 標題: Re: 請問一下~~~如何讓兩個users共同一個目錄?? 時間: Wed Jan 12 09:41:13 2000 ※ 引述《[email protected] (丫扁凍蒜)》之銘言: : as title... : thank you... 修改/etc/passwd 然後修改該目錄權限 讓兩個同群組的user可以讀取 > -------------------------------------------------------------------------- < 發信人: [email protected] (小州), 看板: Linux 標 題: Re: 請問一下~~~如何讓兩個users共同一個目錄?? 發信站: CynixBBS. (Wed Jan 12 09:52:13 2000) 轉信站: Ptt!bbs.ee.ntu!freebsd.ntu!netnews.csie.nctu!ctu-peer!news.nctu!spring ※ 引述《[email protected] (丫扁凍蒜)》之銘言: > as title... > thank you... 可不可以用 as title 這類話述的方式呢? 請問一下~~~如何讓兩個users共同一個目錄?? 所謂的共用是只怎樣的方式? 到達到怎樣的程度才算是共用呢? > -------------------------------------------------------------------------- < 發信人: [email protected] (無), 看板: Linux 標 題: Re: 請問一下~~~如何讓兩個users共同一個目錄?? 發信站: 交大資科_BBS (Wed Jan 12 11:53:52 2000) 轉信站: Ptt!bbs.ee.ntu!freebsd.ntu!news.cs.nthu!news.cis.nctu!cis_nctu ==> 在 [email protected] (小軒軒) 的文章中提到: > ※ 引述《[email protected] (丫扁凍蒜)》之銘言: > : as title... > : thank you... > 修改/etc/passwd > 然後修改該目錄權限 > 讓兩個同群組的user可以讀取 uid 設成一樣不就得了. > -------------------------------------------------------------------------- < 發信人: [email protected] (賺錢錢...), 看板: Linux 標 題: Re: 請問一下~~~如何讓兩個users共同一個目錄?? 發信站: GostonBBS (Wed Jan 12 13:10:59 2000) 轉信站: Ptt!bbs.ee.ntu!freebsd.ntu!wd.atc.ntut!Goston ※ 引述《[email protected] (無)》之銘言: : ==> 在 [email protected] (小軒軒) 的文章中提到: : > 修改/etc/passwd : > 然後修改該目錄權限 : > 讓兩個同群組的user可以讀取 : uid 設成一樣不就得了. 要修改/etc/shadow...(如果有用shadow的話) 把uid改成一樣... 如果用x-windows的話是不可能開出2個uid一樣的帳號...^^ > -------------------------------------------------------------------------- < 發信人: [email protected] (丫扁凍蒜), 看板: Linux 標 題: Re: 請問一下~~~如何讓兩個users共同一個目錄?? 發信站: 清華資訊(楓橋驛站) (Wed Jan 12 16:06:25 2000) 轉信站: Ptt!bbs.ee.ntu!freebsd.ntu!netnews.csie.nctu!news.cs.nthu!maple ※ 引述《[email protected] (無)》之銘言: > ==> 在 [email protected] (小軒軒) 的文章中提到: > > 修改/etc/passwd > > 然後修改該目錄權限 > > 讓兩個同群組的user可以讀取 > uid 設成一樣不就得了. 對丫~~我設了~~ 但是~~~同群組還是不能寫入丫~~ 假設~~有個a user & b user~~~是同group為 ab group~~~ 共用public~~~ 我設.... chown .ab public 不行耶~~ 請問要如何設丫~~ 謝謝~~ > -------------------------------------------------------------------------- < 發信人: [email protected] (海威伯工程師), 看板: Linux 標 題: Re: 請問一下~~~如何讓兩個users共同一個目錄?? 發信站: 台大電機 Maxwell BBS (Wed Jan 12 16:14:27 2000) 轉信站: Ptt!bbs.ee.ntu!Maxwell ※ 引述《[email protected] (丫扁凍蒜)》之銘言: : ※ 引述《[email protected] (無)》之銘言: : > uid 設成一樣不就得了. : 對丫~~我設了~~ : 但是~~~同群組還是不能寫入丫~~ : 假設~~有個a user & b user~~~是同group為 ab group~~~ : 共用public~~~ : 我設.... : chown .ab public : 不行耶~~ : 請問要如何設丫~~ : 謝謝~~ chgrp ab public > -------------------------------------------------------------------------- < 發信人: [email protected] (小州), 看板: Linux 標 題: Re: 請問一下~~~如何讓兩個users共同一個目錄?? 發信站: CynixBBS. (Wed Jan 12 16:21:18 2000) 轉信站: Ptt!bbs.ee.ntu!freebsd.ntu!ctu-peer!news.nctu!spring!netnews.hinet.net ※ 引述《[email protected] (丫扁凍蒜)》之銘言: > ※ 引述《[email protected] (無)》之銘言: > > uid 設成一樣不就得了. > 對丫~~我設了~~ > 但是~~~同群組還是不能寫入丫~~ > 假設~~有個a user & b user~~~是同group為 ab group~~~ > 共用public~~~ 設定方式就是開個 group,比方式 ab 。然後修改 /etc/group 檔案,或者是使用 usermod 程式,把 user a 與 user b 都加入到 ab 這個 group 內。 > 我設.... > chown .ab public > 不行耶~~ 然後把要分享的資料夾目錄的 group 設定為 ab : chgrp ab directory 還要把目錄設定為同 group 的人可以寫入: chmod g+w directory > 請問要如何設丫~~ > 謝謝~~ > -------------------------------------------------------------------------- < 發信人: [email protected] (蔥蛋寶寶), 看板: Linux 標 題: Re: 請問一下~~~如何讓兩個users共同一個目錄?? 發信站: 神秘之旅在中原資訊 (Wed Jan 12 17:21:04 2000) 轉信站: Ptt!bbs.ee.ntu!news.ntu!feeder.seed.net.tw!ctu-gate!news.nctu!news.ncu 【 在 [email protected] (丫扁凍蒜) 的大作中提到: 】 : as title... : thank you... 設成同一個 group, 然後 : 1. chgrp [group name] [目錄] 2. chmod 775 [目錄] 3. chmod g+s [目錄] > -------------------------------------------------------------------------- < 發信人: [email protected] (丫扁凍蒜), 看板: Linux 標 題: Re: 請問一下~~~如何讓兩個users共同一個目錄?? 發信站: 清華資訊(楓橋驛站) (Wed Jan 12 21:40:38 2000) 轉信站: Ptt!bbs.ee.ntu!freebsd.ntu!news.cs.nthu!maple ※ 引述《[email protected] (蔥蛋寶寶)》之銘言: > 【 在 [email protected] (丫扁凍蒜) 的大作中提到: 】 > : as title... > : thank you... > 設成同一個 group, 然後 : > 1. chgrp [group name] [目錄] > 2. chmod 775 [目錄] > 3. chmod g+s [目錄] 謝謝你~~& 你好~~ 我成功了~~ 但是想請教你 +s是什麼意思丫~~~ g是group吧~~~ 謝謝~~~ > -------------------------------------------------------------------------- < 發信人: [email protected] (蔥蛋寶寶), 看板: Linux 標 題: Re: 請問一下~~~如何讓兩個users共同一個目錄?? 發信站: 神秘之旅在中原資訊 (Wed Jan 12 23:10:28 2000) 轉信站: Ptt!bbs.ee.ntu!freebsd.ntu!netnews.csie.nctu!ED307NCTU!news.ee.nctu!ct 【 在 [email protected] (丫扁凍蒜) 的大作中提到: 】 : ※ 引述《[email protected] (蔥蛋寶寶)》之銘言: : > 設成同一個 group, 然後 : : > 1. chgrp [group name] [目錄] : > 2. chmod 775 [目錄] : > 3. chmod g+s [目錄] : 謝謝你~~& 你好~~ : 我成功了~~ : 但是想請教你 +s是什麼意思丫~~~ : g是group吧~~~ : 謝謝~~~ 恭喜你...可以動囉!! g+s 是讓那個目錄在 group 上多個 "s" 的權限....專有名詞我忘了... 目的是讓所有相同 group 的 user 在這個目錄下所建立的任何 檔案, 其 group 都是跟這個具有 "s" 權限的目錄的 group 相同, 如果不加 "s", 則所建立出來的檔案, 其 group 會是每一個 user 的 default group, 那別人就沒有辦法去管理這個檔案了!! 你可以實際去試試看, 就會比較清楚我在說什麼了..... :) > -------------------------------------------------------------------------- < 發信人: "一切都是夢" <[email protected]>, 看板: Linux 標 題: Re: 請問一下~~~如何讓兩個users共同一個目錄?? 發信站: stevel.twbbs.org (Wed Jan 12 23:17:44 2000) 轉信站: Ptt!bbs.ee.ntu!freebsd.ntu!stevel.twbbs.org!not-for-mail 小州 <[email protected]> wrote: > ※ 引述《[email protected] (丫扁凍蒜)》之銘言: > > > 設成同一個 group, 然後 : > > > 1. chgrp [group name] [目錄] > > > 2. chmod 775 [目錄] > > > 3. chmod g+s [目錄] >> 但是想請教你 +s是什麼意思丫~~~ > g+s , 就是 set group ID on execution 。 以目錄來說的話, > 在該目錄內所建立的檔案與目錄,其 group 會是 group name, > 而不是 user 內定的 group 名稱。 mount 的 manpage 裡有一段話,我想它把這部分的 semantics 講得很清楚: grpid or bsdgroups / nogrpid or sysvgroups These options define what group id a newly created file gets. When grpid is set, it takes the group id of the directory in which it is created; other괊 wise (the default) it takes the fsgid of the cur괊 rent process, unless the directory has the setgid bit set, in which case it takes the gid from the parent directory, and also gets the setgid bit set if it is a directory itself. > -------------------------------------------------------------------------- < 發信人: [email protected] (小州), 看板: Linux 標 題: Re: 請問一下~~~如何讓兩個users共同一個目錄?? 發信站: CynixBBS. (Wed Jan 12 23:09:12 2000) 轉信站: Ptt!bbs.ee.ntu!news.ntu!spring!netnews.hinet.net!Cynix ※ 引述《[email protected] (丫扁凍蒜)》之銘言: > > 設成同一個 group, 然後 : > > 1. chgrp [group name] [目錄] > > 2. chmod 775 [目錄] > > 3. chmod g+s [目錄] > 謝謝你~~& 你好~~ > 我成功了~~ > 但是想請教你 +s是什麼意思丫~~~ > g是group吧~~~ > 謝謝~~~ g+s , 就是 set group ID on execution 。 以目錄來說的話, 在該目錄內所建立的檔案與目錄,其 group 會是 group name, 而不是 user 內定的 group 名稱。 [root@linux /tmp]# ls -l | grep "testdir" drwxrwxrwx 2 root nobody 1024 Jan 12 23:00 testdir 這是目錄的屬性。owner: root , group: nobody [kenduest@linux /tmp/testdir]$ id uid=500(kenduest) gid=500(users) groups=500(users) 要測試的使用者資料。 ---------------------------------------------------------------- [kenduest@linux /tmp/testdir]$ touch testfile1 [kenduest@linux /tmp/testdir]$ ls -l | grep "testfile1" -rw-rw-r-- 1 kenduest users 0 Jan 12 23:04 testfile1 在 testdir 目錄內建立一個檔案,該 testfile1 檔案 owner 是 kenduest, group 為 users 。 ---------------------------------------------------------------- 使用 root 身份執行 chmod g+s /tmp/testdir,使用 ls -l 看到的是: drwxrwsrwx 2 root nobody 1024 Jan 12 23:04 testdir ---------------------------------------------------------------- [kenduest@linux /tmp/testdir]$ touch testfile2 [kenduest@linux /tmp/testdir]$ ls -l | grep "testfile2" -rw-rw-r-- 1 kenduest nobody 0 Jan 12 23:04 testfile2 所建立的 testfile2 檔案的 owner 還是 kenduest,不過 group 則是 該 testdir 目錄的 group 名稱,而已不是 users 了。