.bashrc: add sshunlock for remote unlocking servers
This commit is contained in:
parent
819e682918
commit
f3fa702da1
14
bash/.bashrc
14
bash/.bashrc
|
@ -27,5 +27,19 @@ function sshscr() {
|
|||
ssh -t $@ screen -RR -d
|
||||
}
|
||||
|
||||
# Alternative SSH session for unlocking remote encrypted servers
|
||||
# This requires a standalone known hosts file
|
||||
function sshunlock() {
|
||||
set -o pipefail
|
||||
pass show "Misc/$2" | wl-copy
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "key not found"
|
||||
return
|
||||
fi
|
||||
ssh -o UserKnownHostsFile=~/.ssh/known_hosts_unlock root@$1 -t "zfsunlock"
|
||||
echo "" | wl-copy
|
||||
set +o pipefail
|
||||
}
|
||||
|
||||
# Add local to path
|
||||
export PATH="$PATH:~/.local/bin"
|
||||
|
|
Loading…
Reference in New Issue