Android-Password-Store icon indicating copy to clipboard operation
Android-Password-Store copied to clipboard

SSH Git sync fails: Auth fail [preauth]

Open kwlg opened this issue 9 years ago • 11 comments

Synchronizing, pulling and pushing have failed for me for the last couple of versions. Whenever I try to do any of these I get the error message shown in the screenshot below. The relevant output from the server log file /var/log/auth.log is the following:

Aug  9 15:26:38 raspberrypi sshd[20888]: error: Received disconnect from xxx.xxx.xxx.xxx: 3: com.jcraft.jsch.JSchException: Auth fail [preauth]

where xxx.xxx.xxx.xxx is my IP.

The server has the correct public keys in the authorized_keys file and synchronizing works as expected on my computer. It is only my Android devices that fail. I'm currently using version 1.2.0.68.

Any ideas what might be wrong?

git

kwlg avatar Aug 09 '17 13:08 kwlg

If you fall back to version 1.2.0.64 does it work?

zeapo avatar Aug 10 '17 12:08 zeapo

I uninstalled my current version and tried to install 1.2.0.64 from F-droid, but the download was unsuccessful. Therefore, I downloaded the release zip for 1.2.0.64 from Github and installed the release apk named app-release.apk. I turned out that the apk had version 1.2.0.60 and the sync fails with the same error as in the screenshot above with that version too. /var/log/auth.log also says the same as before.

kwlg avatar Aug 10 '17 14:08 kwlg

I'm not sure if it matters, but I don't use port 22 for SSH on my server. I have, however, specified the absolute path to the Git repo on the server as required by the app. I have also tried syncing using the server's domain name, its IP as well as its local IP without success.

I recently updated to Android 8.0.0 from 7.1.2 but unfortunately the problem remains.

Currently I'm unable to sync any of my passwords to/from my Android devices so I will happily provide any information needed for resolving this issue. Please tell me what information is needed.

kwlg avatar Sep 03 '17 14:09 kwlg

ah, the non-22 port number might be an issue,

can you check that your git clone url is valid? add a ssh:// at the beginning ?

On Sun, Sep 3, 2017 at 4:12 PM, kwlg [email protected] wrote:

I'm not sure if it matters, but I don't use port 22 for SSH on my server. I have, however, specified the absolute path to the Git repo on the server as required by the app.

I recently updated to Android 8.0.0 from 7.1.2 but unfortunately the problem remains.

Currently I'm unable to sync any of my passwords to/from my Android devices so I will happily provide any information needed for resolving this issue. Please tell me what information is needed.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zeapo/Android-Password-Store/issues/333#issuecomment-326807409, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQgBnxm40gmNVyBFQ2Bo8r55QxquEk8ks5serPBgaJpZM4OyFZx .

-- Mohamed Zenadi

zeapo avatar Sep 03 '17 16:09 zeapo

I tried changing to port 22 and also tried adding ssh:// to the URL. Unfortunately, it didn't work.

Any other ideas before I wipe the server? :)

kwlg avatar Sep 05 '17 05:09 kwlg

What's the path on your server and what is the URL you're using?

On Sep 5, 2017 7:43 AM, "kwlg" [email protected] wrote:

I tried changing to port 22 and also tried adding ssh:// to the URL. Unfortunately, it didn't work.

Any other ideas before I wipe the server? :)

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/zeapo/Android-Password-Store/issues/333#issuecomment-327076726, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQgBuZbO1F8RaStaDNxQfxOn7AiX4ICks5sfN9_gaJpZM4OyFZx .

zeapo avatar Sep 05 '17 05:09 zeapo

The user is called git and the repo is simply in a folder in its home folder called pass.git. The full path is /home/git/pass.git.

The address I use in Password Store is [email protected]:xxxxx/home/git/pass.git, where xxxxx is the custom port I use.

kwlg avatar Sep 05 '17 19:09 kwlg

It should really have worked :s

On Tue, Sep 5, 2017 at 9:43 PM, kwlg [email protected] wrote:

The user is called git and the repo is simply in a folder in its home folder called pass.git. The full path is /home/git/pass.git.

The address I use in Password Store is [email protected]:xxxxx/home/git/ pass.git, where xxxxx is the custom port I use.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zeapo/Android-Password-Store/issues/333#issuecomment-327282163, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQgBpaQDXN1JNe-KLqmqiaPxh-xx923ks5sfaRWgaJpZM4OyFZx .

-- Mohamed Zenadi

zeapo avatar Sep 05 '17 20:09 zeapo

And it did before and I have no clue what might have changed! :(

If you don't have any other ideas I will reinstall the server with a minimal configuration and try again. I will write here once I have tested but I might not have time for the next few days.

kwlg avatar Sep 05 '17 20:09 kwlg

I have finally had the time to setup the server from scratch and I found the issue!

It turns out that having the following combination of settings in /etc/ssh/sshd_config gives the error in this issue.

ChallengeResponseAuthentication yes
AuthenticationMethods publickey,keyboard-interactive

The reason why I want these is in order to enable two factor authentication for SSH logins with public keys. I have my Pass repo stored in the home folder of a user whose only purpose of existence is to store that repo. This user only has access to git-shell and therefore it is not that important to have 2FA for this user (although I would prefer it). However, for my other users, I would like 2FA enabled, which requires the two lines above in /etc/ssh/sshd_config.

The setup I had before was to have 2FA enabled for all users except for the one storing the Pass repo. This included the two lines of configuration above and I believe it used to work before. However, even though a verification code is not asked for when logging in to the user storing the Pass repo, its login is still rejected for some reason but only using the Password Store app. As I said before, it works as expected from a computer.

Has anything changed to the SSH part of the app over the last few versions and is this something that could be fixed? Or preferably, could support for entering a verification code be added, i.e. keyboard interactive?

kwlg avatar Oct 18 '17 18:10 kwlg

Is there any possibility to support this in the future? I'm relatively ok if 2fa (TOTP) isn't supported by the app, but not supporting keyboard-interactive means I can not create an access-local.conf to only bypass 2FA for my mobile devices running the app. I don't want to turn off 2FA for SSH across all devices.

Instead of using the app functionality I'm storing a local repo outside of the hidden folder which I then git init and git clone using termux which doesn't have any issue with 2FA or keyboard-interactive.

Robert-L-Turner avatar Jan 13 '21 16:01 Robert-L-Turner