您的位置:首页 > 其它

以普通用户登录时,如何让Firestarter自动启动

2009-08-25 00:00 288 查看
一般情况下,当你点击Firestarter的图标或者手动从终端中启动Firestarter时,会提示你输入管理员密码。但是这样实在是有点烦人,尤 其是你想每次登录都启动firestarter时。Firestarter可以在你以普通用户登录的情况下自动加载在后台运行,并且最小化到系统托盘图 标,而不需要向你询问密码。

给用户运行Firetarter而不需要Root密码的许可

为了让普通用户可以运行Firetarter,普通用户必须被给予额外的特权。用你最喜欢的编辑器编辑“/etc/sudoers”,并且在最后添加下面一段:

username ALL= NOPASSWD: /usr/bin/firestarter

注意:Debian用户需要将上面一段中的“/usr/bin/firestarter”替换为“/usr/sbin/firestarter”

将"username"替换成需要登录的普通用户登录名。上文中指定的用户可以运行Firestarter而不会再被提示输入密码或者使用命令行:sudo firestarter。

安 全方面的一点点注意:这种方法是将本地安全同便捷做了交换,如果你的登录帐户被攻击者破解了,那么攻击者将会控制Firestarter。 However this method is preferable to having a shared root user password in a multiuser setting. It is also preferable if the alternative is not to run Firestarter at all.

登录时运行Firesarter并最小化至系统托盘:

如果已经设置了上面的许可,那么系统可以继续设置为当你用普通帐户登录时自动运行Firetarter。那样的话,Firetarter可以自动运行至系统托盘中,而不需要用户的干涉,之后可以点击系统托盘图标打开主界面。

Gnome设置:
打开Gnome的“系统”菜单,选择“首选项”里的“会话”,切换到“启动程序”选项卡。
点击“添加”,并输入:“sudo firestarter --start-hidden”作为启动程序的命令,点击“确定”,结束设置。

很简单的只需要将刚才输入的列从表中删除就可以在登录时不自动启动Firestarter.

Kde设置:
打开终端并执行下面两行命令:
echo -e '#'\!'/bin/sh\nsudo firestarter --start-hidden' > ~/.kde/Autostart/firestarter
chmod a+x ~/.kde/Autostart/firestarter

现在Firestarter就可以随着KDE一起启动了。如果要终止随着KDE启动,只需删除下面这个文件:“~/.kde/Autostart/firestarter”。

译者注:水平有限,万望海涵。E-mail:kongweiguo@gmail.com
附原文如下:
How can I get Firestarter to load automatically when I log in as a regular user?

Normally when you start Firestarter by clicking an icon or manually from a terminal, the system will prompt you for your root user's password. However, this is a bit of a hassle, especially if you want to run Firestarter all the time when logged in. In that case Firestarter can be loaded in the background when you log in with your regular user, without asking a password and minimized to the system tray (pictured right).
Giving the user permission to launch Firestarter without the root password

In order for a regular user to be able to launch Firestarter, the user must be given additional privileges. Edit your /etc/sudoers file in your favorite text editor and add the following line at the end:
username ALL= NOPASSWD: /usr/bin/firestarter

Note: Debian users should replace /usr/bin/firestarter with /usr/sbin/firestarter in the above line.

Simply replace username with whatever your login is. The specified user is now able to launch Firestarter without being prompted for a password using the command sudo firestarter.

A note on the security aspects: This method makes a trade off in local security for convenience. If your user account becomes compromised the attacker will be able to control the firewall. However this method is preferable to having a shared root user password in a multiuser setting. It is also preferable if the alternative is not to run Firestarter at all.
Launching Firestarter minimized to the tray on login

Having performed the above configuration of permissions, the system can further be set up to load Firestarter when you log in with your regular user account. Firestarter will in that case load directly into the system tray without user intervention, after which the main interface can be accessed by clicking the tray icon.

Using GNOME:
Open up your GNOME menu, select Preferences followed by Sessions. Switch to the Startup programs tab, pictured right.

Click Add and enter
sudo firestarter --start-hidden
as the startup command. Click OK and you're done.

To stop Firestarter from loading on login, simply remove its entry from the startup programs listing.

Using KDE:

Open a terminal and execute the following two commands:

echo -e '#'\!'/bin/sh\nsudo firestarter --start-hidden' > ~/.kde/Autostart/firestarter
chmod a+x ~/.kde/Autostart/firestarter

Firstarter will now load automatically when KDE starts. To stop Firestarter from loading when you log in, remove the ~/.kde/Autostart/firestarter file. iamif 2008-3-1 16:20

在kde环境下,可以保存上次会话的session,在下次登陆中会自动运行的. 只需要用visudo命令改变用户的执行权限就可以了.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: