loucapo
Posts: 6
Joined: Tue Sep 17, 2019 4:01 pm

accessing a usb drive over the network from osx via ssh

Tue Sep 17, 2019 4:07 pm

I am a new owner of a raspberry pi 4 and have limited experience in linux, but a bunch in WIn / OSX. I am trying to use SSH to connect from my mac to my pi's external usb drive to copy home videos / pics to it. the connection is working fine in SSH but anytime i try to add a new file or folder, i get permission denied messages. I THINK i have the drive formatted as Fat32 and as a result i cannot run chown on it. every file and folder is listed as r/w/x permissions for anyone.

any help is greatly appreciated. let me know if you need any more info.

TIA!

loucapo
Posts: 6
Joined: Tue Sep 17, 2019 4:01 pm

Re: accessing a usb drive over the network from osx via ssh

Wed Oct 02, 2019 5:01 pm

anyone have any ideas here? i am still stuck.

Andyroo

Re: accessing a usb drive over the network from osx via ssh

Wed Oct 02, 2019 5:46 pm

Do you have the drive mounted through fstab or via a manual mount?
Is the mount point security set to give access?

It would help if you gave the actual command you are running and confirm what the drive format is please...

User avatar
Roken
Posts: 309
Joined: Sun Dec 31, 2017 4:35 pm
Location: UK

Re: accessing a usb drive over the network from osx via ssh

Wed Oct 02, 2019 6:10 pm

