Answers:
您需要管理员扩展
$ apt-cache search nautilus | grep admin
nautilus-admin - Extension for Nautilus to do administrative operations
用安装 sudo apt-get install nautilus-admin
我从这里测试了该解决方案,它工作正常(运行14.04 / nautilus)。
为了不张贴的唯一联系回答:
安装 gksu
sudo apt-get install gksu
导航 ~/.local/share/nautilus/scripts
创建并打开一个空文件,命名为open-as-administrator
,然后将脚本粘贴到下面:
#!/bin/bash
#
# this code will determine exactly the path and the type of object,
# then it will decide use gedit or nautilus to open it by ROOT permission
#
# Determine the path
if [ -e -n $1 ]; then
obj="$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"
else
base="`echo $NAUTILUS_SCRIPT_CURRENT_URI | cut -d'/' -f3- | sed 's/%20/ /g'`"
obj="$base/${1##*/}"
fi
# Determine the type and run as ROOT
if [ -f "$obj" ]; then
gksu gedit "$obj"
elif [ -d "$obj" ]; then
gksu nautilus "$obj"
fi
exit 0
使脚本可执行
注销并重新登录,或运行:
nautilus -q
再次:该脚本不是我的!在 http://ubuntuhandbook.org上找到了它
sudo apt-get install nautilus-admin
method而不是制作自己的系统脚本。然后您将在需要/ id时获得更新。