dot

packages and services management
Log | Files | Refs | README

commit 2bb5511f5a29a70e2d434992aa2b9420892dbe15
parent 05bbf0247111252810a4a62ec56b0ffbcb47b51a
Author: Josuah Demangeon <mail@josuah.net>
Date:   Fri, 30 Mar 2018 17:37:29 +0200

9p through ssh with u9fs and unixserverr

Diffstat:
Drun/9pfs/run | 13-------------
Drun/authsrv9/auth/authdom | 2--
Drun/authsrv9/auth/authid | 2--
Drun/authsrv9/auth/badusers | 2--
Drun/authsrv9/auth/users/bootes/expire | 2--
Drun/authsrv9/auth/users/bootes/status | 2--
Drun/authsrv9/auth/users/josuah/expire | 2--
Drun/authsrv9/auth/users/josuah/status | 2--
Drun/authsrv9/auth/users/sys/expire | 2--
Drun/authsrv9/auth/users/sys/status | 2--
Drun/authsrv9/pass | 6------
Drun/authsrv9/run | 24------------------------
Arun/u9fs/host | 1+
Drun/u9fs/pass | 14--------------
Arun/u9fs/path | 1+
Mrun/u9fs/run | 20+++++++++-----------
Arun/u9fs/user | 1+
17 files changed, 12 insertions(+), 86 deletions(-)

diff --git a/run/9pfs/run b/run/9pfs/run @@ -1,13 +0,0 @@ -#!/bin/sh -e - -# forward u9fs from a remote host to a local socket through ssh - -socket="/tmp/9pfs" -mountp="$HOME/var/9p" - -exec 2>&1 - -IFS='' read -r host <host -IFS='' read -r path <path - -exec unixserver /tmp/9pfs ssh "$host" u9fs -l /dev/stderr "'$path'" diff --git a/run/authsrv9/auth/authdom b/run/authsrv9/auth/authdom @@ -1 +0,0 @@ -local- \ No newline at end of file diff --git a/run/authsrv9/auth/authid b/run/authsrv9/auth/authid @@ -1 +0,0 @@ -bootes- \ No newline at end of file diff --git a/run/authsrv9/auth/badusers b/run/authsrv9/auth/badusers @@ -1 +0,0 @@ -adm- \ No newline at end of file diff --git a/run/authsrv9/auth/users/bootes/expire b/run/authsrv9/auth/users/bootes/expire @@ -1 +0,0 @@ -never- \ No newline at end of file diff --git a/run/authsrv9/auth/users/bootes/status b/run/authsrv9/auth/users/bootes/status @@ -1 +0,0 @@ -ok- \ No newline at end of file diff --git a/run/authsrv9/auth/users/josuah/expire b/run/authsrv9/auth/users/josuah/expire @@ -1 +0,0 @@ -never- \ No newline at end of file diff --git a/run/authsrv9/auth/users/josuah/status b/run/authsrv9/auth/users/josuah/status @@ -1 +0,0 @@ -ok- \ No newline at end of file diff --git a/run/authsrv9/auth/users/sys/expire b/run/authsrv9/auth/users/sys/expire @@ -1 +0,0 @@ -never- \ No newline at end of file diff --git a/run/authsrv9/auth/users/sys/status b/run/authsrv9/auth/users/sys/status @@ -1 +0,0 @@ -ok- \ No newline at end of file diff --git a/run/authsrv9/pass b/run/authsrv9/pass @@ -1,6 +0,0 @@ -#!/bin/sh -ex - -for u in josuah bootes sys -do - [ -f "auth/users/$u/key" ] || passtokey >"auth/users/$u/key" -done diff --git a/run/authsrv9/run b/run/authsrv9/run @@ -1,24 +0,0 @@ -#!/bin/sh -e - -# Plan 9 authentification server - -# users: -# bootes - authid username, used by authsrv9 -# sys - system administrator with access to most things system files -# adm - system administrator with accest to most critical files -# $user - regular user with restricted permission - -# https://www.ueber.net/who/mjl/plan9/plan9-obsd.html - -port="567" - -exec 2>&1 -mkdir -p dev bin -[ -f "auth/users/josuah/key" ] -[ -f "auth/users/bootes/key" ] -[ -f "auth/users/sys/key" ] -authsrv="$(command -v authsrv9)" -[ -h "$authsrv" ] && authsrv="$(readlink -f "$authsrv")" -install -m750 -o root "$authsrv" bin/authsrv9 - -exec tcpserver 0.0.0.0 "$port" chroot "$(dirname "$0")" authsrv9 diff --git a/run/u9fs/host b/run/u9fs/host @@ -0,0 +1 @@ +nas.josuah.net diff --git a/run/u9fs/pass b/run/u9fs/pass @@ -1,14 +0,0 @@ -#!/bin/sh -e - -[ ! -f key ] - -stty -echo -printf 'password: ' -sed q >key -printf '\n' -stty echo - -printf 'bootes\n' >>key -printf 'local\n' >>key - -chmod 600 key diff --git a/run/u9fs/path b/run/u9fs/path @@ -0,0 +1 @@ +/home/lib/ diff --git a/run/u9fs/run b/run/u9fs/run @@ -1,19 +1,17 @@ #!/bin/sh -e -# Plan 9's 9p filesystem server +# forward u9fs from a remote host to a local socket through ssh -# https://www.ueber.net/who/mjl/plan9/plan9-obsd.html - -port="564" +socket="/tmp/9pfs" +mountp="$HOME/var/9p" exec 2>&1 +IFS='' read -r host <host +IFS='' read -r user <user IFS='' read -r path <path -chmod 600 key -exec tcpserver 0.0.0.0 "$port" u9fs \ - -u "$(whoami)" \ - -l /dev/stderr \ - -a p9any \ - -A key \ - "$path" +exec unixserver -v /tmp/u9fs ssh "$user@$host" '. ./.profile;' u9fs \ + -a none \ + -u "$user" \ + "'$path'" diff --git a/run/u9fs/user b/run/u9fs/user @@ -0,0 +1 @@ +josuah