Skip to content

Isn't sshkey from vm back to host a security risk?

That means that if someone got access to my vm then they can automatically get into my host doesn't it?

If so what is a better alternative? I want to be able to automount my sshfs shared folders on the vm from host on boot but the stuff I read said you need sshkeys for that.

I am taking the same security protocols on the guest as I would on the host so I suppose it isn't any more vulnerable to attack than the host but still..wondering what the correct protocol is in this situation.

I ask because I was reading the sshfs archwiki and it said to use keys in order to setup the fstab for automounting.

6 points17 comments
Open on Reddit
About this post
Posted
Archived
Score
6 · 100% up
Kind
Text
ID
5316bm

Author

394
posts
510
comments
3
media
View profile

17 comments

You can restrict an account to only sshfs and to only certain directories.

4 points

ah cool hadn't thought of that. So then would the sshkey only be valid for that user rather than valid for anyone using that machine to login?

What should I look in order to set that up re the relevant info.

2 points

SSH forced commands. You lock down the key to only run a specific command on the receiving end.

3 points

You can also restrict the commands you can run when logging in with a certain ssh key.

1 points

Why not use NFS?

3 points

I don't have a preference I just read all of them in the wiki and happened to choose sshfs since I've used ssh and so thought I might be more familiar with the syntax. Is it easier to use nfs?

1 points

Sshfs is pretty much the easiest network filesystem, but it is also slower and less configurable than NFS. It's worth checking out if you are interested.

4 points

I want to be able to automount my sshfs shared folders on the vm from host on boot

Why do you want to do this? Just create a shell script to mount the shared folders, and run the script using sudo after you ssh in.

3 points

Oh didn't think of that but I still prefer not to have to have to type password everytime. altho not so bad if I am in ssh and can c + p rather than having to type in the console.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.