如何使用带有多个参数的radd

时间:2021-08-23 15:49:40

I'm trying to use multiple parameters with the useradd command in linux, and I'm not really sure exactly what I should do?? I have tried the following:

我正在尝试在linux中使用useradd命令使用多个参数,我不确定我应该做什么?我尝试过以下方法:

useradd -b /home/ -g admin -m -p PASSWD -s USERNAME

Needless to say, it doesn't work. Can anyone tell me the correct syntax to get this working? Thanks, your help is always appreciated!

不用说,它不起作用。任何人都可以告诉我正确的语法来实现这一点吗?谢谢,您的帮助永远受到赞赏!

EDIT: I'm not getting an error message, It is just returning the flag variables followed by an ng

编辑:我没有收到错误消息,它只是返回标志变量后跟一个ng

2 个解决方案

#1


0  

The -s flag is for specifying the shell.

-s标志用于指定shell。

So either leave the -s flag out,

所以要么留下-s标志,

useradd -b /home/ -g admin -m  USERNAME

or specify a shell:

或指定一个shell:

useradd -b /home/ -g admin -m -s /bin/bash USERNAME

PS. Don't specify the password on the command line. It would be visible to other users listing the processes. Moreover, specifying the password this way requires you to enter the encrypted password.

PS。不要在命令行上指定密码。列出进程的其他用户可以看到它。此外,以这种方式指定密码需要您输入加密密码。

#2


0  

hmmmm maybe the MAN page: useradd

嗯,也许是MAN页面:useradd

#1


0  

The -s flag is for specifying the shell.

-s标志用于指定shell。

So either leave the -s flag out,

所以要么留下-s标志,

useradd -b /home/ -g admin -m  USERNAME

or specify a shell:

或指定一个shell:

useradd -b /home/ -g admin -m -s /bin/bash USERNAME

PS. Don't specify the password on the command line. It would be visible to other users listing the processes. Moreover, specifying the password this way requires you to enter the encrypted password.

PS。不要在命令行上指定密码。列出进程的其他用户可以看到它。此外,以这种方式指定密码需要您输入加密密码。

#2


0  

hmmmm maybe the MAN page: useradd

嗯,也许是MAN页面:useradd