logoalt Hacker News

Show HN: Shittp – Volatile Dotfiles over SSH

92 pointsby sdovan1today at 12:33 PM54 commentsview on HN

Comments

sdovan1today at 12:33 PM

I 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 base64 string is a really cool approach.

[1]: https://github.com/fsquillace/kyrat/

show 4 replies
yoan9224today at 5:52 PM

I love the concept but I'd be worried about security in enterprise environments. Some of the dotfiles (especially .bashrc) could override security policies or compliance settings that IT has configured.

That said, for personal servers this is brilliant. I've been using a git repo for dotfiles but having them automatically cleanup on disconnect is clever.

One improvement: consider using SSH's ProxyCommand or LocalCommand instead of wrapping SSH entirely. That way it works transparently with tools that call SSH directly (git, rsync, etc).

Also curious - does this handle tmux sessions properly? I often SSH in, start tmux, disconnect, then reconnect later. Would the dotfiles still be there?

foltiktoday at 4:06 PM

I have a python script [0] which builds and statically links my toolbox (fish, neovim, tmux, rg/fd/sd, etc.) into a self contained —-prefix which can be rsynced to any machine.

It has an activate script which sets PATH, XDG_CONFIG_HOME, XDG_DATA_HOME, and friends. This way everything runs out of that single dir and doesn’t pollute the remote.

My ssh RemoteCommand then just checks for and calls the activate script if it exists. I get dropped into a nice shell with all my config and tools wherever I go, without disturbing others’ configs or system packages.

[0] https://github.com/foltik/dots

show 1 reply
Y_Ytoday at 1:02 PM

  tmp="$(mktemp -d)" && rsync -a --exclude='.ssh' user@host:~/.[!.]* "$tmp"/ && HOME="$tmp" exec "$SHELL"
show 3 replies
goku12today at 1:55 PM

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 3 replies
throw2772today at 2:35 PM

This reminds me - in a previous company I worked at, we had a bunch of old firewalls and switches that ran SSH servers without support for modern key exchange algorithms etc

One of the engineers wrote a shell alias called “shitssh”, which would call ssh with the right options to allow the old crufty crypto algorithms to be used. This alias got passed down to new members of the team like a family heirloom.

thunderbongtoday at 1:50 PM

Is this similar to sshrc?

https://github.com/cdown/sshrc

show 1 reply
twptoday at 1:46 PM

chezmoi has similar functionality, but it does install a binary on the target machine:

https://www.chezmoi.io/reference/commands/ssh/

drewrtoday at 3:11 PM

I didn't look closely at the project, but why take the extra step of base64? I do this all the time with tar by itself and it's wire-proof enough to work fine.

show 1 reply
qudattoday at 2:24 PM

I 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...

show 1 reply
neocrontoday at 3:57 PM

I don't know, I just use the standard on my machine or on remote. Why bother to customize it all the time when you can't work without the customizations

esttoday at 2:46 PM

I 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.

show 2 replies
tensegristtoday at 12:48 PM

time to call the it team at work (on the phone) to ask them to add a new item to the software allowlist

show 1 reply
deadbabetoday at 5:31 PM

Why call this Shittp? Is it to imply it’s actually shitty and just a proof of concept or fun project?

throw20251220today at 4:06 PM

More like shit toilet paper. Name like findtherapist.com

simmo9000today at 1:11 PM

[flagged]

MKWIX8CXXtoday at 2:06 PM

[flagged]