0

I don't want user "test" connect to my server with tightvncserver. How I disable this command only for this user, while allowing it for user "myuser"?

What I've done so far:

  • I added user "test"

su

useradd -d /home/test -m test

passwd test

  • I added a group "tightvnc" for users allowed to use tightvncserver (only "myuser")
addgroup tightvnc
usermod -a -G tightvnc myuser
  • I changed permission to tightvncserver

chgrp tightvnc /usr/bin/tightvncserver

chmod o-x /usr/bin/tightvncserver

Now user "test" cannot access tightvncserver ("permission denied"), but neither "myuser" (again "Permission denied") :(

If I do it reports correctly "myuser tightvnc", while gives only "test".

Thank you very much.

0

Try this:

chgrp myuser /usr/bin/tightvncserver
chmod 744 /usr/bin/tightvncserver

That will disable execution for anyone outside of your user group.

From below: try

chgrp tightvnc

instead? And make sure your user is in the tightvnc group, AND make sure you've logged out and logged back in so your group memberships refresh.

  • Thank you for your fast reply! It works with chmod 754, but I don't want to mix permission of myuser with other users giving them the group "myuser". That's why I created another group "tightvnc"... I can't understand why it doesn't work. Maybe there is something else to do somewhere, but I don't know what :( – Fil Jun 15 '15 at 16:48
  • @FIl try chgrp tightvnc instead? And make sure your user is in the tightvnc group, AND make sure you've logged out and logged back in so your group memberships refresh. – Thomas Ward Jun 15 '15 at 16:50
  • "logged out and logged back" <- that's I was missing! Thank you! If you add it as an answer I can accept it. :P – Fil Jun 15 '15 at 16:59

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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