I have both a remote and local machine running Debian. The remote is running Debian GNU/Linux 8 and the local machine is running Debian GNU/Linux 9. I have been trying to mount my remote home directory in my local machine using SSHFS.
So far, here is what I have done:
GENERATED A KEY-PAIR TO LOGIN WITH SSH
1. Logged in as jaytelford I ran: ssh-keygen
2. When I was asked to enter a password, I hit enter and left it blank and then enter again to confirm
UPLOADED THE PUBLIC KEY CREATED IN THE PREVIOUS STEP TO THE REMOTE LOCATION
Note: I have replaced my actual remote locations IP address with 0.0.0.0 but during upload I used the correct one.
1. Uploaded the public key to the servers jaytelford account authorized key file via Terminal using:
Code: Select all
ssh-copy-id -i /home/jaytelford/.ssh/id_rsa.pub jaytelford@0.0.0.0
Code: Select all
ssh -i /home/jaytelford/.ssh/id_rsa jaytelford@0.0.0.0
3. Made sure I was being logged into the correct directory on the remote by issuing the ls command.
SET UP SSHFS ON THE LOCAL MACHINE
1. While logged in as root, I entered this into Terminal to install SSHFS on the local machine
Code: Select all
apt-get install sshfs
Code: Select all
mkdir /home/jaytelford/server
Code: Select all
sshfs jaytelford@0.0.0.0:/home/jaytelford /home/jaytelford/server
EDITING THE FSTAB SO THAT THE REMOTE IS MOUNTED AT BOOT OR WAKEUP
1. I backed up the original fstab into the root directory by entering this into my Terminal while logged in as jaytelford.
Code: Select all
sudo cp /etc/fstab /root/fstab.bak
2. I then made the mount persistent by opening the fstab in vim (using sudo), moving to the bottom of the file an entering this on a single line
Code: Select all
sshfs#jaytelford@0.0.0.0:/home/jaytelford /home/jaytelford/server fuse defaults,allow_other,delay_connect,IdentityFile=/home/jaytelford/.ssh/id_rsa 0 0
PROBLEMS I AM HAVING AFTER MAKING THE MOUNT PERSISTENT
After making the mount persistent by editing the fstab as described above and rebooting the system, i came across an unexpected error. Although the remote is indeed mounted when the system boots, I can not access it either in Terminal or in the graphical files app.
When I try to cd into the server directory in Terminal (the directory I am using for the remote mount point) I get Read/Write error. If I try to access the server directory from within the graphical files app, I get an error that says "unknown file" and there is an option to choose which app I want to use to open the file. Choosing either Files or Terminal fails with these exact same errors.
Doing an ls in Terminal tells me that the server directory can not be listed
I can not unmount the remote either. Either from Terminal or the Files app. If I try, I get the same errors as described above.
The only way I was able to access the remote mount point, was to restore the fstab from backup, reboot the system and mount the remote manually, as described above during my set up and testing. Mounting manually works fine and also as described above, I have full access to the remote via the mount point if I mount the remote manually. Editing the fstab to mount the remote at boot however, always seems to succeed, but then I cant access the mount point, once I am actually logged into my user local user account.
Have I done something wrong in the setup or misunderstood the steps I needed to take to get this work?