DEV Community

Fega Suseno
Fega Suseno

Posted on • Edited on

Allow Root Access SSH on Ubuntu 20.04

Postingan ini akan membahas remote ssh dengan user root pada ubuntu.
By default ubuntu tidak memberikan akses root untuk alasan keamanan. Tetapi kadang hal ini sedikit merepotkan ketika melakukan konfigurasi server via ssh. Sebenarnya ssh bisa kita setting agar dapat di remot melalui user root.

berikut cara konfigurasinya:
Edit file sshd_config

nano /etc/ssh/sshd_config
Enter fullscreen mode Exit fullscreen mode

Kemudian ubah pada bagian port dan permitlogin

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

#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

Enter fullscreen mode Exit fullscreen mode

Simpan ctrl+o dan keluar ctrl+x, lalu set password untuk root user.

passwd root
Enter fullscreen mode Exit fullscreen mode

Masukan passwordnya, setelah itu restart service ssh dan buat autostart service ketika server reboot

systemctl restart ssh
Enter fullscreen mode Exit fullscreen mode
systemctl enable ssh
Enter fullscreen mode Exit fullscreen mode

Lakukan testing dari pc lain dengan user root dan password yang telah di set

ssh root@ip.address
Enter fullscreen mode Exit fullscreen mode

Selamat mencoba.

AWS Q Developer image

Build your favorite retro game with Amazon Q Developer CLI in the Challenge & win a T-shirt!

Feeling nostalgic? Build Games Challenge is your chance to recreate your favorite retro arcade style game using Amazon Q Developer’s agentic coding experience in the command line interface, Q Developer CLI.

Participate Now

Top comments (0)

Redis image

Short-term memory for faster
AI agents

AI agents struggle with latency and context switching. Redis fixes it with a fast, in-memory layer for short-term context—plus native support for vectors and semi-structured data to keep real-time workflows on track.

Start building

👋 Kindness is contagious

Sign in to DEV to enjoy its full potential—unlock a customized interface with dark mode, personal reading preferences, and more.

Okay