aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xkvmx24
1 files changed, 21 insertions, 3 deletions
diff --git a/kvmx b/kvmx
index 4fcc084..616631d 100755
--- a/kvmx
+++ b/kvmx
@@ -66,9 +66,9 @@ function __kvmx_ssh_command {
fi
# See http://blog.djm.net.au/2013/11/chacha20-and-poly1305-in-openssh.html
- SSH_OPTS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=FATAL -o ProxyCommand=none -o Ciphers=chacha20-poly1305@openssh.com -o User=$SSH_LOGIN $ssh_key_param"
- SSH_COMMAND="ssh $SSH_OPTS"
- SCP_COMMAND="scp $SSH_OPTS"
+ SSH_OPTS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=FATAL -o ProxyCommand=none -o Ciphers=chacha20-poly1305@openssh.com $ssh_key_param"
+ SSH_COMMAND="ssh $SSH_OPTS -o User=$SSH_LOGIN"
+ SCP_COMMAND="scp $SSH_OPTS -o User=$SSH_LOGIN"
}
# Create a guest entry at the global user config folder
@@ -784,6 +784,24 @@ EOF
fi
}
+# Mount a guest folder into the host using sshfs
+function kvmx_sshfs {
+ local folder="$1"
+ local mountpoint="$2"
+
+ if [ -z "$mountpoint" ]; then
+ kvmx_usage
+ fi
+
+ if ! which sshfs &> /dev/null; then
+ echo "$BASENAME: this action requires sshfs to be installed on your system."
+ exit 1
+ fi
+
+ SSH="`cat $SSHFILE`"
+ sshfs $SSH_LOGIN@127.0.0.1:$folder $mountpoint $SSH_OPTS -o nonempty -p $SSH
+}
+
# Get guest PID
function kvmx_pid {
if [ -e "$PIDFILE" ]; then