Questions tagged [sshpass]
57 questions
6
votes
2 answers
Multiple commands in sshpass
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 << EOF
command_one
command_two
…
Harry
- 191
- 1
- 2
- 10
5
votes
1 answer
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 i would like to not only get wget installed, but…
Anna
- 51
- 1
- 2
5
votes
2 answers
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 such file or directory.
It's pathed and even when…
Brian
- 281
- 1
- 2
- 6
3
votes
1 answer
"ssh" works but "sshpass" doesn't - how is this possible?
I configured key pairs for SSH connection.
It works but of course asks for the passphrase.
ssh [email protected]
So now I try to login with sshpass which I have installed. I tried with -p property but also and with -f property and nothing works -…
AndreyS
- 218
- 1
- 5
- 12
3
votes
2 answers
Using sshpass in Cygwin, ssh stills prompts for password
According to this RedHat SSH password automation guide I'm following the Example 4: GPG one, and following the steps in that guide I create my pass_file using my own passphrase. Then, I got this:
gpg -d -q myappserver23.sshpasswd.gpg > pass_file &&…
Metafaniel
- 186
- 7
3
votes
1 answer
sshpass through regular ssh client
I am using an application that uses /usr/bin/ssh and requires passwordless authentication. Meanwhile I want to use this with a server that requires both publickey and password authentication at the same time. Just using sshpass is a good solution in…
Wietse de Vries
- 203
- 1
- 5
3
votes
2 answers
sshpass with ssh -J jump host
I have a script with a couple of ssh commands that use a jump host. I would like to enter the jump and target server passwords each time and tried to use sshpass sadly "nesting" sshpass does not seems to make the trick.
sshpass -p "JumpPass" sshpass…
gervais.b
- 183
- 1
- 2
- 7
3
votes
0 answers
sshpass doesn't work with some servers?
Using sshpass in bash script.
I am connecting to the server, send the command df -h and save the output in a txt file.
It works fine with about 10 servers. I found it doesn't work with some other servers and I don't understand why. Servers are…
sover
- 31
- 3
2
votes
1 answer
SSH Tunnel with automatic reconnect and password auth in Docker container
I want to forward a Socks5 proxy using SSH with password authentication inside a Docker container. YES, I know that SSH keys would be better. But since it's not my own server, I'm not able to use keys, they just offer user/password authentication.…
Lion
- 309
- 1
- 4
- 14
2
votes
1 answer
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 the server and it's working, but it's not enough to…
Sulli
- 131
- 3
2
votes
1 answer
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 '1d' $save_file.pcap
The purpose of this script is so that…
Drew
- 23
- 6
2
votes
1 answer
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 I cannot just make a script called sshminix - it…
Ole Tange
- 33,591
- 31
- 102
- 198
2
votes
0 answers
Can't set title with gnome-terminal
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 @Jesse_b in the first comment.
gnome-terminal --maximize…
MayankD
- 43
- 11
2
votes
2 answers
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 each script. So far my attempts at getting it to…
jesse_b
- 35,934
- 12
- 91
- 140
2
votes
1 answer
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 device or address
...
Permission denied…
daisy
- 53,527
- 78
- 236
- 383