Download Piwigo "upload" folder via SSH

My YunoHost server

Hardware: VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / …
YunoHost version: 4.3.3
I have access to my server : Through SSH | through the webadmin | direct access via keyboard / screen | …
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

Hello, this is an SSH question rather than Piwigo.

Recently there have been a number of updates to yunohost and an update to Piwigo. For some reason, Piwigo stopped working, no idea why, I just couldn’t get access to the site. No matter. I have taken the decision to just do a reinstall of Piwigo.

I have recovered the DB using “myPHPadmin” I tried using FTPS to download the piwigo upload folder which is where all the pictures are stored. Of course, even logged in as admin I can’t do that using an FTPS client like FileZilla etc.

So I’m trying to log in and download the folder to my local machine using OSX Terminal and SSH but still can’t get permission to download the upload folder in the Piwigo directory. Aggggh!

Here is what I did:

Opened Terminal in osx

Typed: ssh admin@thedomian_name.com -pxxxx
(yes I am using a different port number for SSH)
Access allowed. I’m in…

Then I did su
Entered the password and I’m now in as root.

Then: cd /var/www/piwigo

All good. Confirmed that the upload folder was there and I can see the contents of the folders and all the photos. Good.

Then: sudo scp -p xxxx admin@thedomain_name.com:/var/www/piwigo/upload /new/local/location
The password is asked for again, entered it, a short wait. Then.

scp: /var/www/piwigo/upload: Permission denied

What am I doing wrong? I just want to grab the upload folder from Piwigo. I can’t do the reinstall until I’ve grabbed this folder.

Can anyone help me, please?

many thanks

Dj

I guess you can try to sudo setfacl -m u:admin:r-x /var/www/piwigo (maybe add -R before -m to make this recursive)

@Aleks thanks for your reply. I ran that before the scp cmd. There was a wait so I guess it was going through the directories. I then ran the scp cmd as in my previous mail but no change. Access Denied…

dj

@Aleks Ok the command you sent works in that I can now see and open all the directories. Thanks for that, but it appears to me, looking at FTP clients that the Piwigo upload folder is a symbolic link which using readlink is in /home/yunohost.app/piwigo/upload

FINALLY… Thanks for your help. I modified you setfact cmd to the linked location, so I applied:

sudo setfacl -R -m u:admin:r-x /home/yunohost.app/piwigo

I am now downloading the upload folder from piwigo…

Many thanks for your help. I have spent days trying to get to this. xxxxxxx

You learn something new every day!

Dj

1 Like

I’m thinking out loud and slightly off topic sorry, but wouldn’t that be nice to have by default? Giving access to admin to everything but use the ACL to make sure the proper users and groups remain owners of the directories?

Yeah … And then you start wondering how to implement this … and suddenly hundreds of questions …

1 Like

Typical. :stuck_out_tongue:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.