MariaDB: root access from network means also from SSH?

Viewed 516

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.

2 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.

Disallow root login remotely? [Y/n]

That's from MariaDB perspective, NOT the SSH. When you are login via SSH and then login to MariaDB via mysql cli to localhost server, MariaDB assume that you login "locally".

As like many other RDBMS, MariaDB allow to login remotely, in your case without SSH, to any remote server via TCP/IP. This kind of login to MariaDB is the meaning about above question.

Example: You are now at Host A (IP: 192.168.0.10). The MariaDB server at Host B (IP: 192.168.0.11). If you are accessing the MariaDB server via mysql client cli and execute:

mysql -h192.168.0.11 -uroot -p

That's called "root login remotely"

Related