Skip to content

Disable empty root login, root ssh login - #297

Open
dodoradio wants to merge 1 commit into
AsteroidOS:masterfrom
dodoradio:disable-root-login
Open

Disable empty root login, root ssh login#297
dodoradio wants to merge 1 commit into
AsteroidOS:masterfrom
dodoradio:disable-root-login

Conversation

@dodoradio

Copy link
Copy Markdown
Contributor

Yocto will set an invalid root password, disallowing any password login. Root login will also be disabled in sshd_config

For usecases where it's needed, root empty password can be re-enabled by running:
sudo passwd -d root

root ssh login can be reenabled with:
sudo sed -i 's/^[#[:space:]]PermitRootLogin./PermitRootLogin yes/' /etc/ssh/sshd_config

Yocto will set an invalid root password, disallowing any password login.
Root login will also be disabled in sshd_config

For usecases where it's needed, root empty password can be re-enabled by
running:
sudo passwd -d root

root ssh login can be reenabled with:
sudo sed -i 's/^[#[:space:]]*PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
@MagneFire

Copy link
Copy Markdown
Member

Have you tested this with adb shell as well?

Also, what's your reason for this change?

@beroset

beroset commented Jul 27, 2026

Copy link
Copy Markdown
Member

Would su - would still work as the ceres user?

@dodoradio

Copy link
Copy Markdown
Contributor Author

I have tested this with adb shell. adb shell continues to give root access.
The reasoning behind this change has been discussed a lot, but to summarise it here:

  • it's a basic security practice on every consumer linux distro
  • it encourages better security practices for our users, a large proportion of whom are having their first experience with linux through asteroidos
  • it has few drawbacks (the most meaningful ones are the small inconvenience to developers, for whom the revert commands above are provided)

I'm proposing this as part of an effort to improve security just the tiniest bit, so that we can then add a WiFi UI. The previous step was adding sudo, the next step is to figure out some kind of UI for enabling/disabling remote login, through mechanisms such as disabling the SSH daemon, or adding a UI for setting a user password.

@dodoradio

dodoradio commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Would su - would still work as the ceres user?

no. sudo was added yesterday as a safer alternative

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants