0

Just logged back into a server and reconnected to an existing screen using screen -R. I had completely forgotten that I'd used sudo su - earlier and had not exited afterwards, so when I reconnected via screen I was back in as root!

Is there any way to block sudo su while in screen, or to prevent in some way the ability to reconnect to root via screen?

Or do I just have to be very mindful of using sudo su while using screen?

Jordan Reiter
  • 1,290
  • 4
  • 20
  • 40

1 Answers1

2

You need to be mindful of what you're doing. Also be aware of who has access to your screen sessions. That should only be you, unless you are sharing an account.

I leave sessions open with root access without concern using my own account.

And if you allow sudo su - without a password from your account, screen should be the least of your concerns.

baumgart
  • 2,483
  • 18
  • 17
  • Yeah no worries on that account! sudo su requires a password. I'm not doing this: http://www.reddit.com/r/PHP/comments/1l7baq/creating_a_user_from_the_web_problem/ – Jordan Reiter Feb 27 '14 at 14:44
  • After further reflection, since the only way to get to those screen sessions is to log in as me, that person could still just run `sudo su` themselves. Assuming they can guess my password. EDIT: The password is 7&8fortytwoNINE! That's secure enough, right? – Jordan Reiter Feb 27 '14 at 14:57