From 7e8cc7201949ad75daca5520c57479229711ed31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 4 Apr 2022 15:54:26 +0200 Subject: Add flake.nix --- shellrc-desktop.d/ssh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 shellrc-desktop.d/ssh (limited to 'shellrc-desktop.d/ssh') diff --git a/shellrc-desktop.d/ssh b/shellrc-desktop.d/ssh new file mode 100644 index 0000000..7a1b71f --- /dev/null +++ b/shellrc-desktop.d/ssh @@ -0,0 +1,19 @@ +# vim: ft=sh: +# These are general ssh helpers that are most likely not usable on server side +# anyway thus they are deployed on desktop only. + +# SSHFS in client mode. In other words it is reverse sshfs mount. +sshcfs() { + local target="$1" + local local_dir="$2" + local remote_dir="$3" + shift 3 + [[ "$local_dir" = /* ]] || local_dir="$PWD/$local_dir" + + ssh "$@" "$target" mkdir -p "$remote_dir" + dpipe \ + /usr/lib64/misc/sftp-server \ + = \ + ssh "$@" "$target" sshfs -o idmap=user -o passive -o allow_other \ + ":$local_dir" "$remote_dir" +} -- cgit v1.2.3