Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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
@ysaotome

This comment has been minimized.

Copy link
Owner Author

@ysaotome ysaotome commented Jul 18, 2013

サーバの新規作成時や起動時に下記画面に「change_root_password.sh」の記載内容をコピー&ペーストで再起動

起動時スクリプト入力画面

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.