Freebsd下普通用户使用sudo执行命令

Tuesday, October 7, 2008

cd /usr/ports/security/sudo
make install clean

ee /usr/local/etc/sudoers
修改
# %wheel ALL=(ALL) NOPASSWD: ALL

%wheel ALL=(ALL) NOPASSWD: ALL

这样whell组用户就可以通过sudo执行所有命令,且不需要输入密码。

给普通用户使用bash
cd /usr/ports/shells/bash
make install clean

默认bash路径为/usr/local/bin/bash
在用户home目录下建立.bash_profile和.bashrc提高用户使用bash的方便程度
ee .bash_profile
添加
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

ee .bashrc
添加
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias ll='ls -lA'

source .bash_profile
source .bashrc

顺便提一下freebsd默认的csh是不带tab补全的,使用起来十分不方便,可以通过修改/etc/csh.cshrc
添加
set autolist

Posted by Michael.Ding at 11:46 AM

0 comments:

Post a Comment