Last active
July 3, 2018 04:45
-
-
Save stmkza/d6ed606126520f9d1ad0dd809b5f9dbc to your computer and use it in GitHub Desktop.
自分がサーバを立てるときに最初にする設定(CentOS 7) ref: https://qiita.com/stmkza/items/f655d2815f495901bb2e
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
| alias ls='ls --color=auto -la' 2>/dev/null |
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
| sudo firewall-cmd --permanent --service=ssh --add-port=(ポート番号)/tcp | |
| sudo firewall-cmd --permanent --service=ssh --remove-port=22/tcp |
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
| sudo yum -y update |
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
| sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm | |
| sudo yum install -y https://centos7.iuscommunity.org/ius-release.rpm |
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
| sudo hostnamectl set-hostname (ホスト名) |
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
| if [ $(id -u) -eq 0 ]; | |
| then | |
| export PS1="[\e[35m\u\e[37m@\e[32m\H\e[0m \W]# " | |
| else | |
| export PS1="[\e[35m\u\e[37m@\e[32m\H\e[0m \W]$ " | |
| fi |
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
| Port (ポート番号) | |
| PermitRootLogin no | |
| PubkeyAuthentication yes | |
| PasswordAuthentication no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment