blfs(systemv版本)学习笔记-编译安装sudo并创建普通用户配置sudo权限

时间:2023-03-08 21:01:18

blfs书中sudo的安装配置章节:http://www.linuxfromscratch.org/blfs/view/8.3/postlfs/sudo.html

1.下载sudo包并添加与校验md5值

wget http://www.sudo.ws/dist/sudo-1.8.23.tar.gz

md5sum -c md5sums

2.解压sudo软件包,并进入解压完的软件包目录

tar -xvf sudo-1.8..tar.gz

cd sudo-1.8.

3.参照书中的说明进行编译安装

./configure --prefix=/usr              \
--libexecdir=/usr/lib \
--with-secure-path \
--with-all-insults \
--with-env-editor \
--docdir=/usr/share/doc/sudo-1.8. \
--with-passprompt="[sudo] password for %p: " &&
make
make install &&
ln -sfv libsudo_util.so.0.0. /usr/lib/sudo/libsudo_util.so.

4.返回blfs-sources目录并删除sudo的解压目录

cd $LFS/sources/blfs-sources

rm -rf sudo-1.8.

5.给用户添加sudo权限的方法

visudo

在root ALL=(ALL) ALL
下面添加 <newuser>  ALL=(ALL)ALL