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
1 answer

multiple passwords in sshpass

Is there a way to try multiple passwords when using sshpass command? I have a txt file named hosts.txt listing multiple system IPaddresses and each system uses different passwords (for example - 'mypasswd', 'newpasswd, nicepasswd'). The script reads…
user3331975
  • 2,647
  • 7
  • 28
  • 30
-1
votes
1 answer

Jenkins: sshpass: Failed to run command: No such file or directory

I use Jenkins for CICD. After cloning the repository, I want to copy some file from cloned repository to a remote server using sshpass (scp). sh """sshpass -p '$KEY'-o StrictHostKeyChecking=no scp *.json $UNAME@$PROD_IP:/home/test""" But I get…
Temo Hatna
  • 26
  • 1
  • 6
-1
votes
1 answer

Unable to use sudo password in script

I am trying to write a bash script to login to ssh and then run docker login command as sudo. SSH login works fine , but issue is with sudo login. Command: sshpass -p password ssh -oStrictHostKeyChecking=no -oServerAliveInterval=120…
Chel MS
  • 386
  • 1
  • 10
-1
votes
2 answers

sshpass, permission denied, please try again

I know that this question has been proposed several times (https://superuser.com/questions/606252/how-to-use-sshpass-for-chained-connection and…
-1
votes
1 answer

How to pass argument to batch file in ssh?

I am trying to run a batch-file on remote windows machine, from macos through ssh commands. sshpass -p 'password' ssh username@server < abc.bat I want to send argument to my batch file. sshpass -p 'password' ssh username@server < abc.bat…
-1
votes
1 answer

BASH with sshpass send same command to multiple servers based on list of servers?

Hi I have the following "script" below which works…
Plankt0n
  • 3
  • 1
-1
votes
1 answer

sshpass doesn't work in Bash but work outside on command line

I am working on a script to get list of files from remote servers, each remote server has its own password, IP and user and path. That's why I am using sshpass to pass the password parameter dynamically. Here is my script to just get list of files…
-1
votes
1 answer

Gitlab pipeline fails when using rsync to upload to staging server

I'm currently using the Gitlab Pipelines to upload everything to my server. The .gitlab-ci.yml path for uploading to the staging folder looks like the following: staging_upload: stage: staging only: refs: - develop - schedules …
fklement
  • 63
  • 8
-1
votes
1 answer

How does ssh receive password from tty?

I was wondering how openssh gets the password when login, cause I got stuck in automating entering passwords to the similar tools in linux which requires getting password from tty like ssh. Tried to understand sshpass and found that sshpass forks a…
-1
votes
1 answer

'Connection' object has no attribute 'ssh' ansible on macOS?

I am trying to run a task in ansible playbook as below. - name: Add user to a group user: name: "{{ansible_user}}" groups: docker append: yes become: yes when: node_type == "peer" I am using macOS and…
TechChain
  • 8,404
  • 29
  • 103
  • 228
-1
votes
2 answers

Is ssh pass secure?

I'm writing a script to automate running a specific command across multiple Linux systems. I am going to use something like: read -s "Enter password" ANS sshpass -p $ANS ssh server "some command" Is there going to be a security concern on this?
-1
votes
1 answer

sshpass wait for keyboard input

When using sshpass how do I let it wait for keyboard input? for an example sshpass -p mypassword ssh username@hostname That will make the connection to the host. When I run it I wanted the connection wait after the password is appended to the host…
MBoy
  • 23
  • 5
-1
votes
1 answer

Using JCraft Jsch - executing sshpass command is unsuccessful

Need to establish a remote ssh into machine2 from a machine1. Trying the code below using ssh.but not succssfull. Ran a file creation command before &after the sshpass request to verify. file is created in Machine1 , but not worked in Machine2. Pls…
Nandu
  • 1
  • 3
-1
votes
1 answer

docker container - ssh adduser passwd

I've built a script "createcontainer.sh" to automatically create a container. I call the script as follows: ./createdocker.sh newuser newpass Internal to the script, the two arguments are assigned to variables as follows: USERNAME=$1 <--…
Dan
  • 331
  • 6
  • 17
-1
votes
2 answers

Bash File Transfer Issue Using SCP

I need to transfer files from machine 'A' to machine 'B' and I'm executing the command from machine from 'C'. Run Command : $sshpass -p 'password_for_a' ssh -A -t a@x.x.x.x rsync -avz /home/test/* b@x.x.x.x:/home/test/ This prompts the…
Arun
  • 1,160
  • 3
  • 17
  • 33
1 2 3
12
13