[TUTO] Enable SSH root access on fw >4.2.11

Discussion on apps, protocols, APIs, specifications, and more. You are welcome to join us as a TOS app developer!
Post Reply
User avatar
outkastm
Posts: 1185
Joined: 29 Dec 2020, 23:52

[TUTO] Enable SSH root access on fw >4.2.11

Post by outkastm »

This how to switch ssh access from admin to root on TOS fw >4.2.11.
Note that this is not recommended but some experienced users prefer the ssh root access

Connect via ssh to NAS using the user admin, then type

Code: Select all

sudo vi /etc/ssh/sshd_config
Enter you admin password and the ssh config file will open with vi editor
To be able to edit the file, we need to change vi in edit mode.
For that press on i
Now scroll down to this line

Code: Select all

PermitRootLogin no
and adapt it to

Code: Select all

PermitRootLogin yes
Scroll down more to this line

Code: Select all

AllowUsers admin
and adapt it to

Code: Select all

AllowUsers root
Now pres ESC key to exit from edit mode
To save and close the file, type :wq
Now reboot the NAS or from TOS WebUI disable and enable back ssh

Code: Select all

sudo reboot
Open new ssh connection and now you can connect with root
User avatar
1dimitri
Posts: 18
Joined: 30 Jun 2021, 19:25

Re: [TUTO] Enable SSH root access on fw >4.2.11

Post by 1dimitri »

Small typo:
connect as the first user you created during the TOS installation
and in the file search for that word not "admin".

E.g. if your 1St user was "adminaccount", log on as "adminaccount" and search for "adminaccount"

BTW, it is also a small precaution against script kiddies not to call own's administrator, admin, if possible ;)
User avatar
Saijin_Naib
Posts: 79
Joined: 23 Jun 2021, 01:19

Re: [TUTO] Enable SSH root access on fw >4.2.11

Post by Saijin_Naib »

If I made the mistake of using admin as my first account, can I change it now without breaking things?
User avatar
1dimitri
Posts: 18
Joined: 30 Jun 2021, 19:25

Re: [TUTO] Enable SSH root access on fw >4.2.11

Post by 1dimitri »

Support has to confirm
1. what will happen if you're using the (Windows) Application to search and connect to the NAS as there is a login button and a way to install the OS when the server is just unpacked, but I do not know what happen if tried on an already installed server
2. If there is a way to change the name using SSH and/or the Users part of the control panel
3. If there is a way endorsed by the Terramaster to do it using Linux Commands through SSH.
User avatar
outkastm
Posts: 1185
Joined: 29 Dec 2020, 23:52

Re: [TUTO] Enable SSH root access on fw >4.2.11

Post by outkastm »

Not required anymore if you use OkmSSHD app.
Post Reply