Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [sshpass]

The tag has no usage guidance.

0
votes
0answers
40 views

Script not executing with ssh and sshpass

I have a script in my .gitlab-ci.yml which is not being executed. Here's the script: - apk update - apk add --no-cache openssh-client sshpass - sshpass -p "${USER_PASS}" ssh -o ...
0
votes
1answer
38 views

run command in script after an ssh

In my script I need to access a remote server using ssh. On the remote I want to gather some data from log files. I have my script set up and the code works, but my problem is when I run the script it ...
2
votes
1answer
37 views

How to safely pass password to a remote server to execute sudo commands

I have a very long bash script, at the end of it is a command to execute sudo commands on a remote server: 10 hours of local processing … ssh user@ip "sudo ls" I have set up ssh keys to connect to ...
1
vote
1answer
67 views

Stop CTRL+C Exiting Local Script Which is Running tcpdump in Remote Machine

I have setup a simple script like the below: sshpass -p $password ssh -T $username@$ip_address -p 30007 <<- EOF > $save_file.pcap sh tcpdump -i eth5.1 -s 0 -n -v -U -w - EOF sed -i '...
0
votes
1answer
81 views

How to Pass Multiple Commands to Remote Device via SSHPass [duplicate]

I'm trying to setup a method in which I can run remote tcpdumps on some of my devices, and save the file to my local machine for analysis (I don't want to save the file on the remote device and then ...
0
votes
0answers
47 views

Need complete output into variable in bash [duplicate]

Following is the command which is in shell script. var="$(sshpass -p 'password' ssh -o "StrictHostKeyChecking=no" username@hostip <<-EOF command to run on remote host EOF )" when i echo $var, ...
0
votes
1answer
314 views

sshpass in .ssh/config?

When running the command: ssh minix.p what I really want run is: sshpass -f ~/.ssh/minix-password ssh minix.p Is there any way I can do that? Background I want to use sshfs and similar tools, so ...
2
votes
2answers
3k views

Multiple commands in sshpass [closed]

Is there a way to use the multiple commands in sshpass, I tried with difference combinations but it throws error. $ sudo sshpass -p $password ssh -t -oStrictHostKeyChecking=no $username@$ipaddress &...
2
votes
0answers
235 views

Can't set title with gnome-terminal [duplicate]

I'm using Centos 7. When I sshpass to my remote login server, I need to specify the title to every terminal I open through gnome-terminal. I tried following approach from the link suggested by @...
0
votes
0answers
220 views

How do I test ssh to multiple hosts and log success/failure to an output file?

I'm using sshpass to check connectivity to devices with a common user/password combo. sshpass -p mypassword ssh -q username@ipaddress I want to run a loop over a file with multiple ip addresses, ...
1
vote
1answer
483 views

SSH remote - display echo on local terminal

The following is a part of my script where I want to echo some text to the local terminal if the condition fails in ssh. /usr/bin/sshpass -p $PASSWORD /usr/bin/ssh -t -o "StrictHostKeyChecking no" ...
0
votes
1answer
163 views

unix throws error “sh: mntroot: not found” when doing sshpass with @host command, how to solve this?

My requirement : i want to pass some commands with sshpass command. ex 1: sshpass -p 'sshpass' ssh -oKexAlgorithms******* user@host touch /mnt/us/pass above sshpass example works perfectly. ex 2: ...
1
vote
1answer
69 views

Tracking child processes sequentially

I'm running few commands on a remote server, by sshpass. gnome-terminal --maximize --tab --title='aTask' -e "sshpass -p "afsd@#$5u89f" ssh root@192.168.0.125 'command1 && command2'" \ ...
3
votes
1answer
1k views

Execute multiple command through SSH using sudo

#!/bin/bash while IFS="," read -r f1 f2 do username="testuser" SSHPASS='abcde' sshpass -e ssh -t "$username@$f1" "sudo su - root -c 'yum -y install wget'"< /dev/null ; done < Input.txt Now ...
0
votes
0answers
651 views

Start a remote process using sshpass not working

Machine A connects to a remote machine B using sshpass and that remote machine B doesn't give ssh access to root directly so I connect to it through user and use sudo and I also have disabled ...
0
votes
1answer
550 views

Mount sshfs as non-root hangs forever

I made a sshfs mount point in my fstab, using sshpass to send the password (I need to do this because key authentification is not available on the remote server). Mounting the folder logged as root ...
1
vote
2answers
2k views

sshpass not functioning in alpine linux

When I install sshpass on alpine linux it will install and the doc will show up if you run it without arguments, but using any argument (valid or invalid) returns sshpass: Failed to run command: No ...
-1
votes
1answer
456 views

SSHPASS rsync scp -r copying few files worked later not working

rsync: link_stat "/home/user/file.txt" failed: No such file or directory (2) sshpass -e ssh -oBatchMode=no $user@$ip.$remotehost "rsync -v -e ssh file.txt /home/user/$folder/ && cd /home/user/...
1
vote
0answers
428 views

Use sshpass to scp files from two remote hosts

I have the following problem. I have sshpass installed on Server A. I have files on Server B that I need to copy to Server C. (Servers B and C don't have sshpass installed, and are in another ...
1
vote
0answers
635 views

automount sshfs with autofs and sshpass

I want to mount partitions from a remote NAS that doesn't support login with a certificate. I created or edited the following files: /etc/ssh/sshpass.232 with ssh password /etc/ssh/sshpass.232.sh ...
2
votes
2answers
228 views

How can I pass two files through ssh?

I have a bash script that will execute a script of my choosing against a server over ssh. My problem is that I also want to use an input file with common variables so I don't have to change them in ...
0
votes
2answers
3k views

ssh remote file execution is not working

I have a bash script test.sh that contains the following commands #!/bin/bash PASSWORD="" USERNAME="" REM_HOSTNAME='localhost' FILES_TO_COPY="remote_exec.sh" function scptmp { exec sshpass -p $...
1
vote
0answers
1k views

Failed to install sshpass linux Ubuntu

After sudo apt-get update I tried to install sshpass library with sudo apt-get install sshpass But I get this error message: Reading package lists... Done Building dependency tree Reading ...
1
vote
0answers
145 views

Shell script to correct authorized key file permissions in large number of hosts

I have a large number of systems that I need to connect to (hosts.txt) and update permissions of the authorized key file prior to pushing keys out to the systems. I inherited the files that can push ...
1
vote
1answer
1k views

sshpass no longer works?

I'm trying to use sshpass to login automatically, however, it seems to have problem with /dev/tty echo password | ./sshpass ssh root@xxxx ... debug1: read_passphrase: can't open /dev/tty: No such ...
0
votes
1answer
2k views

Bash For Loop - prompt for IP range and password

I have a simple for loop one liner I use to check for things across a number of servers that have the same password set. I want to develop this one liner into a script that logs into a cluster of ...