我找不到如何使用命令加载项和选项。假设我想添加bob并将shell更改为/bin/bash,那么命令会是什么样的呢?
发布于 2019-12-15 15:09:07
通过键入man adduser查看该程序的手册页。在OPTIONS部分中,它的内容如下:
--shell SHELL
Use SHELL as the user's login shell, rather than the default specified by the configuration file.因此,您的命令将类似于adduser --shell /bin/bash bob。此外,您可以在大多数系统上创建用户并在/etc/passwd中修改其默认登录外壳。示例:
root:x:0:0:root:/root:/bin/bash哪里
{user}:{password}:{user id number}:{user's group id number}:{full name of user}:{home directory}:{login shell}在这种情况下,您需要修改{login }部分。这
bob:x:123:123:Bob_McBob:/home/bob:/bin/sh变成这样:
bob:x:123:123:Bob_McBob:/home/bob:/bin/bash祝你今天愉快!
发布于 2019-12-15 15:04:47
# useradd -m -s /bin/bash bob
# passwd bob最好不要通过useradd -p password将密码添加为CLI,以避免历史读取。
检查
useradd -hhttps://unix.stackexchange.com/questions/557355
复制相似问题