←back to thread

466 points CoolCold | 1 comments | | HN request time: 0s | source
Show context
kevincox ◴[] No.40212503[source]
> One could say, "run0" is closer to behaviour of "ssh" than to "sudo", in many ways.

This is an interesting offhand comment. You could implement a very similar tool by SSHing to localhost.

replies(5): >>40214944 #>>40215277 #>>40215636 #>>40217356 #>>40217679 #
Arnavion ◴[] No.40215277[source]
Technically `sudo -u` can switch to any user on the system while only a limited few would be allowed as ssh targets. Even root might not be allowed as an ssh target if `PermitRootLogin` is set to `no`, which I do on all my systems.
replies(2): >>40215711 #>>40218852 #
pmontra ◴[] No.40215711[source]
I do use that a lot

  sudo -H -u user bash
after I ssh into a server with my own account. That other user might even be a no login account.
replies(1): >>40216926 #
1. noinsight ◴[] No.40216926{3}[source]
You can just use `-i` instead of `bash`. (This method indeed requires a shell configured, your method is needed with nologin.)