Skip to content

Instantly share code, notes, and snippets.

@float-tw
Last active December 21, 2015 06:19
Show Gist options
  • Save float-tw/6263763 to your computer and use it in GitHub Desktop.
Save float-tw/6263763 to your computer and use it in GitHub Desktop.
#!/bin/bash
passwd_name=test.passwd
home_root=/tmp
touch $home_root/$passwd_name
while read user_info
do
name=$(echo $user_info | awk '{print $1}')
pw=$(echo $user_info | awk '{print $2}')
echo "\"$name\""
echo "\"$pw\""
echo $pw | ftpasswd --passwd --file=$home_root/$passwd_name --name $name --uid=1000 --gid=1001 --home=$home_root/$name --shell=/bin/false --stdin
chmod 600 $home_root/$passwd_name
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment