LoginSignup
7
4

More than 5 years have passed since last update.

Ubuntuでroot権限でパスワードログインをする

Last updated at Posted at 2018-07-18

概要

AWSでUbuntuで、鍵認証ではなくパスワードログインをしたかったので、rootのパスワードを設定し、パスワードログインを許可する設定を行います。

動作環境

~
$  cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS"

rootのパスワードを生成

~
$ sudo su #root権限になる
$ passwd
Enter new UNIX password: #任意のパスワードを入力
Retype new UNIX password:
passwd: password updated successfully

sshの設定ファイルを変更

/etc/ssh/sshd_config
PermitRootLogin yes
PasswordAuthentication yes

設定ファイルの読み込みます。

~
$ /etc/init.d/ssh restart
[ ok ] Restarting ssh (via systemctl): ssh.service.

別シェルでsshログインをすると、パスワードを聞かれるので、先ほど設定したパスワードを入力します。

~
$ ssh root@***.***.***.*** #サーバーのIPアドレス
7
4
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
4