Quantcast
Channel: Can you set passwords in .ssh/config to allow automatic login? - Ask Ubuntu
Viewing all articles
Browse latest Browse all 16

Answer by Arek Burdach for Can you set passwords in .ssh/config to allow automatic login?

$
0
0

You can create a simple ssh script replacement in /usr/local/bin:

#!/bin/bashhost=$1password=`awk "/#Password/ && inhost { print \\\$2 } /Host/ { inhost=0 } /Host $host/ { inhost=1 }" ~/.ssh/config`if [[ -z "$password" ]]; then  /usr/bin/ssh $*else  sshpass -p $password /usr/bin/ssh $*fi

And then in your ~/.ssh/config file you can use

Host foohost    User baruser    #Password foobarpassword

Viewing all articles
Browse latest Browse all 16

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>