0

I have a simple use case, I want to pass a password phrase to a command that requires keyboard input:

sshuttle -r user@server_address 0.0.0.0/0

this command will prompt for user input of sudo password of my Mac,

but I want to pass the password to it, instead of entering it everytime, I have tried:

echo "password" | sshuttle -r user@server_address 0.0.0.0/0

but not work, it still prompt for the password

K.Wanter
  • 145
  • 6
  • If it uses ssh underneath, it should be able to use your SSH daemon that holds your private key. This is the standard way to do passwordless SSH. See e.g. https://unix.stackexchange.com/questions/30901 https://unix.stackexchange.com/questions/72552 – Kusalananda Sep 05 '20 at 07:12
  • no, it is not ssh password, it just requires my mac computer password – K.Wanter Sep 05 '20 at 07:23
  • 1
    So you have not yet created an SSH key pair for logging in on the server? – Kusalananda Sep 05 '20 at 08:04
  • You could try expect tool in some cases it should help https://linux.die.net/man/1/expect https://www.thegeekstuff.com/2010/10/expect-examples/ – Marek Lisiecki Sep 05 '20 at 22:08
  • The problem with passing a password this way is that it creates a huge security vulnerability in your system. An unprivileged user can see it and use it. That's why the other comments are referring to using ssh which avoids this problem. – Joe Sep 11 '20 at 17:21

0 Answers0