Questions tagged [sshpass]

sshpass is the Non-interactive ssh password auth OpenSource project.

About

sshpass is a tool for non-interactively performing password authentication with SSH's so called "interactive keyboard password authentication". It allows supplying SSH password in command line, file, environment variable, etc.

Always be careful who can access the files where sshpass calls are stored. Most user should use SSH's more secure public key authentication instead.

Its source code can be downloaded from source forge.

Links

SourceForge

189 questions
183
votes
12 answers

How to install sshpass on Mac?

I would like to automate ssh login from my Mac. It does have a simple solution: sshpass -p my_password ssh m_username@hostname But my problem is installing sshpass on my Mac.
Alt
  • 2,597
  • 5
  • 26
  • 36
24
votes
3 answers

How to enable sshpass output to console

Using scp and interactively entering the password the file copy progress is sent to the console but there is no console output when using sshpass in a script to scp files. $ sshpass -p [password] scp [file] root@[ip]:/[dir] It seems sshpass is…
jacknad
  • 13,483
  • 40
  • 124
  • 194
22
votes
6 answers

"sshpass is not recognized" on Windows

I want to run sshpass command from my Windows to remote Linux server. I use this command: sshpass -p 'password' ssh ldap.nextstep4it.com -l root -o StrictHostKeyChecking=no But my cmd return below error statement: 'sshpass' is not recognized as an…
Ridzuan Adris
  • 1,192
  • 2
  • 13
  • 32
21
votes
3 answers

sshpass: command not found error

I am trying to automate the file transfer or FTP from one server to the other. #!/bin/bash ### In this model, the same filename is processed on each run. ### A timestamp is added to the result file and data file is copied to the archive or error…
sreekem bose
  • 451
  • 3
  • 12
  • 28
18
votes
4 answers

How to install sshpass on Windows through Cygwin?

In the packages window of CygWin, when I type sshpass, nothing comes up. I tried installing similar packages like openssh etc hoping one of them contains sshpass but no luck.
Oliver Blue
  • 677
  • 2
  • 9
  • 22
11
votes
2 answers

Docker RUN fails with "returned a non-zero code: 6"

I have the following in my docker file: RUN sudo apt-get install sshpass -y RUN sshpass -p userPassword scp -r user@server:~/data/* ./ But when I try and build my image it fails with: Exception caught: The command '/bin/sh -c sshpass -p…
James
  • 1,237
  • 4
  • 22
  • 43
10
votes
4 answers

Host Key Verification Failed with sshpass rsync

On my linux server I run the command: sshpass -p 'password' rsync -avz /source/folder/ root@192.168.x.x:/dest/folder When I run the command without sshpass it will provide me with prompts for authenticity of host and the password. I need some…
khm
  • 466
  • 2
  • 4
  • 17
8
votes
5 answers

sshpass not working properly

I'm using sshpass to pass the password non-interactive on ubuntu 11.04. when I use sshpass with scp sshpass -p '123' scp sayuj@192.168.1.51:/home/sayuj/examples.desktop ~/Desktop/ it works fine but it doesn't work with ssh sshpass -p '123' ssh…
Sayuj
  • 7,464
  • 13
  • 59
  • 76
5
votes
0 answers

sshpass command not working in node.js

I have tried to run sshpass command using node.js spawn() to automate ssh. But it automatically exits from the command line without any error. This is the code I used. var tail = spawn("sshpass", ["-p", "test", "ssh", "-n", "test@xxx.x.xxx.xxx",…
4
votes
1 answer

How to add ssh passphrase to Docker and removed it after it was used?

The problem sounds elementary in its nature but I cannot find a secure and simple solution. The issue is the following, I have a project and I want to pull dependencies from private git repos to build a runtime environment and remove both SSH key…
Dmytro Chasovskyi
  • 3,209
  • 4
  • 40
  • 82
4
votes
1 answer

SSH Hangs When Using sshpass and Private Keys

I have an alpine Docker image running in Kubernetes, in which I try to push to Git using a Deploy Key (with passphrase). Now my command looks like: CMD ["/bin/sh", "-c", "GIT_SSH_COMMAND=\"sshpass -p mygreatpassphrase ssh -vvv\" git -C /workspace…
abergmeier
  • 13,224
  • 13
  • 64
  • 120
4
votes
3 answers

Start a remote process using java

Machine A connects to a remote machine B using sshpass and that remote machine B doesn't give ssh access to root directly so I connect to it through user and use sudo and I also have disabled password for the user when he does sudo su. When the…
Shashank Singh
  • 647
  • 1
  • 5
  • 22
4
votes
2 answers

How to get exit code from remote machine using sshpass command

I want to list the files on the remote machine using bash script without entering password. I am using following command to do it sshpass -p password ssh user@ubuntusite.net "ls /usr/local/" I want to get the exit code from the above command to…
Galet
  • 5,853
  • 21
  • 82
  • 148
4
votes
0 answers

Permission denied when using sshpass

I am running HP-UX 11.31, trying to use sshpass to connect to a vendor's system and retrieve a file using sftp. When I run sftp manually, I am able to connect by entering a password. Thus, the command sftp $USERID@$SERVER works fine. The vendor's…
user448810
  • 17,381
  • 4
  • 34
  • 59
4
votes
0 answers

Vagrant startup with sshpass and port forward not working

I am trying to set up Vagrant for my development environment, but are having problems getting Vagrant to automatically connect to a remote server on startup In my Vagrantfile I have the following line: config.vm.provision "shell", path:…
Adam Honoré
  • 183
  • 8
1
2 3
12 13