Last active
January 19, 2017 07:36
-
-
Save ysaotome/6026594 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# File:change_root_password.sh | |
# 2013/07/18 @ysaotome | |
#=============================================== | |
#設定したいrootパスワード「hoge##123」の部分を改変 | |
#=============================================== | |
ROOT_PASSWORD='hoge##123' | |
#=============================================== | |
SALT=$(/usr/bin/uuidgen| /usr/bin/tr -d '-') | |
/usr/sbin/usermod -p $(/usr/bin/perl -e 'print crypt(${ARGV[0]}, ${ARGV[1]})' ${ROOT_PASSWORD} ${SALT}) root | |
# /usr/bin/curl https://github.com/ysaotome.keys >> /root/.ssh/authorized_keys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
サーバの新規作成時や起動時に下記画面に「change_root_password.sh」の記載内容をコピー&ペーストで再起動