- 积分
- 16843
在线时间 小时
最后登录1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
/ \9 T- @# c2 p" g我们切换到root用户的时候,直接使用su 或者su -,但是有个问题是,需要输入密码。这样比较麻烦。我们可以让某个用户无密码登录到root用户,需要进行如下的设置:
3 ~' p1 }* B# i2 f. P" F0 n9 a# j* l4 I/ a x
cat /etc/pam.d/su: Y, A6 s K$ l) E
#%PAM-1.0
- R2 }2 J7 @% W9 S" Z+ N, ^auth sufficient pam_rootok.so
H2 I7 N% y* }- T$ D! m9 F4 N/ z# Uncomment the following line to implicitly trust users in the "wheel" group.
5 _1 x; b% Z3 n, K5 n#auth sufficient pam_wheel.so trust use_uid
~9 k2 A8 J8 |# Uncomment the following line to require a user to be in the "wheel" group.4 U9 X, n$ ]+ i, i, G8 W
#auth required pam_wheel.so use_uid
& ]- i8 U1 p) Gauth substack system-auth [$ S! M& }- L9 O
auth include postlogin
* n5 l C$ `1 l6 L3 ^account sufficient pam_succeed_if.so uid = 0 use_uid quiet
$ I7 \+ G3 Y) B7 q$ C- C3 e. B1 Zaccount include system-auth
9 ?; }5 F" k2 }' A' L4 \, cpassword include system-auth
! j0 p" x/ \8 m; M9 q; x$ H. h4 N$ [; Csession include system-auth
. }2 K/ z, r/ M. M) c: v" qsession include postlogin
7 v+ d- z+ W. F: {$ csession optional pam_xauth.so: v! Y" | g& i& e
* |6 D; m7 h+ S7 q# B# d) Y) x3 o6 }! d- l; w6 l
然后执行:
& _# H; s+ h7 @5 bgpasswd -a usename wheel
, f9 u; K2 \2 Y. P: C0 S$ R即可!!!! e5 q; F. ]7 i( e1 c. [/ R; d
|
|