9 ms·
XXH: Bring your favorite shell wherever you go through the SSH
- teddyh 5y agoIf your favorite shell is Emacs, it already supports remote access using TRAMP.
- loeg 5y ago(No relation to XXHash (XXH32, XXH64, XXH128, XXH3): https://github.com/Cyan4973/xxHash https://github.com/Cyan4973/xxHash )
- sigmonsays 5y agowhen would you use this? Sounds like an awful way to distribute and run software...
- deleted 5y ago[deleted]
- spicybright 5y agoLots of reasons this can be useful. At my company we sometimes have to SSH into our dev nodes to restart things, figure out what's going wrong, etc. But we wipe them out nightly to update the code. This tool would let you keep all your special aliases for working on the nodes without manually copying your config(s) over. Can't say I'd use it, but I can see use cases like the above.
- laumars 5y agoFor every use case I can think of, there are several better ways of achieving the same goal.
- suifbwish 5y agoWhy not just have the instance run a script to fetch a new .rc file from a local repo? Or better yet just include the aliases in the profile/rc file on the image itself.
- spicybright 5y agoThe instance would need to have extra credentials for that I suppose, and you'd need the repo up somewhere, then track everything with git. Lots of engineers are also using the nodes, so you'd need to share that repo with them then have some command you type in each time to load it after you ssh into the node. And you'd only have updated versions of your rc every night, unless you want to commit a change, push, go to the server to pull it down, reload the shell. I guess what I'm saying is this tool fills a niche and avoids all the above complexity just for some shell aliases. (btw I don't really have a use for it, I just have 2 or 3 commands to copy paste into the shell for 99% of what I need to do. Just maintaining the argument to hear alternatives from people!)
- suifbwish 5y agoAs long as the commands are not secret, you could have your terminal just fetch them from a web server after logging in via the console and source it if the hash checksum of the page equals an expected value. If the checksum does not meet the expectation you either updated the commands in the file without updating the expected hash or the file server has been compromised.
- johnisgood 5y agoWhat does it have to do with distributing or running software? What did I miss from the README?
- nimih 5y agoIt's a program whose only purpose is to download/build some executable files, transfer them to a remote host, and then execute them. That would seem to encompass both "distributing" and "running" software.
- johnisgood 5y agoI only got the "transfer them to a remote host, and then execute them" bits, my bad. Probably because I see no reason for the first two steps.
- suifbwish 5y agoPortability of shells/binary injection and the associated layers often come with extreme vulnerabilities that are often not officially discovered for years. Convenience is often the reason many new vulnerabilities are introduced. Cool project for hobby purposes but be cautious when using this sort of thing on production systems especially on those housing data of any importance.
- hamburglar 5y agoAt my company this would be auto-flagged and you’d have the intrusions team on your ass inside of 5 minutes. :D
- vuln 5y ago“But I saw it on hackers news and installed via homebrew.” /s
- jclulow 5y agoIf they don't want you to fling binaries into your home directory they should just mount it noexec. At any rate it doesn't seem like a fantastic security/ability-to-work trade-off. Limit the privileges of the account or you're one exploit away from trouble.
- hamburglar 5y agoMany redundant layers are used to prevent and/or detect security violations, but “don’t install random binaries on prod machines” is a basic tenet. If you need certain tools to do your job, deploy them via proper controlled and audited mechanisms, not via scp.
- mzs 5y agohow it works: https://github.com/xxh/xxh/wiki#how-it-works https://github.com/xxh/xxh/wiki#how-it-works
- e12e 5y agoSo not my favorite shell, just a different build of zsh than what is available locally...
- tyingq 5y agoIs there a description somewhere as to what it's doing under the covers? A simplistic version could be just to ship a static binary of your shell over, like: tar -cf - ./bash-binary | ssh $host 'tar -xf -;./bash-binary -c "echo hello world"'
- solarfair 5y agoFrom the wiki, essentially that: https://github.com/xxh/xxh/wiki#how-it-works https://github.com/xxh/xxh/wiki#how-it-works
- hansel_der 5y agoyea why would you tar-up a single file w/o compression thou?
- deleted 5y ago[deleted]
- strager 5y agoThis tool demonstrates that POSIX shells are at the wrong layer of the stack. The shell should be part of the user interface (e.g. the terminal emulator or console), not a program running on the remote system.
- Aperocky 5y ago> program running on the remote system. Simple is better than complex. Sure the shell might have looked amazing like a browser but why
- convolvatron 5y agohardly more complex. imagine if the operating state was expressed in some common data format - just imagine tables. and the shell then is my local preference that interacts with that data model. is that less or more complicated than the mishmash of oddly designed kernel interfaces we have today (fork. mmap. ptrace....so much of it is a mess) not only would that clean up the lot, and allow for a very straightforward remote indirection, but would open up all kinds of lovely usages like being able to trivially capture and replay command streams. interposition. general purpose rewrites. a well-defined domain in which to upgrade and downgrade the interface schema. and more things I'm sure I've never thought of.
- hulitu 5y agoAnd imagine that you have a bug. And that you trash the filesystem remotely but by you it looks ok. Nobody asks you to use a shell with ssh. You can use X or (when or if will ever suport such an outdated feature) wayland.
- danielheath 5y agoplan9 achieved exactly this, and with a far simpler design. Backwards compatible is better than simple.
- strager 5y ago> Sure the shell might have looked amazing like a browser but why So you don't need to copy your config to the remote server, like XXH does. So you can still edit your command when your wifi gets spotty.
- remram 5y agoThis seems cool but I'm disappointed that it just sends a program to the other side rather than rewrite commands and operations to sh syntax.
- shagrath 5y agoNice, I did a similar hack some time ago: pack your favorites functions/aliases in b64, unpack and do some mkfifo on the server, write that fifo path to ENV, and call "exec bash --posix". zsh and ksh also work, as they also have some options relying on ENV.
- antihero 5y agoIt doesn't seem to work as I expected - I run xxh user@myhost +s zsh. I just get a blank zsh prompt without any of my dotfiles or anything. Is it supposed to be configured somehow beyond this?
- nitnelave 5y agoIt seems they have prerun commands to copy your dotfiles, but you have to specify that you want them. There's an example in the README.