Enable ssh root login on Arch Linux 2017

Arch Linux Tutorial – Hello everyone, today I will show you how to enable ssh root login on Arch Linux 2017. Please remember that enabling root access via SSH can make your system more vulnerable and it is not recommended from security perspective. On this tutorial I will show you how to install SSH and configure the service on Arch Linux.

Install SSH on Arch Linux

In case you don’t have SSH package installed, you can use this command to install it.

sudo pacman -S openssh

Enable SSH Service

sudo systemctl start sshd

Check SSH Status

[root@archServer]: ~># sudo systemctl status sshd
● sshd.service - OpenSSH Daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2017-08-02 09:13:36 EEST; 8h ago
 Main PID: 596 (sshd)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/sshd.service
           └─596 /usr/bin/sshd -D

Aug 02 09:13:36 archServer systemd[1]: Started OpenSSH Daemon.
Aug 02 09:13:36 archServer sshd[596]: Server listening on 0.0.0.0 port 22.
Aug 02 09:13:36 archServer sshd[596]: Server listening on :: port 22.
Aug 02 09:13:43 archServer sshd[598]: Received disconnect from 10.34.0.154 port 60141:11:  [preauth]
Aug 02 09:13:43 archServer sshd[598]: Disconnected from authenticating user root 10.34.0.154 port 60141 [preauth]
Aug 02 09:13:47 archServer sshd[600]: Accepted password for root from 10.34.0.154 port 60143 ssh2
Aug 02 09:13:47 archServer sshd[600]: pam_unix(sshd:session): session opened for user root by (uid=0)
Aug 02 11:11:06 archServer sshd[712]: Received disconnect from 10.34.0.153 port 61122:11:  [preauth]
Aug 02 17:45:19 archServer sshd[795]: Accepted password for root from 10.34.0.152 port 38366 ssh2

How to enable SSH root login on Arch Linux 2017

By default, root login via ssh is not enabled. We need to change some settings inside the sshd_config file to enable root login.

sudo nano /etc/ssh/sshd_config

Find the following lines and make some changes to it

#PermitRootLogin prohibit-password
PermitRootLogin yes
PasswordAuthentication yes

Close and save the file. Finally restart ssh service

sudo systemctl restart sshd

Now try to login from other computer using root account. Thank you

Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.