Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MariaDB: root access from network means also from SSH?

During the securing of MariaDB it asks me the following question:

Disallow root login remotely? [Y/n]

Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.

Because I'm working on a headless server (Ubuntu Server) without any screen nor keyboard, my only way to reach the o.s. is via SSH.

Disabling the remote root login will prevent me to access from SSH as well? I guess yes, and I kept the remote login enabled.

like image 247
Mark Avatar asked Sep 05 '25 04:09

Mark


1 Answers

It's the default admin account of MariaDB, has same name with system root account, but there's no direct relationship between them. System user bob can also use command mysql -uroot -p to connect MariaDB with admin privilege.

login remotely means connecting to MariaDB remotely using port 3306. if remote login is enabled for root and MariaDB bind a public IP, anyone can try to connect to your DB by mysql -uroot -hIP. then a security incident happened if weak password used.

like image 71
emptyhua Avatar answered Sep 07 '25 23:09

emptyhua