added mntBackup function to mount the remote backup server directory

added sshp function for ssh with password forced
added community center and geoff to ssh configs
master
Kebler Network System Administrator 2021-11-20 17:36:49 -08:00
parent e396386725
commit ccb75844ac
5 changed files with 154 additions and 83 deletions

0
238.kebler.net/function/gateway Normal file → Executable file
View File

View File

@ -56,7 +56,7 @@ function mnttrantor() {
smount sysadmin@trantor.kebler.net:/opt /mnt/238/trantor/opt -p 22 smount sysadmin@trantor.kebler.net:/opt /mnt/238/trantor/opt -p 22
smount sysadmin@trantor.kebler.net:/mnt/data /mnt/238/trantor/data -p 22 smount sysadmin@trantor.kebler.net:/mnt/data /mnt/238/trantor/data -p 22
smount root@trantor.kebler.net:/ /mnt/238/trantor/root -p 22 smount root@trantor.kebler.net:/ /mnt/238/trantor/root -p 22
smount sysadmin@trantor.kebler.net:/backup /mnt/238/trantor/backup -p 22 smount root@trantor.kebler.net:/backup /mnt/238/trantor/backup -p 22
} }
function umnttrantor() { function umnttrantor() {
@ -86,3 +86,19 @@ function mnt238hass() {
function umnt238hass() { function umnt238hass() {
usmount /mnt/238/hass usmount /mnt/238/hass
} }
function mntgeoff() {
smount sysadmin@geoff.net:/home/sysadmin /mnt/geoff/sysadmin -p 22
smount geoff@geoff.net:/home/geoff /mnt/geoff/geoff -p 22
smount root@geoff.net:/ /mnt/geoff/root -p 22
smount sysadmin@geoff.net:/opt /mnt/geoff/opt -p 22
smount sysadmin@geoff.net:/data /mnt/geoff/data -p 22
}
function umntgeoff() {
usmount /mnt/geoff/data
usmount /mnt/geoff/opt
usmount /mnt/geoff/root
usmount /mnt/geoff/geoff
usmount /mnt/geoff/sysadmin
}

View File

@ -9,146 +9,183 @@ ForwardX11Trusted yes
## router ## router
Host 238gate Host 238gate
user sysadmin user sysadmin
hostname gateway.238.kebler.net hostname gateway.238.kebler.net
Host 238gater Host 238gater
user root user root
hostname gateway.238.kebler.net hostname gateway.238.kebler.net
Host 238nas Host 238nas
user sysadmin user sysadmin
hostname nas.238.kebler.net hostname nas.238.kebler.net
ForwardX11 yes ForwardX11 yes
Host 238nasr Host 238nasr
user root user root
hostname nas.kebler.net hostname nas.kebler.net
ForwardX11 yes ForwardX11 yes
Host 238water water Host 238water water
user sysadmin user sysadmin
hostname water.238.kebler.net hostname water.238.kebler.net
Host 238waterr waterr Host 238waterr waterr
user root user root
hostname water.238.kebler.net hostname water.238.kebler.net
Host 238hass 238ha Host 238hass 238ha
user root user root
hostname hassio.238.kebler.net hostname hassio.238.kebler.net
port 22 port 22
Host 238hasshost 238hahost Host 238hasshost 238hahost
user root user root
hostname hassio.238.kebler.net hostname hassio.238.kebler.net
port 22222 port 22222
Host 238admin trantor Host 238admin trantor
user sysadmin user sysadmin
hostname admin.238.kebler.net hostname admin.238.kebler.net
ForwardX11 yes ForwardX11 yes
Host 238adminr trantorr Host 238adminr trantorr
user root user root
hostname admin.238.kebler.net hostname admin.238.kebler.net
ForwardX11 yes ForwardX11 yes
Host 288adminb trantorb Host 288adminb trantorb
user root user root
hostname trantor.kebler.net hostname trantor.kebler.net
IdentityFile /mnt/AllData/secure/privatekeys/xfer.kebler.net IdentityFile /mnt/AllData/secure/privatekeys/xfer.kebler.net
IdentitiesOnly yes IdentitiesOnly yes
# ServerAliveInterval 60 # ServerAliveInterval 60
# ServerAliveCountMax 240 # ServerAliveCountMax 240
Host seldon printer Host seldon printer
user sysadmin user sysadmin
hostname seldon.kebler.net hostname seldon.kebler.net
ForwardX11 yes ForwardX11 yes
Host rseldon Host rseldon
user root user root
hostname seldon.kebler.net hostname seldon.kebler.net
ForwardX11 yes ForwardX11 yes
# Lights Sytem Network # Lights Sytem Network
# relays # relays
Host r238lights Host r238lights
user sysadmin user sysadmin
hostname lights.238.kebler.net hostname lights.238.kebler.net
port 222 port 222
Host r238lightsr Host r238lightsr
user root user root
hostname lights.238.kebler.net hostname lights.238.kebler.net
port 222 port 222
# switches # switches
Host s238lights Host s238lights
user sysadmin user sysadmin
hostname lights.238.kebler.net hostname lights.238.kebler.net
port 122 port 122
Host s238lightsr Host s238lightsr
user root user root
hostname lights.238.kebler.net hostname lights.238.kebler.net
port 122 port 122
# controller # controller
Host 238lights Host 238lights
user sysadmin user sysadmin
hostname lights.238.kebler.net hostname lights.238.kebler.net
port 22 port 22
# root connections # root connections
Host 238lightsr Host 238lightsr
user root user root
hostname lights.238.kebler.net hostname lights.238.kebler.net
port 22 port 22
## FOR ACCESS WHEN OUTSIDE 238 VIA NAT PORT FORWARDING WHEN VPN IS OFFLINE ## FOR ACCESS WHEN OUTSIDE 238 VIA NAT PORT FORWARDING WHEN VPN IS OFFLINE
Host w238nas Host w238nas
user sysadmin user sysadmin
hostname 238.kebler.net hostname 238.kebler.net
port 322 port 322
ForwardX11 yes ForwardX11 yes
Host w238nasf Host w238nasf
user sysadmin user sysadmin
hostname 238.kebler.net hostname 238.kebler.net
port 322 port 322
IdentityFile ~/.ssh/sysadmin.kebler.net IdentityFile ~/.ssh/sysadmin.kebler.net
ForwardX11 yes ForwardX11 yes
Host w238nasr Host w238nasr
user root user root
hostname 238.kebler.net hostname 238.kebler.net
port 322 port 322
ForwardX11 yes ForwardX11 yes
## router ## router
Host w238gate Host w238gate
user sysadmin user sysadmin
hostname 238.kebler.net hostname 238.kebler.net
IdentityFile ~/.ssh/sysadmin.kebler.net IdentityFile ~/.ssh/sysadmin.kebler.net
Host w238gater Host w238gater
user root user root
hostname 238.kebler.net hostname 238.kebler.net
IdentityFile ~/.ssh/sysadmin.kebler.net IdentityFile ~/.ssh/sysadmin.kebler.net
# admin server trantor # admin server trantor
Host wtrantor Host wtrantor
user sysadmin user sysadmin
hostname 238.kebler.net hostname 238.kebler.net
port 222 port 222
IdentityFile ~/.ssh/sysadmin.kebler.net IdentityFile ~/.ssh/sysadmin.kebler.net
Host wtrantorr Host wtrantorr
user root user root
hostname 238.kebler.net hostname 238.kebler.net
port 222 port 222
IdentityFile ~/.ssh/sysadmin.kebler.net IdentityFile ~/.ssh/sysadmin.kebler.net
## community center within 238 network
Host ccavw
user sysadmin
hostname cc.gpccaor.net
port 222
IdentityFile ~/.ssh/sysadmin.kebler.net
Host ccav
user sysadmin
hostname av.cc.gpccaor.net
port 22
IdentityFile ~/.ssh/sysadmin.kebler.net
Host ccadmin
user sysadmin
hostname admin.cc.gpccaor.net
port 22
IdentityFile ~/.ssh/sysadmin.kebler.net
# other
Host phone
user sysadmin
hostname 10.0.0.212
port 8022
Host geoff
user sysadmin
hostname geoff.net
port 22
Host geoffr
user root
hostname geoff.net
port 22

View File

@ -81,6 +81,16 @@ ssh() {
fi fi
} }
sshp() {
local opts="-o PreferredAuthentications=password -o PubkeyAuthentication=no"
if [[ $SSH_CONFIG ]]; then
[[ ! -f "$SSH_CONFIG" ]] && ssh_config "$SSH_CONFIG"
command ssh $opts -F $SSH_CONFIG "$@"
else
command ssh $opts "$@"
fi
}
ssh_test() { ssh_test() {
echo running non-interactive ssh test on $2 with user $1 echo running non-interactive ssh test on $2 with user $1
ssh $1@$2 "cat .bashrc" ssh $1@$2 "cat .bashrc"

View File

@ -23,7 +23,7 @@ function smount() {
[[ ! -f "$SSH_CONFIG" ]] && ssh_config "$SSH_CONFIG" [[ ! -f "$SSH_CONFIG" ]] && ssh_config "$SSH_CONFIG"
config=$([[ -f $SSH_CONFIG ]] && echo "-F $SSH_CONFIG") config=$([[ -f $SSH_CONFIG ]] && echo "-F $SSH_CONFIG")
fi fi
# echo sshfs "$*" "$config" # echo sshfs "$*" "$config"
sshfs $* $config sshfs $* $config
fi fi
} }
@ -36,3 +36,11 @@ function usmount() {
echo "nothing mounted at $1, aborting unmount" echo "nothing mounted at $1, aborting unmount"
fi fi
} }
function mntBackup() {
smount root@$1:/backup /backup/remote -p 22 -o allow_other
}
function umntBackup() {
usmount /backup/remote
}