Sshfs: Difference between revisions
From James's Wiki
No edit summary |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
==Install== | |||
sudo apt install sshfs | |||
==Mount== | |||
sudo -u <username> sshfs -p 2222 "<username>@192.168.1.50:<remote directory>" <mountpoint> | sudo -u <username> sshfs -p 2222 "<username>@192.168.1.50:<remote directory>" <mountpoint> | ||
sshfs -p 2222 "<username>@192.168.1.50:<remote directory>" <mountpoint> | sshfs -p 2222 "<username>@192.168.1.50:<remote directory>" <mountpoint> | ||
==Mount as root and give access to all== | |||
sudo sshfs -o allow_other someuser@192.168.1.102:/media/movies /media/Movies | |||
Enter the login password when requested if using password authentication. If the remote server uses SSH key authorization, provide the path of the private key. For example: | |||
sudo sshfs -o allow_other,IdentityFile=/home/kb/.ssh/id_rsa ubuntu@131.153.142.254:/home/ubuntu/ /mnt/test/ | |||
notes: | notes: | ||
Line 19: | Line 30: | ||
to fix sshfs timeout issues: | to fix sshfs timeout issues: | ||
enable ServerAliveInterval in the client's (your workstation) ssh_config file. | enable ServerAliveInterval in the client's (your workstation) ssh_config file. (I did this on the server side) | ||
sudo nano /etc/ssh/ssh_config | sudo nano /etc/ssh/ssh_config | ||
Latest revision as of 18:18, 29 January 2023
Install
sudo apt install sshfs
Mount
sudo -u <username> sshfs -p 2222 "<username>@192.168.1.50:<remote directory>" <mountpoint>
sshfs -p 2222 "<username>@192.168.1.50:<remote directory>" <mountpoint>
Mount as root and give access to all
sudo sshfs -o allow_other someuser@192.168.1.102:/media/movies /media/Movies
Enter the login password when requested if using password authentication. If the remote server uses SSH key authorization, provide the path of the private key. For example:
sudo sshfs -o allow_other,IdentityFile=/home/kb/.ssh/id_rsa ubuntu@131.153.142.254:/home/ubuntu/ /mnt/test/
notes:
the "-p 2222" option MUST come first not last or things just don't work
setup RSA keys for the user to the server for passwordless connection
don't run as sshfs sudo, its fuse...designed to be done by the user
to mount:
sshfs -o allow_other -p 2222 "<username>@192.168.1.41:/media/2USB/New Stuff" /media/aria/
to unmount:
fusermount -u /media/aria/
to fix sshfs timeout issues: enable ServerAliveInterval in the client's (your workstation) ssh_config file. (I did this on the server side)
sudo nano /etc/ssh/ssh_config
Append/modify values as follows:
ServerAliveInterval 15 ServerAliveCountMax 3
References
https://www.linode.com/docs/networking/ssh/using-sshfs-on-linux