Are you a spammer

Please note, that the first 3 posts you make, will need to be approved by a forum Administrator or Moderator before they are publicly viewable.
Each application to join this forum is checked at the Stop Forum Spam website. If the email or IP address appears there when checked, you will not be allowed to join this forum.
If you get past this check and post spam on this forum, your posts will be immediately deleted and your account inactivated.You will then be banned and your IP will be submitted to your ISP, notifying them of your spamming. So your spam links will only be seen for an hour or two at most. In other words, don't waste your time and ours.

This forum is for the use and enjoyment of the members and visitors looking to learn about and share information regarding the topics listed. It is not a free-for-all advertising venue. Your time would be better spent pursuing legitimate avenues of promoting your websites.

How to mount remote folders via ssh

Post your How to's here


How to mount remote folders via ssh

Postby tuxsax » Sat Nov 01, 2008 3:43 pm

I don't know if this have been posted in the past, I use this a lot, to be able to browse my home PC folders from my work PC as if it were a network neighbor PC

In order to mount remote SSH folders from Ubuntu/Kubuntu client PC you need to do the following
Code: Select all
sudo apt-get install sshfs

Now we will use the modprobe command to load it
Code: Select all
sudo modprobe fuse

Now you need to set up some permissions in order to access the utilities.
Replace with your username.
Code: Select all
sudo useradd -G fuse yourusername
sudo chown yourusername:fuse /dev/fuse
sudo chmod +x /usr/bin/fusermount

Create the mountpoints
Code: Select all
sudo mkdir /mnt/sshfs
mkdir /mnt/sshfs/remotedirname

IMPORTANT: Do NOT use sudo in the last command!

Now edit /etc/fstab and add the following in this format,
pay attention to replace the uid and gid with your user uid and gid.
(ALL IN ONE LINE!)
Code: Select all
# <file system> <mount point> <type> <options>
sshfs#[email protected]:/home/yourusername /mnt/sshfs/remotedirname fuse comment=sshfs,users,noauto,uid=1000,gid=1000,allow_other,reconnect,transform_symlinks 0 0

Next, you should put the following in /etc/fuse.conf (create the file if it doesn't exist):
Code: Select all
user_allow_other

To see if your fstab entry works, open up a terminal and try to mount it like this
Code: Select all
mount /mnt/sshfs/remotedir

Then see if your sshfs share has been successfully mounted, for example, by:
Code: Select all
ls /mnt/sshfs/remotedir

You should see your remote files (DUH!)
Notice that even the entry is in /etc/fstab the system won't mount
the remote folder automatically, because it would do it as root, not as user
and that would make the folders unavailable for the regular user,
so the way to mount it as user is to add a Gnome or KDE startup session
command that mounts the folder after logged in.
Because the mount point is in fstab, you'll get an icon of the remote folder in your desktop.

Hope it helps and that you find it useful!

Enjoy,
Ziv
______________________________
Two things I love: Linux and my sax
tuxsax
U.E. Master
U.E. Master
 
Posts: 790
Joined: Sat Apr 26, 2008 4:15 am
Age: 53
Operating System: Ultimate Edition Beta Tester

Return to How To's (Do not post questions please)

Who is online

Users browsing this forum: No registered users and 2 guests