From 9e9dbc85916b0326e53605de39c76d45f98d56b4 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Sat, 9 Mar 2024 19:30:13 +0300 Subject: [PATCH] Ssh : Add ssh_keygen function. --- module/common/bash/module/Ssh.sh | 9 +++++++-- module/common/ssh/config | 3 --- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/module/common/bash/module/Ssh.sh b/module/common/bash/module/Ssh.sh index 45ed7129..77675e78 100644 --- a/module/common/bash/module/Ssh.sh +++ b/module/common/bash/module/Ssh.sh @@ -1,7 +1,12 @@ # Mount FS over ssh. Just extra config for sshfs. -# Usage: sshmount -function sshmount() { +# Usage: ssh_mount +function ssh_mount() { sshfs -o uid=${UID},auto_unmount "${@}" } +# Generate private an public keys on a local host and print a public key. +function ssh_keygen() { + ssh-keygen -f ~/.ssh/key && cat ~/.ssh/key.pub +} + complete -o nospace -F _sshfs sshmount diff --git a/module/common/ssh/config b/module/common/ssh/config index 27ec7382..603d9586 100644 --- a/module/common/ssh/config +++ b/module/common/ssh/config @@ -22,9 +22,6 @@ Host home HostName 192.168.1.2 User root Port 22143 - ControlPath ~/.ssh/S.%r@%h:%p - ControlMaster auto - ControlPersist 15m Host laptop Hostname 192.168.1.9