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

Passing multiple commands over sshpass

Here is my need I need to login to a server and execute a command as root. This is what I wrote : sshpass -p "password" ssh -t user@ip "hostname & sudo su - root & vmquery -rn 0 -bx | grep -i scratch | wc -l" The problem is VMQUERY command is not…
0
votes
1 answer

Handling error cases with scp and sshpass

I am trying to implement command line interface command for file transfer and that will call internally sshpass -p "password" scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -r user@remote-machine:/home/QA.txt /home/faadmin/ Here…
Rahul
  • 68
  • 1
  • 7
0
votes
2 answers

Use rsync with gitlab-ci.yml to sync Wordpress theme folders

While trying to use .gitlab-ci.yml to automatically deploy my theme to my production server, I receive a error: The command executed: using a ubuntu:16.04 image $ apt update -y && apt install openssh-client sshpass rsync -y $ rsync -avh --progress…
Marian Rick
  • 3,350
  • 4
  • 31
  • 67
0
votes
1 answer

Get the latest version of a group of files with similar name using the get statement for download

Currently I am using the following command to download an entire directory from an SFTP server to our own. The problem is, this directory gets larger every day and most of the files in it aren't necessary. So what I do today is that I download the…
disasterkid
  • 6,948
  • 25
  • 94
  • 179
0
votes
1 answer

Unix : Redirection operator and Pipe operator related commands in SFTP

How to work with redirection operator and Pipe operator related commands in SFTP? Currently I have connected to SFTP via SSHPASS as below [oouser@SVSATVMWHOST03-SITHPOO test]$ sshpass -e sftp -o BatchMode=no -b -…
Bharath Ac
  • 17
  • 2
0
votes
0 answers

Python Subprocess CalledProcessError when calling remote shutdown command exit status 6

My code runs a linux command to send a shutdown signal to a remote linux machine. Running the command on the linux terminal succeeds in shutting down the remote machine but using Python subprocess to call the command results in an…
Shiri
  • 1,972
  • 7
  • 24
  • 46
0
votes
1 answer

ssh to remote host using sshpass and fetch results using java

I'm trying to run some commands on a remote machine and capture the result using Java. I have a shell script called test.sh which has following commands: sshpass -p 'password' ssh root@host.com echo hostname I'm running it using below java…
HyperioN
  • 3,433
  • 2
  • 22
  • 36
0
votes
1 answer

export parameterized variables in shellscript using sshpass

I have a use case similar to the below code. Need to export parameterized variables/identifier to remote shell script from a shell script. I used the below code but I cannot export the value. Please suggest how to do it. A.sh (script…
zniv
  • 166
  • 1
  • 2
  • 12
0
votes
2 answers

I am trying to ssh into my raspberry pi and send a file to it using SSHpass and scp

This is the command I have been using: sshpass -p "raspberry" scp -r pi@10.0.0.125:/home/pi/Desktop/New C:/Users/Matt/Desktop/CSIndependantStudy/RaspberryPiJars/raspberryEncrypt.jar Whenever I execute the command no errors show up and it seems…
champskee
  • 27
  • 3
0
votes
1 answer

Appending crontab using ssh and sudo without root credentials

I have two servers say server A and server B. I have a sudo user say user1 with full privileges on server A and B. I am trying to append the crontab entry of root from server A to server B with the following command. But it's appending on A. I need…
gosatriani
  • 307
  • 4
  • 11
0
votes
1 answer

Ubuntu: sshpass run remote bash script

can someone tell me, how I can run a bash script on a remote host with sshpass? Is this possible? Thanks for your help & best regards
Pascal
  • 105
  • 1
  • 3
  • 7
0
votes
1 answer

Running Remote Bash Script that Contains nohup Command

I am trying to remotely run a script on an Ubuntu server that contains the line: nohup /mypath/mybashscript.sh & I am using this command from my remote system nohup sshpass -p "password" ssh -t -t user:password@host /mypath/mybashscript.sh However…
Xachuous
  • 19
  • 3
0
votes
1 answer

racadm failing to create virtual disks

We have a dell server with idrac 7 and I am trying to write a simple bash script to create a single virtual disks for all physical disks using racadm but it is failing. The flow is: disks=`sshpass -p "$idracpasswd" ssh -o StrictHostKeyChecking=no…
avaj
  • 299
  • 1
  • 5
  • 11
0
votes
1 answer

Why Dollar ($) Sign is not accepting in password for ldap user?

Password is "abc$123" for ldap user it was successfully set using ldappasswd but when login with this password it's give error of Invalid Credential. But using sshpass -p ssh abc$123 user@ip_add it was successfully login.
0
votes
1 answer

Modify /etc/hosts file using a shell script

I do not have passwordless ssh enabled between my two servers a and b. So I am using sshpass to connect to the server b from a. I have a requirement to add host entries in the /etc/hosts of server b from a. But the user that i am logging into server…
GSM
  • 356
  • 4
  • 11