NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

titimoi's avatar
titimoi
Aspirant
May 07, 2017

Restore user account from ssh

Hello dear community,

 

I used to have several users that I created as I recieved the NAS and was experimenting a year ago.

It seems that I removed some user accounts, but I still can see them in passwd, home directory are still there. 

 

 

# getent passwd
[...]
admin:x:98:98::/home/admin:/bin/bash [...]
titimoi:x:100:98:my_email_address@email.com:/home/titimoi:/bin/false
another_user:x:103:98:another_email@email.com:/homeanother_user:/bin/false

and 

# ls /home/
admin another_user  titimoi

Note that I can login to frontview with "another_user" and "titimoi"

In Frontview I see only "admin" in Account > User.

 

Questions :

- can you help me show "titimoi" and "another_account" in frontview so that I can manage then easiely, what file should I have a look at ?

 

Cheers,

 

13 Replies

Replies have been turned off for this discussion
  • kohdee's avatar
    kohdee
    NETGEAR Expert

     

    You should not add users to the admin group as the default. We hide these users from the UI.

    You should change the default group ID of your user to be the same (like user id 100 should have group id 100)

    Then you should use usermod -a -G admin {user}

    Then systemctl restart readynasd 

    That will refresh the UI with your users. 
    We have a middleware that takes care of user accounts so you are essentially bypassing that whole subsystem by using SSH to add users. 

    • titimoi's avatar
      titimoi
      Aspirant

      Thanks a lot for your answer Kohdee, just to make sure that I don't mess things up.

      You advise any user to have the GID 100 (group name: "user") in my case :

      usermod -g 100 titimoi 

       

      and to make it member of the group "admin" with 

      usermod -a -G admin {user}

      Am I right so far ?

       

      Last question, is it normal to have cloud user (email address as login) part of the group admin (98) ? It's my case.

       

      Cheers,

    • titimoi's avatar
      titimoi
      Aspirant

      Thanks for your answer JennC, I actually didn't like the idea to bother anybody directly in PM, but if you think that's what needs to be done to have someone answer my question I'll PM a couple SSH masters.

      • Sandshark's avatar
        Sandshark
        Sensei - Experienced User

        It's an odd situation.  When you deleted the accounts, the home folders and password entries should have been deleted.  And you say you can log into Frontview with those accounts, or was that a typo?  I suppose that could be because Frontview only checks the passwd file for log-in.

         

        What happens if you try to re-create the user using the same UID as shown in passwd?

         

        I did a quick look in /etc and /frontview and the only places other than etc/passwd, etc/shadow, and their backups (-passwd & -shadow) I can find my user name is ./etc/frontview/user_hf_settings.conf.  passwd and shadow are standard Linux files and contain lots of user names, so obviously aren't where Frontview gets the name list for user management.  user_hf_settings.conf contains only the users added from Frontview (and not admin, either), and it contains information that only Frontview needs to know (snapshot protection, snapshot access).  So,I thought maybe that's where Frontview gets that list, but that din't seem to work out with a couple of quick experiments I ran.

         

        Before you go any further, insure your backup is up to date.  Messing with the OS at this level can lock you out where a factory default is the only recourse.

         

        You can look in other directories with grep -Rl "another_user" to see if you find something I didn't.  The -R is recursive, so I don't recommend you do this from the root directory.  The l is a lower case letter L and give you the file name instead of the text.

         

        If you can't find it, then the only other suggestion I have is to delete the entries in the other files and the home directories and see if you can then re-create the user.  Backup files before editing.

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More