Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate auto-user signup #40

Open
daurnimator opened this issue Dec 16, 2019 · 1 comment
Open

Investigate auto-user signup #40

daurnimator opened this issue Dec 16, 2019 · 1 comment

Comments

@daurnimator
Copy link
Member

#!/bin/bash

set -eufo pipefail

user="$1"
key="$2"

logger "Handling user login $user: $key"

psql "$POSTGRES_URI" \
  -t --pset border=0 \
  --set user="$user" \
  --set pubkey="$key" \
  <<< "insert into passwd(name, data) values(:'user', '{"shell": "/bin/bash", "ssh_keys":[' || :'pubkey' || '])'"
@benharri
Copy link
Member

this could replace or live in shell-signup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants