5 ms·
> 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 simila
by kevincox 2y ago
> 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.
- __s 2y agoIndeed, there was a blog by a redhat engineer doing that: https://tim.siosm.fr/blog/2023/12/19/ssh-over-unix-socket https://tim.siosm.fr/blog/2023/12/19/ssh-over-unix-socket
- Arnavion 2y agoTechnically `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.
- pmontra 2y agoI 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.
- noinsight 2y agoYou can just use `-i` instead of `bash`. (This method indeed requires a shell configured, your method is needed with nologin.)
- fsckboy 2y ago>Even root might not be allowed as an ssh target if `PermitRootLogin` is set to `no`, which I do on all my systems. would something like PermitRootLogin=localhost punch an enormous hole in your intricate opsec?
- jimbobthrowawy 2y agoI've set up tor on some machines to forward ssh as a hidden service for an easy to configure way to get past NAT before. That shows up as a login from localhost. (could be configured differently, with some extra work) There's so ways to configure access to a system, each with footguns I'm surely unaware of.
- deleted 2y ago[deleted]
- yegle 2y agoIn my previous job, we set up a privileged account on a server with shell set to `git-shell`, leave some shell scripts in $HOME, so that we can do: > ssh user@privileged-commands ./do-something
- m463 2y agoI had to write an ssh client for an embedded system long ago. Looking at the design, I found it to be sort of messy. You could restrict commands ssh could invoke, but it didn't seem super secure. Also scp/sftp was not well designed. You basically had to give ssh access to your system to allow a file to be copied, and there were no real path restrictions. I personally thought ssh could be much more robust in what you could run and what you couldn't. And scp/sftp could have better filesystem semantics so you could have more security in what you could access. And I thought having a write-only scp would be really interesting, sort of like a dropbox for people to send you files securely, but not have to give someone ssh credentials to do it. And an anoymous scp/sftp for distribution or a dropbox could have been really interesting too.
- metalspoon 2y agoWell, yes, rsync to replace scp. Sftp's also regarded a hack anyway imho. The write-only scp intrigues me. I guess it's not hard to write a program to do that. But, right, that's not easy with standard tools only. The Linux file system was also not designed for that (although it doesn't prohibit such software) I guess.
- eru 2y ago> The Linux file system was also not designed for that (although it doesn't prohibit such software) I guess. There's no 'the' Linux file system. There's plenty of file system to choose from. And, in fact, it would be relatively easy to write a write-only filesystem with FUSE. (https://en.wikipedia.org/wiki/Filesystem_in_Userspace https://en.wikipedia.org/wiki/Filesystem_in_Userspace)
- CraigJPerry 2y ago>> And I thought having a write-only scp would be really interesting I think you can achieve that at the file system level. At least, a long long time ago I maintained a public server with exactly that functionality. I’ve forgotten the details now but if I were tasked with this today my first attempt would be add a sticky bit like we do with /tmp: chmod +t dropbox/ If you don’t want to allow me to delete or overwrite my own files I believe (but haven’t tested) that chattr +a on the dropbox dir would achieve that.
- TachyonicBytes 2y agoIt's the usual way to make changes to a privileged file in Emacs; ssh to localhost with root.
- terinjokes 2y ago'sudo' and 'doas' are inline connection methods in TRAMP, so no need for SSH to localhost. Curious that systemd-run isn't already supported, but I imagine that will quickly change.
- tristan957 2y agoWhy not use sudoedit?
- lanstin 2y agoI like to have one of my tmux windows be a sudo session with emacs running as root and mostly used to run emerge world or apt update etc. also a window tailing all the logs. I haven’t been on a machine where more than one admin was logged in at the same time in quite some time.