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

Ask for key password one time #102

Open
joyshukla opened this issue Nov 1, 2020 · 5 comments
Open

Ask for key password one time #102

joyshukla opened this issue Nov 1, 2020 · 5 comments

Comments

@joyshukla
Copy link

Local OS (where xxh is installed): MacOS
Destination host OS: ubuntu/lxc containers
xxh version: xxh/0.8.6
xxh-plugins installed: xxh-plugin-zsh-ohmyzsh

Steps to Reproduce

  1. I run xxh ... +v root@myhost and the output log is below
Load xxh config from /Users/****/.config/xxh/config.xxhc
Load xxh config for host myhost
Final arguments list: ['+I', 'xxh-plugin-zsh-ohmyzsh', '+hhh', '~', '+v', 'root@myhost']
ssh arguments: ['-o', 'StrictHostKeyChecking=accept-new', '-o', 'User=root']
**Enter passphrase for key '/Users/****/.ssh/id_rsa':**
Pexpect result:
{'user_host_accept': None, 'user_host_password': None, 'user_key_password': "'", 'output': '\r\nxxh_home_realpath=/root/.xxh\r\nxxh_version=0.8.6\r\nxxh_shell_exists=1\r\nxxh_home_writable=1\r\nxxh_parent_home_writable=1\r\nrsync=/usr/bin/rsync\r\nscp=/usr/bin/scp\r\nshell=\r\nkernel=Linux\r\narch=x86_64\r\n'}
Host info:

xxh_home_realpath=/root/.xxh
xxh_version=0.8.6
xxh_shell_exists=1
xxh_home_writable=1
xxh_parent_home_writable=1
rsync=/usr/bin/rsync
scp=/usr/bin/scp
shell=
kernel=Linux
arch=x86_64

**Enter passphrase for key '/Users/****/.ssh/id_rsa':**
Load plugin /root/.xxh/.xxh/shells/xxh-shell-zsh/build/zsh-bin/bin/../../../../../plugins/xxh-plugin-zsh-ohmyzsh/build/pluginrc.zsh
  1. the same issue doesn't occur if using ssh.

For community:
⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

@anki-code anki-code changed the title xxh ask for paraphrase two times xxh ask for key password two times Nov 1, 2020
@anki-code anki-code added bug Something isn't working ssh labels Nov 1, 2020
@anki-code
Copy link
Member

anki-code commented Nov 1, 2020

Hi @joyshukla! Thank you for reporting this! I can reproduce.
PR is very welcome!

@anki-code
Copy link
Member

anki-code commented Nov 1, 2020

I think the fix should be around this line.

@joyshukla
Copy link
Author

joyshukla commented Nov 1, 2020 via email

@anki-code
Copy link
Member

anki-code commented Apr 1, 2021

Hi! I've made some cleaning in the logic.

But the issue couldn't be solved now because when you have a key with password you should enter the password every ssh connection. To solve this for the simple password authentication we use sshpass but we have no solution for the key auth with password.

There are some approaches to solve this:

  1. Use pexpect every ssh connection to catch password prompt. This may be slower and with issues but more testing is needed.
  2. Or we can pack the ssh commands into one big script and do it once. But we can't achieve just one password typing on this way.
  3. Or we can try to find the sshpass for the keys. Short googling says no.
  4. Or (user based solution) use the key without password and put it to the key storage behind the password.

@anki-code anki-code added new feature and removed bug Something isn't working labels Apr 1, 2021
@anki-code anki-code changed the title xxh ask for key password two times Ask for key password one time Apr 1, 2021
anki-code added a commit that referenced this issue Apr 1, 2021
@bdoublet91
Copy link

Hi,
Do you have a solution for this ?
Thanks for your job !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants