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

Error 300: SshRequestDeniedError with correct credentials #845

Open
OpFab123 opened this issue Jun 9, 2024 · 18 comments
Open

Error 300: SshRequestDeniedError with correct credentials #845

OpFab123 opened this issue Jun 9, 2024 · 18 comments

Comments

@OpFab123
Copy link

OpFab123 commented Jun 9, 2024

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:

  • Samsung A33 with Android 14
  • Samsung A8 with Android 9

Amnezia App

  • Version 4.5.3.0
  • installed over playstore

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
Copy link
Member

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
Copy link

glolsh commented Jun 12, 2024

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
Copy link

glolsh commented Jun 13, 2024

Solved this issue by switching to ed25519

@OpFab123
Copy link
Author

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
Copy link
Author

OpFab123 commented Jun 14, 2024

Bruh i didnt mean to close this thread

@OpFab123 OpFab123 reopened this Jun 14, 2024
@NastyaGrifon
Copy link

NastyaGrifon commented Jun 14, 2024

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
Copy link
Collaborator

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

@NastyaGrifon
Copy link

NastyaGrifon commented Jun 17, 2024

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
Copy link
Collaborator

lunardunno commented Jun 18, 2024

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
Copy link

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

In powershell ssh connection success...

@lunardunno
Copy link
Collaborator

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

@NIKDISSV-Forever
Copy link

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

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

@MichaelDoronin
Copy link

@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
Copy link
Collaborator

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

@Zerogoki00
Copy link

I have the same problem. The only solution was login as root AND with password. Any other options (different users with/or public key) lead to errors.
This needs to be fixed

@AegeanBlue
Copy link

Have the same error, creating /opt/amnezia/amnezia-awg/ seems to fix the issue, but it also replicates whenever I try to install new protocol

@Daniil-Solovyev
Copy link

Amnesia only supports RSA keys with PEM, and ed25519

Examples of the line to generate:
ssh-keygen -t rsa -m PEM -b 2048
ssh-keygen -t rsa -m PEM -b 3072
ssh-keygen -t rsa -m PEM -b 4096
ssh-keygen -t ed25519

@phonoarchive
Copy link

I have a Servarica VPS and iPhone, trying to login as root via ssh private key option, getting error 300: SSH request was denied. Tried to generate all type of keys, et25519 also... no result.

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