NIS用戶端問題 - Linux
By Sandy
at 2010-06-28T17:19
at 2010-06-28T17:19
Table of Contents
我想你的問題重點是 在 server 和 client 端 AAA 這帳號的家目錄到底要不要同步.
如果沒有要同步, 只是每次登錄, 就要把AAA的家目錄從 server copy 到client,
那就簡單多了. 寫個 shell script, 每次登錄的時候檢查家目錄是不是存在, 如果
不存在, 就從 server 端 rsync 一份到 client.
例如用 bash shell,
if [ -d /home/AAA ]; then
echo "Home exists"
else
rsync -avz -e ssh root@server:/home/AAA /home
fi
當然要設定好 ssh 的authorization, 把 root 在 server 的 public key copy 一份到
client 那麼 root ssh 的動作就不需要密碼了.
另外, 應該不是 "exception", 你是要 " expect" 吧.
※ 引述《whisp1222 ()》之銘言:
: server端有AAA這個帳號,也有home directory
: clien端的用戶也可以使用AAA這個帳戶登入,但卻沒有home directory
: 目前是用人工一個一個加home directory
: --------------------
: mkdir /home/AAA
: chown -R AAA:AAA AAA
: --------------------
: 但問題是帳號一多就很累...囧
: 請問有辦法讓Linux偵測沒有home directory然後自動建立並copy相關檔案進去
: home directory嗎?
: 印象中之前有聽過exception這字眼 但怎樣都google不到(都找到程式語言的囧)
: 麻煩高手指導
: PS:忘記說明 我知道很多人直接mount /home,這樣就一定會有每個帳號的home directory
: 但因為教授某些需求 所以無法這樣做
--
Tags:
Linux
All Comments
By Caroline
at 2010-07-03T04:40
at 2010-07-03T04:40
By Kyle
at 2010-07-06T23:22
at 2010-07-06T23:22
By Skylar DavisLinda
at 2010-07-09T05:18
at 2010-07-09T05:18
By Margaret
at 2010-07-09T08:25
at 2010-07-09T08:25
By Hedy
at 2010-07-09T13:49
at 2010-07-09T13:49
By Gilbert
at 2010-07-11T07:05
at 2010-07-11T07:05
By Erin
at 2010-07-11T17:55
at 2010-07-11T17:55
By Ida
at 2010-07-16T00:44
at 2010-07-16T00:44
By Sarah
at 2010-07-16T12:07
at 2010-07-16T12:07
Related Posts
NIS用戶端問題
By Puput
at 2010-06-28T11:04
at 2010-06-28T11:04
新酷音如何刪除自訂詞?
By Ina
at 2010-06-28T06:33
at 2010-06-28T06:33
openssh 設定問題
By Catherine
at 2010-06-28T01:14
at 2010-06-28T01:14
如何在ubuntu上看世足?
By Hedy
at 2010-06-27T22:42
at 2010-06-27T22:42
請問如何用irfanview開啟檔案?
By Eden
at 2010-06-27T15:57
at 2010-06-27T15:57