wishlist icon indicating copy to clipboard operation
wishlist copied to clipboard

Any examples for running wishlist in server mode where one of the options opens a local shell?

Open gilmoregrills opened this issue 1 year ago • 4 comments

Hiii,

I'm trying to run wishlist server on a raspberry pi, for just personal use - to eventually route to a couple of SSH apps running on the pi, and I wanted to make one of the options open a shell on the raspberry pi.

I was trying to do it by trial-and-error, with various server config file options vaguely like the one below:

endpoints:
  - # 
     name: shell
     address: localhost:22
     # user: blah
     # remote_command: /bin/bash
     request_tty: true
     

with a local ~/.ssh/config that looks like:

Host wishlist
  Hostname rpi.local
  User blah
  Port 2222
  ForwardAgent yes
  UserKnownHostsFile /dev/null

But I just get an error along the lines of:

ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain                                                                      

Which makes sense I guess, it doesn't feel right to just ssh to localhost, but I'm not sure.

Is there a way to do this? I could just run wishlist on 2222 to route to the SSH apps, and then just ssh the normal way on port 22 when I need shell access, but it would be fun if I could have the wishlist directory look like this:

     Directory Listing                                                
                                                                      
    2 items                                                           
                                                                      
  │ example-app                                                       
  │ Interact with this tui app!                                       
  │ ssh://localhost:8822                                              
                                                                      
    shell                                                             
    Get shell acccess                                                 
    ssh://localhost:22                                                                

Sorry if I'm misunderstanding how this project works entirely 😅 Thanks!

gilmoregrills avatar Jan 19 '24 08:01 gilmoregrills

In general any working examples for running wishlist in server mode when you're serving multiple local SSH apps from one server would be cool! It's easy to understand from the examples how wishlist in server mode would work on a bastion host, less so with a single host.

gilmoregrills avatar Jan 19 '24 08:01 gilmoregrills

anything in the wishlist server logs?

I think its using a client_id_ed25519 key, which you need to add to localhost ~/.ssh/authorized_keys

caarlos0 avatar Jan 19 '24 11:01 caarlos0

Ohh good call on the client key, that's what it's referencing in the logs, so I found that in ~/.wishlist/ and added the public version to my authorized_keys. I'm still getting the same error though, and the logs look like this:

robin@rpi:~ $ wishlist serve
2024/01/20 09:35:27 INFO Using configuration file path=.wishlist/config.yaml
2024/01/20 09:35:27 INFO Starting SSH server endpoint=list address=ssh://0.0.0.0:2222
2024/01/20 09:35:33 INFO authorized user=robin key="ssh-rsa REDACTED"
2024/01/20 09:35:33 INFO robin connect [fe80::1430:db59:66ff:542d%wlan0]:60950 true [] xterm-256color 185 50
2024/01/20 09:35:35 INFO offering public key key.path=/home/robin/.wishlist/client_ed25519 key.type=ssh-ed25519 key.fingerprint=SHA256:REDACTED
2024/01/20 09:35:36 WARN got an error err="failed to create session: connection failed: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain"
2024/01/20 09:35:36 WARN root cause err="failed to create session: connection failed: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain"

I also tried adding the public key(s) to the ~/.allowed_keys file, but no joy :(

gilmoregrills avatar Jan 20 '24 09:01 gilmoregrills

I also tried adding the public key(s) to the ~/.allowed_keys file, but no joy :(

should be ~/.ssh/authorized_keys afaik.

caarlos0 avatar Jan 22 '24 13:01 caarlos0

any news?

caarlos0 avatar Feb 29 '24 15:02 caarlos0