Delete a user via ssh

Permissions, domain/LDAP, power, security, notification and more.
User avatar
TMRyan
TerraMaster Team
Posts: 817
Joined: 01 Dec 2020, 11:50

Re: Delete a user via ssh

Post by TMRyan »

When you backed up your system configuration, which version of TOS did you use? We need to verify your question. To completely remove information about undisplayable users, you need to reinstall the system.
To contact our team, please send email to following addresses, remember to replace (at) with @
Technical team: support(at)terra-master.com (for technical support)
Service team: service(at)terra-master.com (for purchasing, return, replacement)
User avatar
capnhowyoudo
Posts: 24
Joined: 08 Mar 2022, 12:52

Re: Delete a user via ssh

Post by capnhowyoudo »

Verify my information ? what does that mean? seriously its a simple question HOW DO YOU DELETE A USER VIA SSH????????

What is so complicated about that? is it similar to:

1. sudo su -
2. userdel user's username

Seriously what the heck is so complicated about giving an answer like that?
TNAS F4-210
TOS 4.2.30-2203011626
4X WD Red Plus 8TB (RAID5)
User avatar
capnhowyoudo
Posts: 24
Joined: 08 Mar 2022, 12:52

Re: Delete a user via ssh

Post by capnhowyoudo »

Do you see i even drew pictures for you!!!!!

I can login with the account "admin" which i created not to be confused with "Administrator" however the account "admin" does not exist in the user options therefore i can not assign permissions to a user that does not exist nor can i delete the user cause it does not exist.
Attachments
2022-03-20_19h41_00.png
TNAS F4-210
TOS 4.2.30-2203011626
4X WD Red Plus 8TB (RAID5)
User avatar
TMSupport
TerraMaster Team
Posts: 2314
Joined: 13 Dec 2019, 15:15

Re: Delete a user via ssh

Post by TMSupport »

Did the device reboot after restoring the configuration? Normally, the situation you describe should not occur. You can try to restart the device to verify whether the admin account can still be used normally. If it still exists, you can contact our tech team to check remotely.
To contact our team, please send email to following addresses, remember to replace (at) with @
Technical team: support(at)terra-master.com (for technical support)
Service team: service(at)terra-master.com (for purchasing, return, replacement, RMA service)
User avatar
TM220user
Posts: 18
Joined: 01 Mar 2022, 23:08

Re: Delete a user via ssh

Post by TM220user »

TMnorah wrote: 19 Mar 2022, 14:36 The terminal command line cannot delete the TOS user,it can only be deleted on the web page. You can create a user with the same name on the web page, change the permissions of the shared folder, and then delete the user.
There HAS TO BE a command available in SSH for removing users manually....I mean, the command to add users works perfectly fine in SSH (sudo useradd <user name >).

While *yes*, users can be "removed" (technically not accurate; as I have several past users showing up in shell when I run the command "ls -l /home", who ARE NOT displayed in the user's list in the TOS GUI for 'Control Panel > Users'), they are not ACTUALLY being removed.
More like: only hidden from the GUI.

Don't you guys consider this a security problem?

Why won't you provide us (your customers) with the command line to manually REMOVE a user using the shell (via SSH in other words)??

'Userdel' obviously has been disabled, or is not the correct syntax for the command.

Please provide the command to remove/delete a user account.

Thank you.
F2-220 (x86 flavored!)
User avatar
TM220user
Posts: 18
Joined: 01 Mar 2022, 23:08

Re: Delete a user via ssh

Post by TM220user »

{L_BUTTON_AT}capnhowyoudo

Hey capn...
After a bit of searching (when I found out that 'userdel' doesn't work in TOS), I did a Google search (force-omitting 'userdel' from results) and found this Ubuntu command worked:

'deluser'

IE: sudo deluser <username>

Your situation may be different from mine (mine has user accounts listed [several with root privileges] that were manually removed via the GUI, but persist in the shell data somewhere), but the command works *as long as* it's an active, current user!

My problem is, I still have users that need to be removed, and because they are not active users (having been previously removed using the TOS GUI), the 'deluser' command doesn't work (for me).

Best of luck, and I hope this helps you!
F2-220 (x86 flavored!)
User avatar
TM220user
Posts: 18
Joined: 01 Mar 2022, 23:08

Re: Delete a user via ssh

Post by TM220user »

OK, I clearly need to apologize here.
TM220user wrote: 26 Apr 2022, 10:49 I have several past users showing up in shell when I run the command "ls -l /home", who ARE NOT displayed in the user's list in the TOS GUI for 'Control Panel > Users'), they are not ACTUALLY being removed.
More like: only hidden from the GUI.

Don't you guys consider this a security problem?
Like a dog fixated on a bone (oblivious to the rest of the world), I wasn't thinking clearly. And as a result, lept to the wrong conclusions.

Thinking more about it, the entire purpose of the above command is to list home directories.
NOT active users. /sigh

I'm profusely sorry for posting in such haste.
Please forgive me!

I did get the appropriate directories removed, and all is well on that front. (Still looking into the user issue, but won't risk commenting further until I'm SURE of the situation.)

I'm still curious though why the support team couldn't simply say before that the base command to remove a user via SSH is "deluser"?

And for posterity, the base command to remove a group via SSH is similar: "delgroup".

Additionally @TMSupport: why aren't user home groups (and all other data recursively) deleted (by default) when you remove a user account using the GUI?
F2-220 (x86 flavored!)
User avatar
capnhowyoudo
Posts: 24
Joined: 08 Mar 2022, 12:52

Re: Delete a user via ssh

Post by capnhowyoudo »

{L_BUTTON_AT}capnhowyoudo
TM220user wrote: 26 Apr 2022, 14:09 Hey capn... After a bit of searching (when I found out that 'userdel' doesn't work in TOS), I did a Google search (force-omitting 'userdel' from results) and found this Ubuntu command worked: 'deluser' IE: sudo deluser <username> Your situation may be different from mine (mine has user accounts listed [several with root privileges] that were manually removed via the GUI, but persist in the shell data somewhere), but the command works *as long as* it's an active, current user! My problem is, I still have users that need to be removed, and because they are not active users (having been previously removed using the TOS GUI), the 'deluser' command doesn't work (for me). Best of luck, and I hope this helps you!
Thanks for the information! When I get home today I’ll give this a try and keep you updated ! Thanks again!
TNAS F4-210
TOS 4.2.30-2203011626
4X WD Red Plus 8TB (RAID5)
User avatar
TM220user
Posts: 18
Joined: 01 Mar 2022, 23:08

Re: Delete a user via ssh

Post by TM220user »

capnhowyoudo wrote: 26 Apr 2022, 21:25 Thanks for the information!

When I get home today I’ll give this a try and keep you updated !

Thanks again!
How'd things work out for you?
F2-220 (x86 flavored!)
Locked