From 09133113514953642ce864b09acf57c43aa00851 Mon Sep 17 00:00:00 2001 From: Russ Magee Date: Sun, 25 Sep 2022 23:23:33 -0700 Subject: [PATCH 1/2] Suppress Gimme Cookie prompt when in gopt (-g) authtoken create mode --- xs/xs.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xs/xs.go b/xs/xs.go index 3f8823f..b30ea05 100755 --- a/xs/xs.go +++ b/xs/xs.go @@ -1007,10 +1007,14 @@ func main() { //nolint: funlen, gocyclo }) if authCookie == "" { - // No auth token, prompt for password - fmt.Printf("Gimme cookie:") + if !gopt { + // No auth token, prompt for password + fmt.Printf("Gimme cookie:") + } ab, e := xs.ReadPassword(os.Stdin.Fd()) - fmt.Printf("\r\n") + if !gopt { + fmt.Printf("\r\n") + } if e != nil { panic(e) } From 3325bb3a4e34f441a4ab46bd3e8499764bae0ad0 Mon Sep 17 00:00:00 2001 From: Russtopia Date: Mon, 26 Sep 2022 00:49:52 -0700 Subject: [PATCH 2/2] Update 'README.md' adding authtoken setup example --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index ef6d2cc..667b7c4 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,12 @@ hostname:token string. Place this string into $HOME/.xs_id to allow logins witho entering a password (obviously, $HOME/.xs_id on both server and client for the user should *not* be world-readable.) +``` +$ xs -g user@host.net >~/.xs_id +``` +[enter password blindly, authtoken entry will be stored in ~/.xs_id] + + ### File Copying using xc xc is a symlink to xs, and the binary checks its own filename to determine whether