Jelajahi Sumber

Add ssh config handling to be

George Jones 3 tahun lalu
induk
melakukan
190f142907

+ 0 - 0
.link2home.ignore → bin/.link2home.ignore


+ 0 - 0
.link2home.ignore.default → bin/.link2home.ignore.default


+ 0 - 0
README.org → bin/README.org


+ 18 - 1
be → bin/be

@@ -41,6 +41,9 @@
 #     ~/.ssh/authorized_keys.IDENTITY   - SSH authorized keys for IDENTITY
 #     ~/.ssh/authorized_keys            - Symlink to SSH authorized_keys file
 #
+#     ~/.ssh/config.IDENTITY   - SSH config for IDENTITY
+#     ~/.ssh/config            - Symlink to SSH config file
+#
 #   * GPG Files
 #
 #   * AWS files
@@ -189,7 +192,7 @@ function ssh_list() {
     if ! cd ~/.ssh; then warn "No ~/.ssh credentials"; echo; return; fi
 
     info available SSH credentials
-    ls -ld id_rsa.* id_dsa.* authorized_keys.* || true
+    ls -ld id_rsa.* id_dsa.* authorized_keys.* config.* || true
     echo
 }
 
@@ -201,6 +204,7 @@ function ssh_whoami() {
     info
     ls -ld id_???  || warn "no ~/.ssh/id_{rsa,dsa} file"
     ls -ld authorized_keys || warn "no authorized_keys file"
+    ls -ld config || warn "no config file"
     info SSH Agent Identities
     ssh-add -l
     echo
@@ -213,6 +217,7 @@ function ssh_become() {
     rsa_creds="id_rsa.""${who}"
     dsa_creds="id_dsa.""${who}"
     authorized_keys="authorized_keys.""${who}"
+    config="config.""${who}"
 
     if [ -f "${dsa_creds}" ]; then
         ssh_creds="${dsa_creds}"
@@ -249,6 +254,18 @@ function ssh_become() {
         [[ -v VERBOSE ]] && set -x
     fi
 
+# symlnk config into ~/.ssh
+
+    target=`basename $config ".""${who}"`
+
+    if [ -f "${config}"  ]; then
+        [[ -v VERBOSE ]] && set +x
+        rm -f "${target}" || true
+        ln -s "${config}" "${target}"
+        chmod 644 "${target}"
+        [[ -v VERBOSE ]] && set -x
+    fi
+
 }
 
 

+ 0 - 0
dns2ip → bin/dns2ip


+ 0 - 0
e → bin/e


+ 0 - 0
exifSetDate → bin/exifSetDate


+ 0 - 0
exifSetDatesThisDir → bin/exifSetDatesThisDir


+ 0 - 0
fixGitTimestamps.sh → bin/fixGitTimestamps.sh


+ 0 - 0
fixctrl.sh → bin/fixctrl.sh


+ 0 - 0
frequent-commands.sh → bin/frequent-commands.sh


+ 0 - 0
gitPushOrPull → bin/gitPushOrPull


+ 0 - 0
gnome-list-shortcuts → bin/gnome-list-shortcuts


+ 0 - 0
gpgAgent.sh → bin/gpgAgent.sh


+ 0 - 0
grepOutUbunutuFiles → bin/grepOutUbunutuFiles


+ 0 - 0
install → bin/install


+ 0 - 0
ip2dns → bin/ip2dns


+ 0 - 0
jpgHasDate → bin/jpgHasDate


+ 0 - 0
jpgdates → bin/jpgdates


+ 0 - 0
link2 → bin/link2


+ 0 - 0
link2home → bin/link2home


+ 0 - 0
link2home.sh → bin/link2home.sh


+ 0 - 0
linkall → bin/linkall


+ 0 - 0
logCommand.sh → bin/logCommand.sh


+ 0 - 0
logstats.py → bin/logstats.py


+ 0 - 0
myip → bin/myip


+ 0 - 0
rdns → bin/rdns


+ 0 - 0
some → bin/some


+ 0 - 0
sshagent → bin/sshagent


+ 0 - 0
thatsNotRight.sh → bin/thatsNotRight.sh


+ 0 - 0
whoIsOnMySubnet → bin/whoIsOnMySubnet