How about mounting your dotfiles directory (~/.config) or even your entire home directory on the remote system using SSHFS or NFS? I'm sure somebody would have tried it or some project may already exist. Any idea why that isn't as prevalent as copying your dotfiles over?
Show HN: Shittp – Volatile Dotfiles over SSH
21–30 of 97 posts
Re: Show HN: Shittp – Volatile Dotfiles over SSH
#22tmp="$(mktemp -d)" && rsync -a --exclude='.ssh' user@host:~/.[!.]* "$tmp"/ && HOME="$tmp" exec "$SHELL"
I think this will copy your 9gb Mozilla cache directory as well? Still one liners like this is all you need lol
Re: Show HN: Shittp – Volatile Dotfiles over SSH
#23How about mounting your dotfiles directory (~/.config) or even your entire home directory on the remote system using SSHFS or NFS? I'm sure somebody would have tried it or some project may already exist. Any idea why that isn't as prevalent as copying your dotfiles over?
This would enable a lot of attacks.
Re: Show HN: Shittp – Volatile Dotfiles over SSH
#24I wonder why are dofiles have to be on remote machines? e.g. I type an alias, the ssh client expands it on my local machine and send complex commands to remote. Could this be possible? I suppose a special shell could make it work.
Working on it! :)
Remote machines usually don’t need to know your keystrokes or handle your line editing, either. There’s a lot of latency to cut out, local customization to preserve, and protocol simplification to be had.
Re: Show HN: Shittp – Volatile Dotfiles over SSH
#25tmp="$(mktemp -d)" && rsync -a --exclude='.ssh' user@host:~/.[!.]* "$tmp"/ && HOME="$tmp" exec "$SHELL"
I think this will copy your 9gb Mozilla cache directory as well? Still one liners like this is all you need lol
Reason I say would be is that I disable disk cache among other things performed by Arkenfox [1]
Re: Show HN: Shittp – Volatile Dotfiles over SSH
#26Earlier quoted context omitted.
I think this will copy your 9gb Mozilla cache directory as well? Still one liners like this is all you need lol
My mozilla cache would be under ~/.mozilla/firefox. Is the nightly version moving to ~/.config? Reason I say would be is that I disable disk cache among other things performed by Arkenfox [1] [1] - https://github.com/arkenfox/user.js
Re: Show HN: Shittp – Volatile Dotfiles over SSH
#27I have a dotfiles git repo that symlinks my dotfiles. Then I can either pull the repo down on remote machine or rsync. I’m not sure why I would pick this over a git repo with a dotfiles.sh script https://erock-git-dotfiles.pgs.sh/tree/main/item/dotfiles.sh...
This installs into temp dirs and cleans it all up when you disconnect.
Personally, my old-man solution to this problem is different: always roll with defaults even if you don't like them, and don't use aliases. Not for everyone, but I can ssh into any random box and not be flailing about.
Even with OP's neat solution, it's not really going to work when you have to go through a jump box, or have to connect with a serial connection or some enterprise audit loggable ssh wrapper, etc
Re: Show HN: Shittp – Volatile Dotfiles over SSH
#28I wonder why are dofiles have to be on remote machines? e.g. I type an alias, the ssh client expands it on my local machine and send complex commands to remote. Could this be possible? I suppose a special shell could make it work.
Because the processes that use them run on the remote machines.
> I type an alias, the ssh client expands it on my local machine and send complex commands to remote.
This is not how SSH works. It merely takes your keystrokes and sends them to the remote machine, where bash/whatever reads and processes them.
Of course, you can have it work the way you imagine, it's just that it'd require a very special shell on your local machine, and a whole RAT client on the remote machine, which your special shell should be intimately aware about. E.g. TAB-completion of files would involve asking the remote machine to send the dir contents to your shell, and if your alias includes a process substitution... where should that process run?
Re: Show HN: Shittp – Volatile Dotfiles over SSH
#29I often need to login to colleagues' machines at work, but I find that their settings are not what I am familiar with. So I wrote an SSH wrapper in POSIX shell which tars dotfiles into a base64 string, passes it to SSH, and decodes / setups on the remote temp directory. Automatically remove when session ends. Supported: .profile, .vimrc, .bashrc, .tmux.conf, etc. This idea comes from kyrat[1]; passing files via a bas…
Wouldn't it make more sense to have a tool that brings files over to the local computer, starts Vim on them, and then copies them back?
Re: Show HN: Shittp – Volatile Dotfiles over SSH
#30I often need to login to colleagues' machines at work, but I find that their settings are not what I am familiar with. So I wrote an SSH wrapper in POSIX shell which tars dotfiles into a base64 string, passes it to SSH, and decodes / setups on the remote temp directory. Automatically remove when session ends. Supported: .profile, .vimrc, .bashrc, .tmux.conf, etc. This idea comes from kyrat[1]; passing files via a bas…
scp my-precious-dotfiles remote:~
trap 'ssh remote rm my-precious-dotfiles' EXIT
ssh remote
Or you can even bake the trap into the remote bash's invocation, although that'd be a bit harder.