-1

I recently bought a VPS with Ubuntu 18.04 (Server) on it, and ever since I've started using it I've been spammed by one of my friends regarding that he wants an account. I wanna take some revenge on the spamming by pulling a prank on him by creating an account that has no access to any binary file/command, the goal is to make his account only be able to write in the command line but really have no access to execute any commands. His account won't be added to the sudoers list.

Is there any way to achieve this?

Thanks, Richard.

3
  • Possibly related: Simple & easy way to jail users Commented Jul 27, 2018 at 16:51
  • Using bash -r with an empty PATH might work.
    – wjandrea
    Commented Jul 27, 2018 at 19:46
  • Cheers for that link, was really helpful! Thanks!
    – iHack
    Commented Jul 29, 2018 at 9:35

1 Answer 1

-1

You might make his login shell a script that has an empty PATH variable. Don't know if it will work, but it might get you started.

4
  • how to do so ?? Commented Jul 27, 2018 at 17:08
  • It was a very nice idea, however the user can still export their own environment variables using export.ibb.co/i8b9to
    – iHack
    Commented Jul 27, 2018 at 17:09
  • Even if you prevent him from setting his own PATH, he would still be able to call programs using their full path (e.g. /bin/ls).
    – wjandrea
    Commented Jul 27, 2018 at 19:36
  • So @wjandrea, is there a way to restrict the permissions from that user (as root) to access the binary files?
    – iHack
    Commented Jul 28, 2018 at 4:14

Not the answer you're looking for? Browse other questions tagged .