シノバーです。
On Fri, 15 Sep 2000 15:02:48 +0900
Masaki SHINOMIYA <shino _at_ pos.to> wrote:
[vine-users:026453] bye byeで shutdown!!
の.bashrcスクリプトが間違っていました。すみません。
修正板を以下に掲げます。
1) まずはbyeというユーザーを用意します。パスワードもbyeです。
2) sudoの設定は /etc/sudoers に
bye localhosst = NOPASSWORD: /usr/sbin/shutdown
3) /home/bye/.bashrc を次のようにします。
## /home/bye/.bashrc
if tty | grep pts > /dev/null
then
echo Remote login denied.
read x
logout
else
/usr/bin/sudo /usr/sbin/shutdown -h now
logout
fi
### .bashrc ここまで
なお、このスクリプトは
ttyというコマンドを実行すると
1.グラフィカルログインでは 'ttyではありません' (Vine Linux 2.0の場合)
2.ログイン後に仮想ターミナルで実行すると 'tty0' (あるいはtty1,tty2など)
3.telnetでログインすると 'dev/pts/0' などと表示される
ことを利用しています。
システムにより異なる場合があるので確かめてください。
P.S.
http://member.nifty.ne.jp/shinobar/linux/byebye.html
に以上を解説とともにアップしました。
> --
> Masaki SHINOMIYA <shino _at_ pos.to>
> The Bar Master,
> Shino's Bar - Contemporary Art and Spirits
> http://Paper.Cup.Com/
> CAS <master _at_ cup.com>
>
--
Masaki SHINOMIYA <shino _at_ pos.to>
The Bar Master,
Shino's Bar - Contemporary Art and Spirits
http://Paper.Cup.Com/
CAS <master _at_ cup.com>
Follow-Ups: References:
- [vine-users:026403] root以外でshutdown!!N.adachi
- [vine-users:026411] Re: root以外でshutdown!!OOSATO,Kazzrou
- [vine-users:026414] Re:root以外でshutdown!!Hideya Hane
- [vine-users:026421] Re: root以外でshutdown!!四宮雅樹
- [vine-users:026453] bye byeでshutdown!!Masaki SHINOMIYA
- Prev by Subject: [vine-users:026529] Re: Windows のIE でapache 上のtxt.gzを開く
- Next by Subject: [vine-users:026531] Re: Auto-FTP
- Previous by thread: [vine-users:026453] bye byeでshutdown!!
- Next by thread: [vine-users:026533] コンソールでの文字化け
- Indexes:[Main][Thread]