0

I try to remove a user from the group ftp-users because I use the user to upload files to my webserver via my Netbeans IDE and it always changes the group of modified or new created files to ftp-users and then I loose rights to open these files.

# groups myuser

myuser: ftp-users www

# gpasswd -d myuser ftp-users

Removing user myuser from group ftp-users

gpasswd: user 'myuser' is not a member of 'ftp-users'

If I call groups again, then I get:

# groups myuser

myuser: ftp-users www


First I killed the user session with skill -STOP -u myuser. But if I execute groups myuser then the removed group ftp-user is still there. I even rebooted the server.

  • 1
    maybe it's the primary group for that user? – Jeff Schaller Mar 12 at 13:34
  • 1
    id -g or id -gn to check if it is the primary group for user. – Paulo Tomé Mar 12 at 13:36
1

First I switched to the user:

su myuser

Then I checked the primary group

id -gn

ftp-users

So I changed the primary group to www:

sudo usermod -g www myuser

And exited

Now If I call groups myuser I get:

myuser: www

Thanks everyone!

| improve this answer | |
0
gpasswd -d myuser ftp-users

Should do the trick as you've said. But groups can still give the same result even if you removed the user from the group.

Did you logout from myuser and logged in again? This looks like all you need.

| improve this answer | |
  • First I killed the user session with skill -STOP -u myuser. But if I execute groups myuser then the removed group ftp-user is still there. I even rebooted the server. – Black Mar 12 at 13:30
  • Please post this files: /etc/group, /etc/passwd. Log in to your server as root. Make sure there are no other login sessions. Run "groups myuser" and post the output. And then try "gpasswd -d myuser ftp-users" and post the output. – Ali1928 Mar 12 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.