Skip to content
www.mytechnote.ru
Menu
  • Administration
    • Scripts
  • Equipment
    • Reviews
    • Instructions
  • Other
  • English
    • English
    • Русский
Menu

How to Mount a Remote Folder Using SSH & SFTP Without NFS or Samba

Looking for a way to seamlessly connect your local and remote systems? Today, I’ll guide you through a simple, yet effective, method that harnesses the power of SSH and SFTP. You won’t even need tools like NFS or Samba.

Benefits of Using SSH and SFTP for Remote Folder Mounting

  • Security: With SSH, you get encrypted communication.
  • Simplicity: Avoid complex configurations of tools like Samba or NFS.
  • Flexibility: Great for various use-cases where you need to access remote data as if it’s local.

Step-by-Step Guide to Mounting with SSHFS

  • Installation: On an Ubuntu system (other distributions might slightly differ), start by installing sshfs. Ensure you have root privileges.
apt install sshfs
  • Basic Mounting: Here’s how to mount a remote folder quickly:

sshfs sanglyb@192.168.1.100:/home/sanglyb /mnt
  • Authentication Using Keys: If you’ve set up key-based authentication, use:

sshfs -o IdentityFile=~/.ssh/id_rsa sanglyb@192.168.1.100:/home/sanglyb /mnt
  • Custom SSH Ports: Using a non-standard SSH port? No problem!

sshfs -p 10022 -o IdentityFile=~/.ssh/id_rsa sanglyb@192.168.1.100:/home/sanglyb /mnt
  • Auto-mounting with SSHFS: Want the folder to mount automatically? Add this line to /etc/fstab:

sshfs#sanglyb@192.168.1.100:/home/sanglyb /mnt fuse defaults,idmap=user,port=22,allow_other,reconnect,_netdev,users,identityfile=/root/.ssh/id_rsa 0 0

Then, either reboot or run:

mount -a
  • Unmounting: To disconnect:

umount /mnt

Troubleshooting:

Encounter the “fuse: bad mount point `/mnt’: Transport endpoint is not connected” error? Resolve it with:

fusermount -u /mnt

Conclusion:

Mounting a remote folder using SSH and SFTP is a straightforward and secure method. Whether you’re a system admin or a tech enthusiast, this approach can make your operations efficient and hassle-free. Don’t forget to share this guide with friends or colleagues who might benefit!

Posted on 29.10.201730.05.2024 by sanglyb

Post navigation

← How to Watch YouTube on Older Smart TVs: A Simple Guide
How to Easily Set Up an IPIP Tunnel on Ubuntu 16.04 and CentOS 7 →

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Подписывайтесь

Youtube
vk
telegram
github
twitter
rss
  • Форум
  • Об авторе
  • Поддержать автора

Популярные записи

Новые записи

  • How to Extend an LVM Partition in Linux
  • SCCM Reporting Errors After Migrating from SQL Server 2016 to 2019
  • Problem Using PassFiltEx on Older CPUs
  • How to remove attachments from old calendar events in Exchange using a script
  • How to download and install Office 2024 LTSC

Архивы

  • 2026 (3)
  • 2025 (5)
  • 2024 (7)
  • 2023 (30)
  • 2022 (4)
  • 2020 (17)
  • 2017 (82)
  • 2016 (5)
© 2015-2026 www.mytechnote.ru
Использование материалов сайта возможно только с разрешения владельца или обязательна индексируемая, прямая, передающая вес ссылка на материал.