关于pw添加用户的一个疑问
时间:2003-11-29
来源:互联网
作者: lhmwzy 发布时间: 2003-11-29
作者: devel 发布时间: 2003-11-29
不会再用passwd lhmm来设一个密码吧。
这样的话,pw还不如useradd来的方便呢
作者: lhmwzy 发布时间: 2003-11-29
作者: lhmwzy 发布时间: 2003-11-29
from man pw:
-h fd This option provides a special interface by which interac-
tive scripts can set an account password using pw. Because
the command line and environment are fundamentally insecure
mechanisms by which programs can accept information, pw
will only allow setting of account and group passwords via
a file descriptor (usually a pipe between an interactive
script and the program). sh, bash, ksh and perl all pos-
sess mechanisms by which this can be done. Alternatively,
pw will prompt for the user's password if -h 0 is given,
nominating stdin as the file descriptor on which to read
the password. Note that this password will be read only
once and is intended for use by a script rather than for
interactive use. If you wish to have new password confir-
mation along the lines of passwd(1), this must be imple-
mented as part of an interactive script that calls pw.
If a value of `-' is given as the argument fd, then the
password will be set to `*', rendering the account inacces-
sible via password-based login.
作者: werix 发布时间: 2003-11-29
作者: lhmwzy 发布时间: 2003-11-29
假设你有500新学生入学,你要给每个人都建立一个账号,作为管理员的你该怎么办?正常的办法是写一个script (脚本?),先把每个人的账号一下都建立起来,但是不给定密码,给学生们半天的时间,让他们上机自己给密码,如果有人捣乱抢先的话,你再重新设制被抢账号。PW 的作用是让你写script,useradd/adduser 一类是加一两个人时用。man pw , -h 选项让你可以执行script的同时问你要给定的密码,这样可以防止抢账号。清楚了嘛?
作者: werix 发布时间: 2003-11-29
作者: lhmwzy 发布时间: 2003-11-29
作者: rianren 发布时间: 2003-11-29
作者: lhmwzy 发布时间: 2003-11-29
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28