[英]Disable linux user authentication except through ldap
For example I have one user named user1
on my linux server, with password p1
. 例如,我在Linux服务器上有一个名为
user1
,密码为p1
。 Then I set up a ldap server and add user1 with password p2
. 然后,我设置了一个ldap服务器,并使用密码
p2
添加了user1。 Turns out now I can login as user1 with both p1
and p2
. 原来,我可以同时使用
p1
和p2
作为user1登录。 How can I disable p1
? 如何禁用
p1
?
passwd -l user
That will lock the user account as you are using LDAP authentication you not need user on server. 这将锁定用户帐户,因为您正在使用LDAP身份验证,而服务器上不需要用户。 And
passwd -u user
will undo this 而
passwd -u user
将撤消此操作
Alternatively, you can accomplish the same thing by prepending a !
另外,您可以在前面加上
!
来完成相同的操作!
to the user's password in /etc/shadow
(this is all passwd -l
does behind the scenes). /etc/shadow
的用户密码(这是passwd -l
在后台执行的所有操作)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.