创建一个/sbin/nologin用户
[root@host101 ~]# useradd -s /sbin/nologin redis [root@host101 ~]# grep redis /etc/passwd redis:x:501:501::/home/redis:/sbin/nologin [root@host101 ~]# su redis -c "echo ss" This account is currently not available. [root@host101 ~]# use