7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

サーバーの初期設定

7
Last updated at Posted at 2015-09-07

yumを最新状態にする

sudo yum update -y

使用言語を日本語に設定

sudo cp /etc/sysconfig/i18n /etc/sysconfig/i18n.org
sudo vim /etc/sysconfig/i18n
/etc/sysconfig/i18n
LANG="ja_JP.utf-8"

SYSFONT="latarcyrheb-sun16"

サーバーに時間変更(日本時間)

sudo mv /etc/localtime /etc/localtime.org
sudo ln -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime

再度ログインで日本語化(dateで確認)

タイムゾーンを変更したらcrondを再起動しないと反映されない

-sudo service crond restart

サーバーのホスト名を変更する

sudo cp /etc/sysconfig/network /etc/sysconfig/network.org
sudo vim /etc/sysconfig/network
/etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=sample.abgata.org

hostsの設定

sudo cp /etc/hosts /etc/hosts.org
sudo vim /etc/hosts
/etc/hosts
127.0.0.1 sample.abgata.org localhost.localdomain

設定後はネットワークを再起動

sudo /etc/rc.d/init.d/network restart

ユーザーを追加

useradd myuser
passwd myuser

usermod -G wheel myuser

ユーザーにsudo権限を付与

cp /etc/sudoers /etc/sudoers.org

visudo
visudo
# %wheel ~~
# ↓
%wheel ~~

※一番最初のもの

sshの設定を変更

cp /etc/ssh/sshd_config /etc/ssh/sshd_config.org

vim /etc/ssh/sshd_config

/etc/ssh/sshd_config
Port YOUR_PORT_NUMBER
PasswordAuthentication yes
PermitRootLogin no
PubkeyAuthentication yes

sshdを再起動して設定を反映

service sshd restart

SSH接続してみる

ssh -p YOUR_PORT_NUMBER myuser@192.168.10.10
7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?