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
1
vote
0 answers

Why sshpass does not get the same output with ssh?

I am trying to test a c/s application running on remote machine. The expected result is client calling for service, the service node will coredump with dumpfile generated. When I ssh onto the remote machine, it works with coredump generated. When I…
Hugh
  • 11
  • 2
1
vote
3 answers

Passing a variable in a bash script to sshpass

I am trying to pass a variable in a bash script to sshpass. Here is my code for reference: NAME="HARRY" sshpass -p passwd ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -q ipaddress 'bash -s' << 'EOF' echo $NAME EOF How can I…
gohar1999
  • 13
  • 5
1
vote
1 answer

Problem sshpass using Runtime.getRuntime().exec on java, but on cmd tunning fine

can someone solve this problem? I using sshpass for transfer file on java. Execute this command Process proc = Runtime.getRuntime().exec(new String[] {"sshpass","-p",…
Nisa Ahmad
  • 29
  • 3
1
vote
1 answer

Is it possible to set Ansible Vars from existing facts?

I find it easy to describe what I want to do showing how I tried to implement it, as below. In one playbook1.yml, I have: - name: set facts with ssh connecton details set_fact: ssh_user: "user01" ssh_pass: "passw0rd" In my playbook2.yml,…
1
vote
0 answers

cygwin rsync works, but not when sshpass is used

I'm using cygwin with openssh, openssl, sshpass, and rsync installed, among others. I've added C:\cygwin64\home to the environment variable "path". When I run the command rsync -avP user@1.2.3.4:/remote/path/ .\relative\local\path it works. However,…
Sirplentifus
  • 153
  • 2
  • 11
1
vote
1 answer

Pass password with sshpass to both servers when scp copying from one server to another

I am using scp to copy a file from one server to another. Both of the servers need a password to be passed with sshpass so I need to use sshpass twice in the same command. Note that I am using the -3 flag because server foo cannot directly…
Silidrone
  • 1,471
  • 4
  • 20
  • 35
1
vote
3 answers

password as a input with sshpass command

I have written a bash script for my office usage to fetch some information from the devices using sshpass along with ssh command. As we know sshpass allows a password to be passed on the command line using -p option, which makes the password…
user294110
  • 145
  • 1
  • 2
  • 14
1
vote
1 answer

How do I specify a repo for yum install in aws beanstalk file install_packages.config?

I need to install sshpass on my AWS beanstalk when it is deployed. I created a new clone to check that I could do it from the ssh shell command line and found that unless I specified the epel repo, it would not find the package: $ sudo yum -y…
1
vote
0 answers

How to Run a Second SSH command using SSHPass Whenever Already Connected Via Python

I'm trying to make a system (that will eventually be turned into a web interface) in order to ssh into a Raspberry Pi Zero and execute a python script to remotely control a GoPro. Currently, I have the part working of remotely controlling the GoPro,…
Ryan S
  • 155
  • 2
  • 12
1
vote
1 answer

sshpass will not run provided command on Ubuntu remote host when script is sourced, but does run on windows and if run within the same script

I've searched on here for a bit and can't find someone who is going through this issue. I have a tool/script I am building that uses sshpass to login to a remote host and pull logs, restart, etc... If I run the function within the main script it…
1
vote
1 answer

sshpass not executing in bash script

I have a dockerfile: (these are the relevent commands) RUN apk app --update bash openssh sshpass CMD ["bin/sh", "/home/build/build.sh"] Which my dockerfile gets ran by this command docker run --rm -it -v $(pwd):/home and all of the…
Kevin Carlos
  • 31
  • 3
  • 9
1
vote
0 answers

Output all folders on the server over SSH using Bash script

I encountered a problem, I use sshpass and I need to write a script, but this command is not displayed in the script If I enter this command into the terminal, then everything works for me and I get the output of all hidden folders on my server, but…
user9690594
1
vote
2 answers

sshpass command not found when I run it in java

I am trying to run a command to read a string from a file inside a remote address (and I'm sure the file is there), this command works when I run it on the bash but it doesn't work when I run it in my java code. Runtime rt =…
migffp
  • 21
  • 3
1
vote
0 answers

sshpass inside bash script works manually but doesn't with cron

I have a problem trying to launch a sshpass in a bash script to be launched by cron. I program the cron: 4 14 14 1 1 /Users/manuel/Downloads/prueba.sh prueba.sh has this content: export SSHPASS=mypassword sshpass -e ssh -oBatchMode=no user@host…
1
vote
1 answer

Bash scripting with expect. Set parameters to multiple test boards

I'm working on a small project for school. I'm using 15 or so tuners to emulate a Cell network. I'm by no means well versed in scripting yet. I'm an EE who usually googles until I have some frankencode capable of my purposes. The goal is the set up…