How are you copying files. Try scp (https://en.wikipedia.org/wiki/Secure_copy)
Headless PI. OMG, someone cut it's head off. Oh, hang on. it didn't have one to start with.

loucapo
Posts: 6
Joined: Tue Sep 17, 2019 4:01 pm

Re: accessing a usb drive over the network from osx via ssh

Wed Oct 02, 2019 7:45 pm

Thanks for the replies!

So I just got it that i can write to a subdirectory on my external drive attached to my pi if i SSH (CyberDuck) to it, logged in as user pi. I am trying to use the same user but in a third party osx app called Chronosync. it connects over SSH (SFTP) and i can see everything but any time i try to write, i get a permission denied.


I am mounted using fstab:
UUID=XX /media/phantom exfat defaults 0 0


loucapo
Posts: 6
Joined: Tue Sep 17, 2019 4:01 pm

Re: accessing a usb drive over the network from osx via ssh

Thu Oct 03, 2019 12:01 pm

i'm using the same username and password on both cyberduck and chronosync.

Andyroo

Re: accessing a usb drive over the network from osx via ssh

Thu Oct 03, 2019 12:21 pm

Have a look in /ver/log/auth.log for any errors. If not step up the amount of logging:

Edit the /etc/ssh/sshd_config file and change the line near the end that reads Subsystem sftp /usr/lib/openssh/sftp-server to

Code: Select all

Subsystem	sftp	/usr/lib/openssh/sftp-server -l VERBOSE
and then restart the Pi (think you may get away with just restarting sshd but that will also drop your connection :lol:

If INFO (the default) or VERBOSE (above) does not give you any clues you can try DEBUG as the parameter.

If this does not help then https://en.wikibooks.org/wiki/OpenSSH/L ... leshooting may do (but its loooong)...

loucapo
Posts: 6
Joined: Tue Sep 17, 2019 4:01 pm

Re: accessing a usb drive over the network from osx via ssh

Thu Oct 03, 2019 3:19 pm

When i set it to verbose, this is what i see in log.

Oct 3 11:12:51 pi sftp-server[1328]: lstat name "/media/asdf/aaaa/.-cs-080.LT.jpg"
Oct 3 11:12:51 pi sftp-server[1328]: sent status No such file
Oct 3 11:12:51 pi sftp-server[1328]: open "/media/asdf/aaaa/.-cs-080.LT.jpg" flags WRITE,CREATE,EXCL mode 0100700
Oct 3 11:12:51 pi sftp-server[1328]: close "/media/asdf/aaaa/.-cs-080.LT.jpg" bytes read 0 written 0
Oct 3 11:12:51 pi sftp-server[1328]: lstat name "/media/asdf/aaaa/.-cs-080.LT.jpg"
Oct 3 11:12:51 pi sftp-server[1328]: open "/media/asdf/aaaa/.-cs-080.LT.jpg" flags WRITE,TRUNCATE mode 0100700
Oct 3 11:12:51 pi sftp-server[1328]: close "/media/asdf/aaaa/.-cs-080.LT.jpg" bytes read 0 written 58349
Oct 3 11:12:51 pi sftp-server[1328]: set "/media/asdf/aaaa/.-cs-080.LT.jpg" mode 100644
Oct 3 11:12:51 pi sftp-server[1328]: set "/media/asdf/aaaa/.-cs-080.LT.jpg" modtime 20190919-16:54:32
Oct 3 11:12:51 pi sftp-server[1328]: sent status Permission denied
Oct 3 11:12:51 pi sftp-server[1328]: lstat name "/media/asdf/aaaa/.-cs-080.LT.jpg"
Oct 3 11:12:51 pi sftp-server[1328]: remove name "/media/asdf/aaaa/.-cs-080.LT.jpg"

and in debug:

Oct 3 11:23:26 pi sftp-server[1269]: lstat name "/media/asdf/aaaa/.-cs-080.LT.jpg"
Oct 3 11:23:26 pi sftp-server[1269]: sent status No such file
Oct 3 11:23:26 pi sftp-server[1269]: open "/media/asdf/aaaa/.-cs-080.LT.jpg" flags WRITE,CREATE,EXCL mode 0100700
Oct 3 11:23:26 pi sftp-server[1269]: debug1: request 1418: sent handle handle 0
Oct 3 11:23:26 pi sftp-server[1269]: close "/media/asdf/aaaa/.-cs-080.LT.jpg" bytes read 0 written 0
Oct 3 11:23:26 pi sftp-server[1269]: sent status Success
Oct 3 11:23:26 pi sftp-server[1269]: lstat name "/media/asdf/aaaa/.-cs-080.LT.jpg"
Oct 3 11:23:26 pi sftp-server[1269]: debug1: request 1420: sent attrib have 0xf
Oct 3 11:23:26 pi sftp-server[1269]: open "/media/asdf/aaaa/.-cs-080.LT.jpg" flags WRITE,TRUNCATE mode 0100700
Oct 3 11:23:26 pi sftp-server[1269]: debug1: request 1421: sent handle handle 0
Oct 3 11:23:26 pi sftp-server[1269]: debug1: request 1422: write "/media/asdf/aaaa/.-cs-080.LT.jpg" (handle 0) off 0 len 30000
Oct 3 11:23:26 pi sftp-server[1269]: sent status Success
Oct 3 11:23:26 pi sftp-server[1269]: debug1: request 1423: write "/media/asdf/aaaa/.-cs-080.LT.jpg" (handle 0) off 30000 len 28349
Oct 3 11:23:26 pi sftp-server[1269]: sent status Success
Oct 3 11:23:26 pi sftp-server[1269]: close "/media/asdf/aaaa/.-cs-080.LT.jpg" bytes read 0 written 58349
Oct 3 11:23:26 pi sftp-server[1269]: sent status Success
Oct 3 11:23:26 pi sftp-server[1269]: debug1: request 1425: setstat name "/media/asdf/aaaa/.-cs-080.LT.jpg"
Oct 3 11:23:26 pi sftp-server[1269]: set "/media/asdf/aaaa/.-cs-080.LT.jpg" mode 100644
Oct 3 11:23:26 pi sftp-server[1269]: set "/media/asdf/aaaa/.-cs-080.LT.jpg" modtime 20190919-16:54:32
Oct 3 11:23:26 pi sftp-server[1269]: sent status Permission denied

Oct 3 11:23:26 pi sftp-server[1269]: lstat name "/media/asdf/aaaa/.-cs-080.LT.jpg"
Oct 3 11:23:26 pi sftp-server[1269]: debug1: request 1426: sent attrib have 0xf
Oct 3 11:23:26 pi sftp-server[1269]: remove name "/media/asdf/aaaa/.-cs-080.LT.jpg"
Oct 3 11:23:26 pi sftp-server[1269]: sent status Success

Could this mean that setting the modified date of the file to match is getting blocked?

Andyroo

Re: accessing a usb drive over the network from osx via ssh

Thu Oct 03, 2019 4:17 pm

It does but I'm not sure why...

Do you have the two supporting packages loaded - “exfat-fuse” and “exfat-utils”

Code: Select all

apt-cache policy exfat-fuse
apt-cache policy exfat-utils
will tell you.

(I assume so as you said one package writes the files ok)

loucapo
Posts: 6
Joined: Tue Sep 17, 2019 4:01 pm

Re: accessing a usb drive over the network from osx via ssh

Thu Oct 03, 2019 6:10 pm

$ apt-cache policy exfat-fuse
exfat-fuse:
Installed: 1.3.0-1
Candidate: 1.3.0-1
Version table:
*** 1.3.0-1 500
500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
100 /var/lib/dpkg/status

$ apt-cache policy exfat-utils
exfat-utils:
Installed: 1.3.0-1
Candidate: 1.3.0-1
Version table:
*** 1.3.0-1 500
500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
100 /var/lib/dpkg/status
[email protected]:~ $

Andyroo

Re: accessing a usb drive over the network from osx via ssh

Thu Oct 03, 2019 6:32 pm

Foo / flip and other such terms...

(Well it was a long shot with one bit working :lol: )

Looking at the guide there are not a lot of options to set.

The file name is a little odd - beginning with a dot infers a hidden file - that may be the issue but you should still be able to execute the update to the file date / time (given the file was written)...

you could try a mod to the fstab to:

Code: Select all

UUID=XX /media/phantom exfat-fuse defaults 0 0
Other than that, if no one else has any ideas, you may need to contact their support at https://www.econtechnologies.com/suppor ... ticket.php and send them the log (and maybe a link to here).

Return to “Networking and servers”