LoginSignup
6
6

More than 5 years have passed since last update.

さくらVPS サーバー初期設定

Last updated at Posted at 2014-07-28

環境

# cat /etc/redhat-release
CentOS release 6.5 (Final)
# uname -a
Linux XXXXX 2.6.32-431.20.5.el6.x86_64 #1 SMP Fri Jul 25 08:34:44 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

visudo

#visudo
## Allows people in group wheel to run all commands
%wheel  ALL=(ALL)       ALL   #コメントアウト

user作成

#useradd XXX
#passwd  XXX
#usermod -G wheel XXX

ssh鍵

$cd
$mkdir .ssh
$chmod 700 .ssh
$cd .ssh
$ssh-keygen -t rsa -v
$mv id_rsa.pub authorized_keys

id_rsa を接続したいPCに保存

sshの設定

# diff sshd_config sshd_config.org
13c13
< Port XXXX
---
> #Port 22
42c42
< PermitRootLogin no
---
> #PermitRootLogin yes
66c66
< PasswordAuthentication no
---
> PasswordAuthentication yes

再起動

# service sshd restart

local

Host XXXX
    HostName XXXX
    User XXX
    Port XXXX
    IdentityFile ~/.ssh/id_rsa

ログイン

$ssh XXXX

httpd インストール

#yum -y install httpd

logwatch インストール

#yum install logwatch
#logwatch --print
#logwatch --mailto foo@example.com

設定

/etc/logwatch/conf/logwatch.conf

MailTo=foo@example.com

DenyHostsのインストール

#yum install denyhosts
#service denyhosts start
#chkconfig denyhosts on
6
6
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
6
6