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

Command doesn't run from shell script on remote windows machine: Unable to execute command or shell in remote system

I have a Windows Client machine and I would like to invoke a powershell script on that client from my local machine i.e. Mac. I have ssh on Windows via freesshd. Also, i need to provide password via script hence I ended up using sshpass. From my Mac…
1
vote
2 answers

scp is giving no such file or directory

The Linux I have in this container is as shown below: root@sbolla-6c7b7589d8-5c2rb:/usr/safenet/lunaclient# uname -a Linux sbolla-6c7b7589d8-5c2rb 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 20:32:50 UTC 2017 x86_64…
sbolla
  • 671
  • 3
  • 22
  • 39
1
vote
2 answers

Error "sudo: no tty present and no askpass program specified" while using with sshpass

I want to write a script in which I need to get the content of a file from different machine 192.168.0.2 without enterging the password so I used sshpass with the following command : sshpass -p "password" ssh -o StrictHostKeyChecking=no…
Shashank Singh
  • 647
  • 1
  • 5
  • 22
1
vote
1 answer

How to get HPUX to adopt a TTY as controlling

A question that came through on the sshpass mailing list (and also on stack overflow). Sshpass does not work on HP-UX. Looking at the truss output, I see the following: -u [/tmp/sshpass][14066]{3783827} fork() ................... (returning as child…
Shachar Shemesh
  • 8,193
  • 6
  • 25
  • 57
1
vote
0 answers

subprocess isn't utilizing sshpass

Giving a loop ssh credentials to access a bunch of boxes on my network doesnt seem to be working. Here is an example of the code: iplist = open(savefile, 'r') # Ssh into hosts and grab version info for host in iplist: info =…
1
vote
0 answers

Can not execute script via ssh

I have remote machine and trying execute bash script to redeploy application after travis ci build is completed. I use sshpass to connect. But I cannot execute script. echo "Starting deployment" export SSHPASS=$PASSWORD sshpass -e ssh -o…
Kovalsky Dmitryi
  • 1,420
  • 1
  • 9
  • 12
1
vote
0 answers

Issues escaping double quotes while connecting to windows server

I have a scenario. I need to connect to a windows server from a unix machine using sshpass and execute a MySQL query remotely. Below is the code I want to run: sshpass -p 'passwd' ssh -q -o StrictHostKeyChecking=no Administrator@IP mysql -uroot…
1
vote
1 answer

Bash cronjob issue for downloading files

I know how to download all the samples from a SFTP server all at once and using the script mentioned below. #download.sh sshpass -p password sftp username@X.X.X.X:/Files/2017-05-05-00.zip ~/local_machine/2017-05-05/ sshpass -p password sftp…
Arun
  • 1,160
  • 3
  • 17
  • 33
1
vote
2 answers

Deploy to server with CircleCI and SCP

Say I have a repo that I'd like CircleCI to deploy after finishing the test sequence and the code is like so: deployment: staging: branch: master commands: - scp -r wp-content/plugins/timespan…
Daniel
  • 61
  • 1
  • 2
  • 9
1
vote
2 answers

How to save ssh login welcome banner and disconnect

I'd like to be able to sign into an ssh terminal and save the banner information, and immediately disconnect. For example i can ssh into my terminal with: sshpass -p[PASSWORD] ssh -p 2201 [USER_NAME]@ipaddress I get the following login welcome…
iantist
  • 833
  • 2
  • 12
  • 27
1
vote
2 answers

Automate SSH Configuration for new Hadoop cluster

Guessing this has been done many times, but I could not find a clean answer, so I am appealing to your expertise for a better solution: Objective: I am setting up a moderate sized RHEL Hadoop cluster and want to automate the configuration of SSH…
Eli Reiman
  • 164
  • 2
  • 11
1
vote
2 answers

how to use sshpass in shell script to check whether directory exists or not?

I have a shell script, it basically run in one environment, and it needs to check whether directory exists on another environment or not. I tried in below two ways but no luck. Way 1 : if [ -d "sshpass -p PASSWORD ssh root@192.168.16.01 /home/test"…
Logan
  • 1,682
  • 4
  • 21
  • 35
1
vote
2 answers

sshpass not working with cron tab

I have a script with following line sshpass -p 'password' ssh user@server "touch /tmp/test" this works, when I run the script, but if I put the script in cron it doesen't work. any ideas ?
him
  • 111
  • 1
  • 10
1
vote
1 answer

Why runtime.exec() is not executing. when I given sshpass command

Why runtime.exec() is not executing. when I given sshpass command rt.exec("sshpass -p sbsiz scp '/home/surendra/Desktop/remote_backup.txt' root@192.168.59.115:/home/"); but when I Run this command directly in terminal it's working like as in…