Giter VIP home page Giter VIP logo

tailscale-linux-switchuser's Introduction

Doesn't work anymore

This project does not work with latest changes in how tailscale maintains login data.

Switch logged-in user of tailscale on Linux

I'm using two accounts with tailscale, wrote this to easily switch the network that should be used.

Usage:

go get github.com/happyalu/tailscale-linux-switchuser

sudo tailscale-linux-switchuser -login [email protected]

tailscale-linux-switchuser's People

Contributors

happyalu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tailscale-linux-switchuser's Issues

Support for latest tailscale version?

tailscale version 1.0.5 has the following files inside the /var/lib/tailscale/ directory (Ubuntu 18.04):

$ sudo ls -al /var/lib/tailscale/
total 16
drwxr-x---  2 root root 4096 Sep  9 03:07 .
drwxr-xr-x 68 root root 4096 Sep  9 03:05 ..
-rw-r--r--  1 root root    0 Sep 11 01:31 tailscaled.log1.txt
-rw-r--r--  1 root root    0 Sep 11 01:31 tailscaled.log2.txt
-rw-------  1 root root  209 Sep  9 03:05 tailscaled.log.conf
-rw-------  1 root root  983 Sep  9 03:07 tailscaled.state

Assuming I'm running this script properly (total beginner at go) it predictably stops:

$ apt install golang-go # installs go version 1.10~4ubuntu1
$ git clone https://github.com/happyalu/tailscale-linux-switchuser.git
$ cd tailscale-linux-switchuser
$ sudo go run main.go -login <my-email-address>
2020/09/11 01:29:29 unable to read tailscale config: open /var/lib/tailscale/relay.conf: no such file or directory
exit status 1

I'm guessing the missing relay.conf file is due to some re-organisation of filenames in the directory by the more recent tailscale version? Also, I found nothing inside the conf or state file that looked like an email address string.

Note to other experimenters and future self on the ugly way to switch accounts:
had to nuke the /var/lib/tailscale/ directory contents before restarting the tailscale systemd job for sudo tailscale up to give a new authentication link.

Edit: there's an open issue in the tailscale repo outlining the requirements of a built-in account-switching feature.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.