ubuntu中出现:passwd: unrecognized option '--stdin'
1、redhat(centos)中
[root@localhost Desktop]# hostnamectl Static hostname: localhost.localdomain Icon name: computer Chassis: n/a Machine ID: 7dcb3b04ae354b138b8a02219c0e5dcb Boot ID: ca65b9702b0e49e499e3a708f28d3a57 Virtualization: vmware Operating System: Red Hat Enterprise Linux Server 7.0 (Maipo) CPE OS Name: cpe:/o:redhat:enterprise_linux:7.0:GA:server Kernel: Linux 3.10.0-123.el7.x86_64 Architecture: x86_64 [root@localhost Desktop]# echo "123456" | passwd --stdin liujiaxin01 ## 修改用户密码为123456 Changing password for user liujiaxin01. passwd: all authentication tokens updated successfully.
2、ubuntu中
root@ubuntu01:/home/test# hostnamectl Static hostname: ubuntu01 Icon name: computer-vm Chassis: vm Machine ID: 5bf1e11dc02047718a7a7146b52f9b07 Boot ID: 6e92c587f51e49118fc99d79d86d8a5c Virtualization: vmware Operating System: Ubuntu 20.04.4 LTS Kernel: Linux 5.13.0-37-generic Architecture: x86-64 root@ubuntu01:/home/test# echo "123456" | passwd --stdin liujiaxin01 ## 无法使用此命令进行修改 passwd: unrecognized option '--stdin' Usage: passwd [options] [LOGIN] Options: -a, --all report password status on all accounts -d, --delete delete the password for the named account -e, --expire force expire the password for the named account -h, --help display this help message and exit -k, --keep-tokens change password only if expired -i, --inactive INACTIVE set password inactive after expiration to INACTIVE -l, --lock lock the password of the named account -n, --mindays MIN_DAYS set minimum number of days before password change to MIN_DAYS -q, --quiet quiet mode -r, --repository REPOSITORY change password in REPOSITORY repository -R, --root CHROOT_DIR directory to chroot into -S, --status report password status on the named account -u, --unlock unlock the password of the named account -w, --warndays WARN_DAYS set expiration warning days to WARN_DAYS -x, --maxdays MAX_DAYS set maximum number of days before password change to MAX_DAYS
ubuntu中可以使用:
root@ubuntu01:/home/test# hostnamectl Static hostname: ubuntu01 Icon name: computer-vm Chassis: vm Machine ID: 5bf1e11dc02047718a7a7146b52f9b07 Boot ID: 6e92c587f51e49118fc99d79d86d8a5c Virtualization: vmware Operating System: Ubuntu 20.04.4 LTS Kernel: Linux 5.13.0-37-generic Architecture: x86-64 root@ubuntu01:/home/test# echo liujiaxin01:123456 | chpasswd
参考:https://blog.csdn.net/suyues/article/details/100027634
分类:
linux shell
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
2021-03-27 c语言中输入数组元素的值