useradd passwd Adding a user to set a user's password
useradd [用户名]
passwd [用户名]//root为指定用户设置密码
eg: [root@localhost ~]# useradd java[root@localhost ~]# password java-bash: password: command not found
[root@localhost ~]# passwd java
Changing password for user java.
New password:
BAD PASSWORD: The password is shorter than 7 characters
Retype new password:
passwd: all authentication tokens updated successfully.//也可普通用户修改自己密码
eg:[qq@localhost ~]$ passwd
Changing password for user qq.
Changing password for qq.(current) UNIX password:
New password:
Retype new password:
passwd: all authentication tokens updated successfully.