amnezia-vpn / amnezia-client

Amnezia VPN Client (Desktop+Mobile)
https://amnezia.org
GNU General Public License v3.0
2k stars 200 forks source link

Error 300: SshRequestDeniedError with correct credentials #845

Open OpFab123 opened 3 weeks ago

OpFab123 commented 3 weeks ago

Describe the bug When i want to install amnezia on my server, the app gives me Error 300: SshRequestDeniedError. The wiki states the following:

Occurs when incorrect data is entered while adding a new server.
Solution: Check the accuracy of the entered data.

Problem is, the credentials are correct for sure. How do I know? Getting remote access to the server using plain ssh from the command line works just fine. In addition, the ssh log (journalctl -u ssh) reports a succesful login, when i click connect in the app, though the app reports Error 300.

To Reproduce Steps to reproduce the behavior:

  1. open the app.
  2. enter enter the login data
  3. choose protocoll
  4. click install
  5. the error appears

Expected behavior The installation process should finish as expected.

Log files i dont think the ssh log is helpful, espacially as i would redact quite a lot of it.

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

Smartphone (please complete the following information): tested with:

Amnezia App

Server (please complete the following information): Distributor ID: Ubuntu Description: Ubuntu 22.04.4 LTS Release: 22.04 Codename: jammy

proposed solution Fix what ever is wrong? Alternativly, I understand why you have choosen to make the installation process as easy as possible for non tech people, but this creates problems in case of any failures, as you have nothing to check. For example, if there was an bash installation script, one could look into it, see at wich step the script stops working and start digging into it, possibly finding e.g. a workaround.

pokamest commented 3 weeks ago

Could you tell more details about your server? What is provider? What is extra settings on your server? What is username, root or other?

glolsh commented 3 weeks ago

Second to this. I have clean Hetzner cloud server with key-only ssh auth. Getting error too. I have these enabled ssh settings (/etc/ssh/sshd_config):

Include /etc/ssh/sshd_config.d/*.conf

PubkeyAuthentication yes

PasswordAuthentication no

ChallengeResponseAuthentication no

KbdInteractiveAuthentication no

UsePAM no

AllowAgentForwarding yes X11Forwarding yes PrintMotd no

AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

glolsh commented 3 weeks ago

Solved this issue by switching to ed25519

OpFab123 commented 2 weeks ago

Im using a clean unbuntu server minimal VM on proxmox, located at my home (the main use case for the vpn is sneaking around my schools blocking). The root Users not properly setup (has no password, but thats standart on ubuntu), so im using a custom username with sudo access. And the error accours with both the local ip and public ip.

OpFab123 commented 2 weeks ago

Bruh i didnt mean to close this thread

NastyaGrifon commented 2 weeks ago

Had the same issue, here's what worked for me:

After running Linux client to configure the server I've noticed that script runs

CUR_USER=$(whoami)
sudo mkdir -p /opt/amnezia/amnezia-awg
sudo chown $CUR_USER /opt/amnezia/amnezia-awg

After that, the installation fails with SSH error 300, while the stdout says

"SCP: Warning: status code 1 received: scp: /opt/amnezia/amnezia-awg/Dockerfile: No such file or directory\n"

Indeed, the folder /opt/amnezia does not exist. Let's create it manually then! Just run on your target server this:

export CUR_USER=$(whoami) && sudo mkdir -p /opt/amnezia/amnezia-awg && sudo chown $CUR_USER /opt/amnezia/amnezia-awg

Make sure you log in with the same user as you've put in the AmneziaVPN client. Can't say if that can cause issues, but I believe the CUR_USER variable is there for a reason

After that the error 300 is gone and installation process goes as usual. Not sure why this happens, hope this helps someone

lunardunno commented 2 weeks ago

Have you configured this server before, but under a different user?

NastyaGrifon commented 2 weeks ago

In my case error never occurs when using root user. Entering any other low-priv user results in this issue, even if that user is in the sudo group

lunardunno commented 2 weeks ago

In my case error never occurs when using root user. Entering any other low-priv user results in this issue, even if that user is in the sudo group

The problem was that when an individual container was deleted under root, the container directory remained, and the non-root user (only sudo) could not do anything with it.

And when the entire server is cleared of the AmneziaVPN software, this folder will be deleted and the server can be configured as a non-root user (only sudo).

The fix is ​​already included in the dev branch, and will be included in the next release|pre-release.

MichaelDoronin commented 2 weeks ago

Hi guys. Same issue on windows 11 machine. Can't ssh connect with amnezia client. What happened?

In powershell ssh connection success...

lunardunno commented 2 weeks ago

@MichaelDoronin Is the server new? Or was it already configured under a different user to work with AmneziaVPN?

NIKDISSV-Forever commented 1 week ago

I understand that this is not the best solution, but it worked for me.

sudo chmod 777 /opt/amnezia/amnezia-awg/

MichaelDoronin commented 1 week ago

@MichaelDoronin Is the server new? Or was it already configured under a different user to work with AmneziaVPN?

yes, new cloud ubuntu machine from provider. even i tried install amnezia on my android phone - same result.

but now, i created manual wireguard configuration on the same server in terminal and it works for me https://upcloud.com/resources/tutorials/get-started-wireguard-vpn

lunardunno commented 1 week ago

I understand that this is not the best solution, but it worked for me.

sudo chmod 777 /opt/amnezia/amnezia-awg/

The reason for this problem was that /opt/amnezia/amnezia-awg/ was initially created under the root user. And having deleted the container, but without clearing the server of all AmneizaVPN protocols and services, they began to configure the server under a different user.

Corrected in https://github.com/amnezia-vpn/amnezia-client/actions/runs/9157401644