權限的問題 - Linux

Table of Contents

大家好,想請問大家權限的問題。
有一個操作帳號帳號userA,沒有root權限。
現在需要userA去執行/tmp/abc.sh這個檔案
4.userA對abc.sh(owner:root 701)只有執行的權限,
對cde.sh(owner:root 700)沒有任何的權限。
5.目前想讓userA在不具root權限,不知道root的密碼的狀態下執行abc.sh。
6.權限的問題希望能在abc.sh裡面處理掉,密碼也可以寫在abc.sh裡面。


已嘗試過
sudo
1.需將userA加入visudo設定檔,但這樣一來userA就具有root權限,這樣不行。

su
1.無法餵密碼

su+expect
1.可以達到目的,但需將abc.sh改為705,這樣一來userA就看得見密碼也不可以


請問大家這樣該怎麼做?謝謝。


abc.sh的內容如下
cat /tmp/cde.sh

--

All Comments

Tom avatarTom2011-12-17
sudo可以限制執行的指令
Tristan Cohan avatarTristan Cohan2011-12-19
rusty ALL= NOPASSWD: /sw/bin/ethereal, /usr/local/bin/