Linux批量创建用户
[root@ldapserver ~]# for i in $(seq ) ; do useradd -d /home/ldapuser$i ldapuser#i; done
[root@ldapserver ~]# grep ldapuser /etc/passwd
ldapuser1:x::::/home/ldapuser1:/bin/bash
ldapuser2:x::::/home/ldapuser2:/bin/bash
ldapuser3:x::::/home/ldapuser3:/bin/bash
ldapuser4:x::::/home/ldapuser4:/bin/bash
ldapuser5:x::::/home/ldapuser5:/bin/bash
ldapuser6:x::::/home/ldapuser6:/bin/bash
ldapuser7:x::::/home/ldapuser7:/bin/bash
ldapuser8:x::::/home/ldapuser8:/bin/bash
ldapuser9:x::::/home/ldapuser9:/bin/bash
ldapuser10:x::::/home/ldapuser10:/bin/bash
ldapuser11:x::::/home/ldapuser11:/bin/bash
ldapuser12:x::::/home/ldapuser12:/bin/bash
ldapuser13:x::::/home/ldapuser13:/bin/bash
ldapuser14:x::::/home/ldapuser14:/bin/bash
ldapuser15:x::::/home/ldapuser15:/bin/bash
ldapuser16:x::::/home/ldapuser16:/bin/bash
ldapuser17:x::::/home/ldapuser17:/bin/bash
ldapuser18:x::::/home/ldapuser18:/bin/bash
ldapuser19:x::::/home/ldapuser19:/bin/bash
ldapuser20:x::::/home/ldapuser20:/bin/bash
[root@ldapserver ~]# for i in $(seq ) ; do echo ldapuser$i | passwd --stdin ldapuser$i; done
Changing password for user ldapuser1.
passwd: all authentication tokens updated successfully.
Changing password for user ldapuser2.
passwd: all authentication tokens updated successfully.
Changing password for user ldapuser3.
passwd: all authentication tokens updated successfully.
Changing password for user ldapuser4.
passwd: all authentication tokens updated successfully.
Changing password for user ldapuser5.
passwd: all authentication tokens updated successfully.
Changing password for user ldapuser6.
passwd: all authentication tokens updated successfully.
Changing password for user ldapuser7.
passwd: all authentication tokens updated successfully.
Changing password for user ldapuser8.
passwd: all authentication tokens updated successfully.
Changing password for user ldapuser9.
passwd: all authentication tokens updated successfully.
Changing password for user ldapuser10.
passwd: all authentication tokens updated successfully.
Changing password for user ldapuser11.
passwd: all authentication tokens updated successfully.
Changing password for user ldapuser12.
passwd: all authentication tokens updated successfully.
Changing password for user ldapuser13.
passwd: all authentication tokens updated successfully.
Changing password for user ldapuser14.
passwd: all authentication tokens updated successfully.
Changing password for user ldapuser15.
passwd: all authentication tokens updated successfully.
Changing password for user ldapuser16.
passwd: all authentication tokens updated successfully.
Changing password for user ldapuser17.
passwd: all authentication tokens updated successfully.
Changing password for user ldapuser18.
passwd: all authentication tokens updated successfully.
Changing password for user ldapuser19.
passwd: all authentication tokens updated successfully.
Changing password for user ldapuser20.
passwd: all authentication tokens updated successfully.
怎么从01开始???