5 ms·
> Something interesting is that when I set the user account to nologin I actually was unable to log in as the user. Usually in Linux you can hack around this wi
by johnisgood 6y ago
> Something interesting is that when I set the user account to nologin I actually was unable to log in as the user. Usually in Linux you can hack around this with su flags but FreeBSD doesn't have this escape hatch. Neat.
For anyone who is wondering, it is: "su -s /bin/bash user".
Typically when you want to su to it and it has nologin, it will say "This account is currently not available." or "su: user /bin/bash does not exist or the user entry does not contain all the required field". The former mostly.
You can bypass this with the aforementioned flag to su.
- davidcuddeback 6y ago`sudo -u user /usr/local/bin/bash` works on FreeBSD.
- toast0 6y ago(only if bash and sudo are installed) /bin/sh is part of base and can be relied upon (outside of esoteric setups), as well as /usr/bin/su
- johnisgood 6y agoHey, I did not say that it does not, because I have no idea. :)
- davidcuddeback 6y agoNo worries. I was just pointing out that there's still a way to hack around it.
- johnisgood 6y agoOf course, thank you for it.
- mst 6y agoAnd it's been a fairly common thing for 20 years now to have a 'toor' user that's 'root but with a sh/bash shell'.
- xena 6y agoI tried that but it just said `su: Sorry.` and exited with 1.
- johnisgood 6y agoInteresting, which OS? Can you tell some details? I am on Arch Linux, and my su version is: su from util-linux 2.36.1. With root and that command I can become http, git, what have you. :D
- xena 6y agoFreeBSD 12.2 on a raspberry pi
- johnisgood 6y agoHmm, I see. On Linux, at least on Arch Linux using that version of su it does work. Someone said "sudo -u user /usr/local/bin/bash" works on FreeBSD. Does that work at least? Of course change the user and potentially the path to bash if you have it installed elsewhere.