How to start multiple SSH sessions with single password?

ASKRI NASREDINNE

I'm a system administrator in a company based in Tunisia. I control 50+ Raspberry Pis with Debian Jessie. I connect frequently over SSH with the same password for all of them.

Is there any solution to use the password once and not enter it again?

My PC: gnome-Ubuntu 16.04
Raspberry Pis: Jessie arm6vl

nickcrabtree

Ubuntu has a package called sshpass. Install it on Ubuntu 16.04 like this:

sudo apt install sshpass

And use it like this:

sshpass -p 'YourPassword' ssh user@host

For multiple hosts you can do something like:

for host in hostname1 hostname2 hostname3; do \
    sshpass -oStrictHostKeyChecking=no \
    -p 'YourPassword' ssh user@${host} "hostname; df -h; echo"; done

The StrictHostKeyChecking disables the usual SSH check that the remote machine is in your list of known hosts; if you are deploying a Pi farm this will probably be the case. When using sshpass, instead of displaying the message 'The authenticity of host xxxx can't be established', the command silently fails without this option.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Single SSH History for multiple sessions?

How can I have multiple terminal sessions through one single SSH connection?

How can I start multiple screen sessions automatically?

How does Spring Session support multiple sessions within a single browser?

AWS single session OR multiple sessions?

Multiple ssh in a Single command

Multiple sessions on the same browser for one single webapp

Running multiple Appium sessions in a single test

How to set password-less ssh login for multiple remote severs?

How can I launch multiple screen sessions from a single bash script?

How to save multiple sessions in tmux?

How to start multiple ssh-session from a bash script

How to start multiple streaming queries in a single Spark application?

How to start ssh sever android programmatically, and how i will get username and password for connect to device

How to set default DISPLAY for all SSH sessions?

How to log connect/disconnects of outgoing ssh sessions?

User sessions invalid after changing password, but only with multiple threads

How can I automatically start an SSH tunnel when I put in my Pageant password?

How to kill all tmux sessions (or at least multiple sessions) from the CLI?

Sharing the same `ssh-agent` among multiple login sessions

Auto-start multiple background user sessions in Linux Mint

Query to only grab entities with multiple sessions in a single date?

Multiple PHP Web Servers to Share a Single Redis Server for User Sessions

Interactivity between multiple sessions of a single running R Shiny app

Separate login sessions for multiple subdomains in a single flask app

how to ssh to a server without password when there is no .ssh on it

How to retrieve ssh password with a working ssh key

how to disable password and root ssh?

How to save ssh password to vscode?