Re: echo password into bash script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Use expect?

Eero
25.8.2015 7.52 ip. "Tim Dunphy" <bluethundr@xxxxxxxxx> kirjoitti:

> Hey guys,
>
>  I'm trying to echo my password into some commands inside of a bash script.
> But I think I'm going about it incorrectly.
>
> Here's the top part of my script:
>
> #!/bin/bash
> pub="~/.ssh/id_rsa.pub"
> dps_pass="my_pass"
> ssh="/usr/bin/ssh"
> scp="/usr/bin/scp"
> for i in 10.10.10.2{5,6}
> do
> echo "xfring key up"
> echo $dps_pass |  $scp $PUB  digitalplatform@$i:
>
>
> And here's how it executes:
>
>  #bash -x deploy_key.sh
> + pub='~/.ssh/id_rsa.pub'
> + dps_pass='nbcuV01P!'
> + ssh=/usr/bin/ssh
> + scp=/usr/bin/scp
> + for i in 10.10.10.2{5.6}
> + echo 'xfring key up'
> xfring key up
> + echo 'my_pass'
> + /usr/bin/scp /Users/my_user/.ssh/id_rsa.pub digitalplatform@10.10.10.25:
> Password:
>
> Can someone please let me know where I'm going wrong?
>
> Thanks
> Tim
> --
> GPG me!!
>
> gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
> _______________________________________________
> CentOS mailing list
> CentOS@xxxxxxxxxx
> http://lists.centos.org/mailman/listinfo/centos
>
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux