This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 使い方: ./useradd_scirpt.sh username password | |
# 注意: XXXXXX の部分を mysql のrootパスワードに置き換えてください。 | |
useradd -G wheel $1 | |
echo $2 | passwd --stdin $1 | |
su $1 -c "ssh-keygen" | |
su $1 -c "touch ~/.ssh/authorized_keys" | |
su $1 -c "mkdir ~/public_html/" | |
su $1 -c "chmod 0777 ~/public_html/" | |
ln -s /home/$1/public_html /var/www/html/$1 |
OlderNewer