useradd tomcat -s /sbin/nologin -M -s:指定用户登入后所使用的shell。 -M:不要自动建立用户的登入目录。 转载于:https://my.oschina.net/u/1433006/blog/1608360