Warning: Undefined array key "cperpage" in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 255

Warning: Undefined variable $output in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 325

Warning: Undefined variable $fixed_tags in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 326

Warning: Undefined variable $isshowdots in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 327

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 330

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 333

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 336

Warning: Undefined variable $post in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345

Warning: Attempt to read property "ID" on null in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345

Warning: Undefined variable $post in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345

Warning: Attempt to read property "ID" on null in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345

Warning: Undefined variable $more_text_link in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345
useradd – 理想社会

标签: useradd

  • Linux下批量创建删除账号

    1、批量创建用户

    cat adduser.sh 
    #!/bin/bash
    #
    for username in $(more users.list)
    do
    if [ -n $username ]
    then
    useradd $username -g student -d /pub/home/$username
    echo
    echo $username"xyz" | passwd --stdin $username
    chage -d 0 $username
    echo $username "has been created!"
    else
    echo "The username is null!"
    fi
    done

    2、批量删除用户

    cat deluser.sh 
    #!/bin/bash
    #
    for username in $(more users.list)
    do
    if [ -n $username ]
    then
     userdel $username
     echo
     echo $username "has been deleted!"
    else
     echo "The username is null!"
    fi
    done
    

    3、创建users.list,将需要批量创建的有用户填入,一行一个。