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
0
votes
2 answers

Cannot execute the sshpass command after the the first sshpass is excuted

I am trying ssh to each host to run some command, after it is done. The second and the third sshpass command needs to be ran. However, it only run the first command, and then it stops at the second and the third sshpass command. Here is my sample…
heaven
  • 31
  • 6
0
votes
0 answers

SSHPASS in shell_exec PHP

I have a small problem with shell_exec. I'm currently trying to get a list of files or directorys on a remote Linux Server. The server, directory and the password which is necessaria to login I catch over a formular. Here the command which should…
0
votes
1 answer

SSHPass not working on ubuntu 14.04

I am facing the same issue as on sshpass not working properly and also not getting exactly what I need to change.. As mentioned in the same link I tried to do so but not getting what content needs to be change.. @Eonasdan : It will be helpful if you…
Shraddha Bagde
  • 131
  • 2
  • 10
0
votes
1 answer

NVM installation per user is not working with automated ssh logins

Normally when I login to my server via putty, I am able to use nvm, grunt, gulp commands but if I connect with php's ssh2 extension or with sshpass through a bash script those commands are not working unless if I execute this commands…
mirza
  • 5,685
  • 10
  • 43
  • 73
0
votes
1 answer

tar over ssh in combination with sshpass

I (very) recently posted this question in regards to tar over ssh. The question now has an answer, and I am now asking a different question. I run the following command to push code from my local machine to my server where it will run. tar -cJf -…
FreelanceConsultant
  • 13,167
  • 27
  • 115
  • 225
0
votes
0 answers

bash script does not run as cron job

UPDATE: Script A updated to reflect declaration of paths to sshpass, scp, per paxdiablo and Evert. Because this does not fix the problem, I do not believe the question is a duplicate of the linked question. I have a bash script, let's call it A,…
ZacharyST
  • 658
  • 2
  • 6
  • 22
0
votes
1 answer

sshpass exit in automation

I have total of 6 IP addresses and out of the 6 only 2 IP addresses are valid. I wrote a shell script to use sshpass to test each IP. The issue is when script reaches IP that is working it log's in the system (Cisco switch) and stays there and…
fali
  • 57
  • 1
  • 9
0
votes
1 answer

Scala: correct shell command doesn't work using ProcessBuilder

I'm trying to run a command inside Scala, this command is a ssh call that require the execution of a cmd line inside the serve machine, it looks like sshpass -p PSW ssh USER@IP "/absolute_path/program -input /absolute_path/filename" if I print this…
Cattani Simone
  • 1,168
  • 4
  • 12
  • 30
0
votes
1 answer

sshpass and SU and command all together in one liner query

In my script: 1. I have to do ssh to a machine by username and password 2. Than I have to do Su - user, it prompts for password 3. Than I have to run my command i.e ls . Earlier, There was no step2 and I was happily able to use sshpass & fire my…
Tajinder Singh
  • 205
  • 1
  • 5
  • 12
0
votes
1 answer

Execute command inside a shell script on a remote machine and get output on local machine

There are similar questions on stackoverflow, but they either don't have an answer or use some language (C#, Python, ...). I'm trying to execute a command on a remote machine using ssh and get the console output back to the local machine. Below is…
Vini.g.fer
  • 11,639
  • 16
  • 61
  • 90
0
votes
2 answers

Security of sshpass

How much secure of using sshpass? I read many discussions that sshpass is not secure, because it stores the password in log file as well as in history file. But if I use the following way, will it be secure? pass='' if [ "$pass" == "" ];then read -s…
Kay
  • 1,957
  • 2
  • 24
  • 46
0
votes
0 answers

sshpass command will not recognize variable file

sql_string=$(sshpass -p $ldappw ssh $ldapuser@$ssh_host 'mysql --skip-column-names '${db_info}' databasename < '"'${environment}'_final_table_selects.sql > '${environment}'_table_results.txt"'') When trying to run this command I get the error: ash:…
user3299633
  • 2,971
  • 3
  • 24
  • 38
0
votes
2 answers

shell command runs in shell but not in script

I am writing a shell script which contains below line - sshpass -p "pwd" ssh -t hostname@$ip1 ' cd /path/to/home/oflops/cbench; ./cbench -c $ip2 -p 6633 -m 1000 -l 10 -M 1000 -s 1 -t; ' >> file The above line works fine in shell but does not work…
0
votes
3 answers

php code for sshpass and ssh2

I'm new in PHP coding I'm writing new simple script but when i put this code i get blank page can some one tell me what's wrong with this code ?
codezero
  • 13
  • 1
  • 4
0
votes
1 answer

Create postgresl database dump and download it using scp with sshpass in one command

Hi I want to automate my workflow of creating Postgres dump and downloading it. I want to do it from my local machine, for now I figured it out so far in two seperate commands: sshpass -p "FuckinHardPass" ssh andi@1.2.3.4 "pg_dump -U andi…
andilabs
  • 22,159
  • 14
  • 114
  • 151