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

sshpass : how to comeout of a session

I am remotely running some commands on a VM. using sshpass in my script but i am not able to come out of a session after script's execution. it just hangs at the remote screen ( see below) //script code sshpass -p admin sh -T admin@10.10.10.X ssh…
user3802947
  • 63
  • 2
  • 7
1
vote
1 answer

Launch two xterm and ssh into servers automatically

I'm using the following bash script and it has a couple of issues: The second xterm doesn't launch until the first is killed I've got to kill each xterm launched with quit instead of simply $exit The bash terminal I run the script from is locked…
user72055
  • 469
  • 1
  • 6
  • 15
1
vote
2 answers

Opening an ssh connection and keeping it open on startup

I need to open an ssh connection on login and keep it open, but to not acutally do anything with it. It would be best if all of it would run in the background. I created an automator application and made it run a shell script on the bash. The script…
davidf
  • 170
  • 1
  • 1
  • 9
1
vote
0 answers

Capturing output sshpass/scp

I'm using sshpass to make scp transfers non-interactive. It gathers all files from a folder and tries to sync them to a SFTP server. I need to check whether the transfer was successful or not, so I'm using an popen() to give the command. However, on…
IceBlackz
  • 11
  • 3
0
votes
0 answers

Can't non-interactively change password on remote machine using sshpass and chpasswd?

I'm trying to write a script that logs in a user over SSH and than changes that user's password. The line of code I currently use for that looks like the following: sshpass -p $password ssh $user@$ipadress "echo $user:$password_new | chpasswd" It…
0
votes
0 answers

Ansible SSH user/pass Invalid Argument -> host unreachable Solution, but why?

I change the default SSH Port in a (still) user/pass setup. After the port change and client-reboot, Ansible cannot connect any more and displays a fatal with invalid argument. I run this from Windows -> WSL.Ubuntu I figured out, the error can be…
Max
  • 395
  • 1
  • 3
  • 12
0
votes
1 answer

Understand why AWX suddenly requires sshpass

I have been using an AWX server for some time for a project. I use AWX on standard virtual machine templates user root password root on which I always succeed to connect. Suddenly this morning the AWX tries to connect on one of the template in SSH…
Nemrode
  • 27
  • 2
0
votes
0 answers

ssh does not work from concourse container to host

Host machine: Mac OS, Big Sur. Installed Rancher Desktop v1.6.2 and set a pipeline to ssh to host machine and run a script. pipeline code: jobs: - name: sanity-run-job serial: true plan: - get: sanity_run trigger: true …
Vipul
  • 545
  • 1
  • 8
  • 30
0
votes
0 answers

Rsync with sshpass, I am getting just file list, files not syncing

I am currently trying to make sync from remote server to local, and I am just receiving file list, files are not synced, i dont know why. Any tips? Thanks in advance :) I tried with this command: sshpass -p "password" rsync -avz -e…
0
votes
1 answer

Open SSH connection via SSH connection in one command

I might have messed the title up but I'll try to explain. For a school project we were given a server in which we should host our project. To be able to connect to that server via SSH we need to connect to another server via SSH at first and then we…
0
votes
1 answer

crontab doesnt work in linux but manually works

I made a shell script to connect using ssh with password to another linux server, get the details of a specific file and save it in a log file in the origin server. Manually works without problem but with the /etc/crontab doesnt update the file. (I…
0
votes
1 answer

escaping issue with script that uses ssh via sshpass and runs nmap inside ssh server

Problem is, when using the sshpass command you need to use ‘ ‘ (apostrophes) in order to input the command. When I try to use nmap, I'm using hostname -I and awk. The awk ‘{print .. ‘ apostrophe clashes with the sshpass apostrophe. Is there any…
Koren
  • 1
  • 1
0
votes
3 answers

Unable to use EOT inside if in shell script

Unable to use End of transmission (EOT) with ssh command inside if, it gives compilation error. I have tried using <<-EOT and <<
Snehal Gupta
  • 314
  • 1
  • 2
  • 13
0
votes
0 answers

Rsync from local linux to remote windows server

I am trying to copy files from local Linux server to remote windows file server using rysnc and sshpass but getting error code rsync --rsh='/usr/bin/sshpass -p 'password' ssh -p 139 -o StrictHostKeyChecking=no -l user' /x/y/z/ user@x.x.x.x:/a/b/c/…
khushi
  • 1
  • 7
0
votes
0 answers

Two jump with SSHPASS

On my source server, I have SSHPASS, but not on my jump servers, and I don't have SSH KEY on either my jump or my target servers Of course, I can't put SSHKEY neither on my JUMP nor on my TARGET I can't install SSHPASS on my JUMP servers either Can…
Pépite
  • 11