Skip to content

Instantly share code, notes, and snippets.

@stmkza
Last active July 3, 2018 04:45
Show Gist options
  • Save stmkza/d6ed606126520f9d1ad0dd809b5f9dbc to your computer and use it in GitHub Desktop.
Save stmkza/d6ed606126520f9d1ad0dd809b5f9dbc to your computer and use it in GitHub Desktop.
自分がサーバを立てるときに最初にする設定(CentOS 7) ref: https://qiita.com/stmkza/items/f655d2815f495901bb2e
alias ls='ls --color=auto -la' 2>/dev/null
sudo firewall-cmd --permanent --service=ssh --add-port=(ポート番号)/tcp
sudo firewall-cmd --permanent --service=ssh --remove-port=22/tcp
sudo yum -y update
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
sudo yum install -y https://centos7.iuscommunity.org/ius-release.rpm
sudo hostnamectl set-hostname (ホスト名)
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
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