Skip to content

Error: user not found when calling soft-serve from remote #740

@joshuali925

Description

@joshuali925

Describe the bug
After creating a user, I can call info successfully on the server that runs soft-serve, but when calling it from a remote host, I get Error: user not found

To Reproduce
Steps to reproduce the behavior:
On server A:

  1. start soft-serve using docker
services:
  soft-serve:
    image: charmcli/soft-serve:latest
    container_name: soft-serve
    volumes:
      - ./data:/soft-serve
    ports:
      - 2222:23231
      - 23232:23232
      - 23233:23233
      - 9418:9418
    env_file:
      - .env
    restart: unless-stopped
  1. validate admin works
❯ ssh localhost -p 2222 info
Username: admin
Admin: true
Public keys:
  ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEizP6Nzr/jw05DLDYEdOeWOraXzHrBcuJAc8+jjx7Bw
  1. create test user and validate
❯ ssh-keygen -t ed25519 -C '' -N '' -f ./id_ed25519
❯ ssh localhost -p 2222 user create mytest "-k '$(cat id_ed25519.pub)'"

# using server A's IP instead of `localhost` works as well
❯ ssh localhost -p 2222 -i id_ed25519 info
Username: mytest
Admin: false
Public keys:
  ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKaWLByd3F0dZJXk5t+zMpLVDra0s5x1YsPE52B5Vs0+

On server B:

  1. validate connection works
❯ ssh <server-A-ip> -p 2222 help
Soft Serve is a self-hostable Git server for the command line.

Usage:
  ssh -p 23231 localhost [command]

Available Commands:
  help                 Help about any command
  info                 Show your info
  jwt                  Generate a JSON Web Token
  pubkey               Manage your public keys
  repo                 Manage repositories
  set-username         Set your username
  settings             Manage server settings
  token                Manage access tokens
  user                 Manage users

Flags:
  -h, --help   help for this command

Use "ssh -p 23231 localhost [command] --help" for more information about a command.
  1. copy id_ed25519 from server A and call info, see error
❯ ssh <server-A-ip> -p 2222 -i id_ed25519 info
Error: user not found

Expected behavior
should get same behavior

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: [e.g. Linux]
  • Terminal [e.g. kitty, iterm2, gnome-terminal]
  • Version [e.g. v0.4.0]

Additional context
I have tried solution from similar issue #497 (comment)

❯ ssh <ip> -p 2222 -i id_ed25519 -o IdentitiesOnly=yes info
Error: user not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions