vine-logo.png

Vine Linux5.1



SSH root ユーザの許可

Vine は初期状態では ssh でのログインに root ユーザが許可されていません。セキュリティ上はとても好ましい設定だとは思いますが、内部で検証用に作る身としては使えないのはとても不便です。故に root ユーザでもログインできるように設定変更します。
※ これはあくまでも検証用の環境を作っているので変更しますが、それ以外の時には root ユーザは許可しないままの方を推奨します。

sshd_config


デスクトップ上のコンピュータを開きます。
ssh-001.png


ファイルシステムを開きます。
ssh-002.png


/etc/ ( " etc ディレクトリ " )を開きます。
ssh-003.png


/SSH/ ( " SSH ディレクトリ " )を開き、" sshd_config " と名前の付いたファイルをさがします。
ssh-004.png


sshd_config を何かエディタで開きます。
まだ Linux に余り馴染んでないユーザでしたら、アクセサリ → leafpad が、Windows のメモ帳感覚で使いやすいかもしれません。

ssh-005.png


PermitRootLogin の変更

/etc/ssh/sshd_config をエディタで開くと以下のように書かれていますから、赤い矢印の箇所 " PermitRootLogin no " を " PermitRootLogin yes " と書き換えて、上書き保存します。編集はこれで終了です。
上書き保存をしたら、後はもう一度 sshd を再起動します。
端末から再起動をさせる場合は、 " # service sshd restart " と入力してEnterキーを押せば、 sshd だけを再起動させることができます。

# $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $

# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

# Disable legacy (protocol version 1) support in the server for new
# installations. In future the default will change to require explicit
# activation of protocol 1
Protocol 2

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 1024

# Logging # obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin yes
PermitRootLogin no     ← no を yes に変更
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
- - - - - - - - - - - - - - - - - 以下略

・・・で、これで何が出来るのよ? って・・・・?
例えば、ログイン画面で " root ユーザ " で直接ログインすることができるようになったり・・・・・?
例えば、Vine Linux 上で、他のユーザで入っても su して" root ユーザ " になり、一般ユーザでは設定できないことができたり・・・・?
例えば、" root ユーザ " で Windows側から Tera Term などで入って、一般ユーザでは使えないコマンドで編集・操作ができるとか・・・?
例えば、" root ユーザ " で WinSCP などを使って、一般ユーザでは入れない場所に入って、ファイルのやりとりができるとか・・・・?





上にもどる