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

Ssh: handshake failed: ssh: unable to authenticate #91

Open
bropines opened this issue Aug 31, 2024 · 25 comments
Open

Ssh: handshake failed: ssh: unable to authenticate #91

bropines opened this issue Aug 31, 2024 · 25 comments

Comments

@bropines
Copy link

I don't understand why it doesn't work

.env

PORTR_ADMIN_GITHUB_CLIENT_ID=******
PORTR_ADMIN_GITHUB_CLIENT_SECRET=******

PORTR_DOMAIN=portr.******
PORTR_DB_URL=postgres://postgres:postgres@localhost:5432/postgres

PORTR_SERVER_URL=portr.******
PORTR_SSH_URL=IP_SERVER:2222

CLOUDFLARE_API_TOKEN=******

POSTGRES_USER=******
POSTGRES_PASSWORD=******
POSTGRES_DB=******

PORTR_ADMIN_ENCRYPTION_KEY=******
 .\portr.exe http 56569 --subdomain amal-test
🌍 Starting tunnel connection for :56569
🚨 Portr inspector running on http://localhost:7777

ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
@amalshaji
Copy link
Owner

Is port 2222 open for SSH connections?

@bropines
Copy link
Author

bropines commented Sep 1, 2024

Is port 2222 open for SSH connections?

Yes, if you try to connect, then the connection will pass. But I don't know the password, and neither do the login

@bropines
Copy link
Author

bropines commented Sep 1, 2024

image

@amalshaji
Copy link
Owner

Did you run the command to set up the client? The portr auth set ... command.

@bropines
Copy link
Author

bropines commented Sep 1, 2024

Did you run the command to set up the client? The portr auth set ... command.

 .\portr.exe http 56569 --subdomain amal-test

Oops... It's working. What is the probability that my DNS was bugged?

@bropines
Copy link
Author

bropines commented Sep 1, 2024

Now the problem is that he doesn't see the subdomain.

 .\portr.exe http ***** --subdomain amal-test
🌍 Starting tunnel connection for :*****
🚨 Portr inspector running on http://localhost:7777
🎉 Tunnel connected: https://amal-test.portr.bropinesd.ru -> 🌐 -> localhost:*****

image

And I don't really know how to do it.
In the DNS settings, this is if only
msedge_n2RKUqOHAZ

@bropines
Copy link
Author

bropines commented Sep 1, 2024

image

The api tokens are configured like this

@amalshaji
Copy link
Owner

You need to disable the proxy option in the DNS record. SSH doesn't work on cloudflare proxy.

@bropines
Copy link
Author

bropines commented Sep 1, 2024

You need to disable the proxy option in the DNS record. SSH doesn't work on cloudflare proxy.

I have disabled proxying. It connects, but the link provided by the program does not work.
DNS_PROBE_FINISHED_NXDOMAIN

@amalshaji
Copy link
Owner

Have you added a DNS record for *.portr?

@bropines
Copy link
Author

bropines commented Sep 1, 2024

Have you added a DNS record for *.portr?

Yes. Well, in cloud flare.
image

@bropines
Copy link
Author

bropines commented Sep 1, 2024

Or do I need to specify somewhere else in the system?

@amalshaji
Copy link
Owner

You need to add one more record for *.portr, pointing to the same IP as above. This is for the wildcard routes.

@bropines
Copy link
Author

bropines commented Sep 1, 2024

*.portr

image

@bropines
Copy link
Author

bropines commented Sep 1, 2024

Maybe the problem is how NGINX proxies to the network with its certificates?

@amalshaji
Copy link
Owner

Can you check the server logs? Check for errors.

docker compose logs caddy

Also try the URL on incognito

@bropines
Copy link
Author

bropines commented Sep 1, 2024

The site started loading, but
502 Bad Gateway
nginx/1.26.1

portr_caddy_1  | {"level":"error","ts":1725208998.4669518,"logger":"docker-proxy","msg":"Error response from server","server":"localhost","status code":400,"body":"{\"error\":\"loading config: loading new config: http app module: start: listening on :443: listen tcp :443: bind: address already in use\"}\n"}
portr_caddy_1  | {"level":"info","ts":1725208998.4681418,"logger":"admin","msg":"stopped previous server","address":"localhost:2019"}
portr_caddy_1  | {"level":"info","ts":1725209028.4702187,"logger":"docker-proxy","msg":"Sending configuration to","server":"localhost"}
portr_caddy_1  | {"level":"info","ts":1725209028.4712324,"logger":"admin.api","msg":"received request","method":"POST","host":"localhost:2019","uri":"/load","remote_ip":"127.0.0.1","remote_port":"41392","headers":{"Accept-Encoding":["gzip"],"Content-Length":["974"],"Content-Type":["application/json"],"User-Agent":["Go-http-client/1.1"]}}
portr_caddy_1  | {"level":"info","ts":1725209028.4720364,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
portr_caddy_1  | {"level":"info","ts":1725209028.4725628,"logger":"http.auto_https","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
portr_caddy_1  | {"level":"info","ts":1725209028.4726174,"logger":"http.auto_https","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
portr_caddy_1  | {"level":"info","ts":1725209028.4731112,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc000751400"}
portr_caddy_1  | {"level":"info","ts":1725209028.4732025,"logger":"tls.cache.maintenance","msg":"stopped background certificate maintenance","cache":"0xc000751400"}
portr_caddy_1  | {"level":"error","ts":1725209028.4732823,"logger":"admin.api","msg":"request error","error":"loading config: loading new config: http app module: start: listening on :80: listen tcp :80: bind: address already in use","status_code":400}
portr_caddy_1  | {"level":"error","ts":1725209028.4735832,"logger":"docker-proxy","msg":"Error response from server","server":"localhost","status code":400,"body":"{\"error\":\"loading config: loading new config: http app module: start: listening on :80: listen tcp :80: bind: address already in use\"}\n"}
portr_caddy_1  | {"level":"info","ts":1725209028.47475,"logger":"admin","msg":"stopped previous server","address":"localhost:2019"}

@amalshaji
Copy link
Owner

Are you running nginx?

@amalshaji
Copy link
Owner

Portr uses caddy as a reverse proxy, it is unable to bind to port 80

@bropines
Copy link
Author

bropines commented Sep 1, 2024

Portr uses caddy as a reverse proxy, it is unable to bind to port 80

Well, I kind of have nginx running on it.

@bropines
Copy link
Author

bropines commented Sep 1, 2024

❯ sudo lsof -i :80
COMMAND    PID     USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
nginx   884293     root   10u  IPv4 9090584      0t0  TCP *:http (LISTEN)
nginx   884293     root   11u  IPv6 9090585      0t0  TCP *:http (LISTEN)
nginx   884294 www-data   10u  IPv4 9090584      0t0  TCP *:http (LISTEN)
nginx   884294 www-data   11u  IPv6 9090585      0t0  TCP *:http (LISTEN)

I would not like to change nginx because some of the services on the server itself are connected to cloudflare subdomains in this way

@amalshaji
Copy link
Owner

I'm unsure how to set up Nginx for portr (something I haven't tried before).

@bropines
Copy link
Author

bropines commented Sep 1, 2024

Okay. I'll do the research for now. Maybe I'll dig up something...

@bropines
Copy link
Author

bropines commented Sep 1, 2024

I was just looking for an analog of bore, but which allows you to work with https. Half of it works, but then it crashes on a random error.... And nothing works with nginx at all, and I don't know how to fix it yet. Buy a separate web server for tunnels if only

@amalshaji
Copy link
Owner

Let me see if I can configure nginx for portr.

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