-3

I have a Shell bash file that i run as sudo and it contains a file to send a ssh comand to bulk clients but it asks for the password every time and i do not what key based ssh the password is the same for all of the hostnames. i also do not whant to install any outhr software.

the clients are debian and the host ubuntu 14.04

Jhondoe
  • 381
  • 1
  • 3
  • 12
  • What about ssh keys? – Romeo Ninov Feb 06 '15 at 17:35
  • SSH-keys is what you want and I answered how to set them up here. Instead of scp just ssh. – devnull Feb 06 '15 at 17:45
  • 2
    Is there any reason why you will not use the tools ssh give to you, neither install other software to do the work? –  Feb 06 '15 at 18:33
  • I´m deleting my answer here since we have given you 2 Options: sshpass and "key based authentication". You could even install expect but you are just promoting a Xy problem and you seems to not even care changing your mind. These are the 3 only options you have. Deal with it. –  Jan 19 '16 at 10:47

1 Answers1

0

Host based authentication works without prompting passwords and installing user's pub keys

Do only step 1 and replace .shosts with .rhosts to use rsh which is safe in Kerberos environment.

1 Add clients's host name and user name of a user who wants access to server.
server$ echo '<client's hostname> <user name>' >> ~/.shosts

2 Append client's public host keys to the server's known_hosts.
client$ cat /etc/ssh/ssh_host_rsa_key.pub | ssh user@server 'cat >> ~/.ssh/known_hosts'

3 Tell server to not reverse look up client's ip to find client's host name.
server# echo 'HostbasedUsesNameFromPacketOnly yes' >> /etc/ssh/sshd_config.

4 Ask server not to ignore .shosts file.
server# echo 'IgnoreRhosts no' >> /etc/ssh/sshd_config
server# service sshd reload

  • "i do not what key based ssh the" - Unfortunately, this guy does not want a key based authentication too... –  Feb 09 '15 at 18:55