Last active
September 27, 2018 04:18
-
-
Save masayuki-tsuji/907b1d3a9643c10034103d4ac2d63451 to your computer and use it in GitHub Desktop.
AWSにsshログインした時にスライムを出現するようにしてみた。 ref: https://qiita.com/tu-kun/items/d38452161bfb9da54bcd
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
[ec2-user@ip-172-000-11-222 ~]$ sudo su # rootユーザにスイッチ | |
[root@ip-172-000-11-222 ec2-user]# cat /etc/motd | |
__| __|_ ) | |
_| ( / Amazon Linux AMI | |
___|\___|___| | |
https://aws.amazon.com/amazon-linux-ami/2018.03-release-notes/ | |
13 package(s) needed for security, out of 23 available | |
Run "sudo yum update" to apply all updates. |
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
[root@ip-172-000-11-222 ec2-user]# cat /etc/update-motd.d/30-banner | |
#!/bin/sh | |
version=$(rpm -q --qf '%{version}' system-release) | |
cat << EOF | |
__| __|_ ) | |
_| ( / Amazon Linux AMI | |
___|\___|___| | |
https://aws.amazon.com/amazon-linux-ami/$version-release-notes/ | |
EOF |
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
[root@ip-172-000-11-222 ec2-user]# cat /etc/update-motd.d/30-banner | |
#!/bin/sh | |
version=$(rpm -q --qf '%{version}' system-release) | |
curl -s "https://gist.githubusercontent.com/makocchi-git/9775443/raw/02e67ad144bd9ab5b71472e46e9a553d49f413d4/slime.txt" # 調達したスライムのURLを設定する。 | |
cat << EOF | |
https://aws.amazon.com/amazon-linux-ami/$version-release-notes/ | |
EOF |
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
[root@ip-172-000-11-222 ec2-user]# /bin/bash /etc/update-motd.d/30-banner |
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
[root@ip-172-000-11-222 ec2-user]# update-motd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment