You are not logged in.

#1 2018-12-03 16:25:13

damonh
Member
From: Uruguay
Registered: 2017-12-20
Posts: 6

Mount sshfs at startup

Hey,
I've been trying to automatically mount a directory using sshfs on startup but always failed :-(
I used /etc/fstab but i didn't work, now I tried following the explanation in this thread but it doesn't work neither!

I created a service file: /etc/systemd/system/custom-mounts.service with this content:

[Unit]
Description=Custom network mount points

[Service]
ExecStart=/usr/bin/custom-mounts

[Install]
WantedBy=multi-user.target

Then I enabled and started the service file...

sudo systemctl enable custom-mounts.service 
sudo systemctl start custom-mounts.service

but nothing happened.

The content of the script /usr/bin/custom-mounts is:

#!/bin/bash
# Mounts a development project into personal development folder
sshfs developer@grocery.devel:/home/developer/web/grocery.devel/public_html/ /home/mlopez/Development/hsm

Files are:

-rwxr-xr-x 1 mlopez mlopez 182 dic  3 12:37 /usr/bin/custom-mounts*
-rwxr-xr-x 1 root root 132 dic  3 12:35 /etc/systemd/system/custom-mounts.service*

I have also connected using ssh keys with user developer and root before and if i run /usr/bin/custom-mounts, it does mount the directory correctly!

But when I start the custom-mount service and ask for the status I get an error message:

● custom-mounts.service - Custom network mount points
   Loaded: loaded (/etc/systemd/system/custom-mounts.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2018-12-03 13:17:31 -03; 3s ago
  Process: 18637 ExecStart=/usr/bin/custom-mounts (code=exited, status=1/FAILURE)
 Main PID: 18637 (code=exited, status=1/FAILURE)

dic 03 13:17:30 maujaro-main systemd[1]: Started Custom network mount points.
[b]dic 03 13:17:31 maujaro-main custom-mounts[18637]: sshfs: bad mount point `/home/mlopez/Development/hsm': Permission denied[/b]
dic 03 13:17:31 maujaro-main systemd[1]: custom-mounts.service: Main process exited, code=exited, status=1/FAILURE
dic 03 13:17:31 maujaro-main systemd[1]: custom-mounts.service: Failed with result 'exit-code'.

What am I doing wrong? Why permissions aren't right if it's the same user mlopez?


--
Damon H. {uy}

Offline

#2 2018-12-03 16:32:48

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,703
Website

Re: Mount sshfs at startup

What am I doing wrong?

You are seeking support for a Manjaro system on the Arch Linux forums, something you explicitly agreed not to do when you registered for your account.

https://wiki.archlinux.org/index.php/Co … ort_*only*

Closing, for deletion.

Apologies, it seems dyslexia got the better of me in this instance. Reopened.

Have you read https://wiki.archlinux.org/index.php/SSHFS#On_boot?

Last edited by WorMzy (2018-12-03 16:40:55)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB