News for hackers. Stuff that matters.
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by codazoda on Thursday July 18, 2024 @02:44PM (#40998537)
Probably. See my comment (and example repo) elsewhere about running any old binary when someone connects.
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by Borg3 on Thursday July 18, 2024 @03:48PM (#40999062)
Or you can just run IRC client on start. Just trap SIGINT and SIGTSTP, run simple or modified client that cannot do exec or escape to shell and you are done :)
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by jagged-chisel on Thursday July 18, 2024 @05:03PM (#40999725)
Spoiler: set the user’s shell to any old binary, like a chat app.
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by semi-extrinsic on Thursday July 18, 2024 @06:27PM (#41000334)
Or in the authorized_keys file, prepend the public key with a specified command. This is then the only command that the user can execute when logging in with that particular key. To wit:

  command="/usr/bin/foo" ssh-ed25519 AAAA....
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by titaniumtown on Thursday July 18, 2024 @07:47PM (#41000815)
i had no idea about that, thank you!
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by kijin on Thursday July 18, 2024 @08:22PM (#41000983)
I suppose this will also lock the user out of sftp and scp? Because otherwise they might be able to edit the authorized_keys file and run any command.
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by gerdesj on Thursday July 18, 2024 @08:58PM (#41001192)
"I suppose this will also lock the user out of sftp and scp?"

No it wont! The specified command might provide sftp, scp, telnet or stream a film.

Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by fragmede on Friday July 19, 2024 @01:41AM (#41002253)
I stream a film at funky.nondeterministic.computer on port 22
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by rovr138 on Friday July 19, 2024 @12:49PM (#41008406)
hah

made me laugh

Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by fragmede on Friday July 19, 2024 @01:40AM (#41002245)
I'd recommend using https://github.com/gliderlabs/ssh instead, no chance of some shell escape that way.
Re:Devzat – Chat over SSH, with some nice quality-of-life fe... by quackduck on Friday July 19, 2024 @02:22AM (#41002434)
I use a fork of that!