WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: piCore 14.x sftp not working after update from 13.x?  (Read 2395 times)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: piCore 14.x sftp not working after update from 13.x?
« Reply #15 on: April 02, 2024, 08:47:28 PM »
Hi Cheembus
It doesn't appear to be flagging /mnt/www or /dump.
It looks like the culprit might be "/" (the root itself".

I found something interesting:
On my TC10 x86 machine, "/" is owned by root:root
On my TC14 x86_64 machine, "/" is owned by tc:staff
I booted up TC13 x86_64, and "/" is owned by root:root

Install  coreutils.tcz  and use  stat  to check  "/"  like this example:
Code: [Select]
tc@E310:~$ stat /
  File: /
  Size: 380             Blocks: 0          IO Block: 4096   directory
Device: 2h/2d   Inode: 2           Links: 17
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2024-04-02 17:20:45.649458451 +0000
Modify: 2019-06-09 12:30:02.000000000 +0000
Change: 2024-02-11 22:00:36.450000002 +0000
 Birth: -
It shows permissions set at 755 and owner set as root:root

If your permissions and/or owners are wrong:
Code: [Select]
sudo chown root:root /
sudo chmod 755 /
Then try connecting again.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: piCore 14.x sftp not working after update from 13.x?
« Reply #16 on: April 02, 2024, 09:04:07 PM »
Hi Cheembus
Turns out you don't need  coreutils.tcz.
You can use the  ls  command:
Code: [Select]
tc@E310:~$ ls -ld /
drwxr-xr-x 17 root root 380 Jun  9  2019 //
« Last Edit: April 02, 2024, 09:58:10 PM by Rich »

Offline Cheembus

  • Newbie
  • *
  • Posts: 13
  • I do not think, therefore I do not am
Re: piCore 14.x sftp not working after update from 13.x?
« Reply #17 on: April 03, 2024, 10:45:32 AM »
oooooooohhhhh myyyyy goodness


Code: [Select]
tc@box:~$ ls -ld /
drwxrwxr-x 17 root root 380 Jan  1  1970 //

Changing the perms to 755 to / allowed me to connect to /mnt/www like I intended!
Now the next question is, why exactly the root path is 775 instead of 755 unlike the other OS versions, is there a way to permanently set the perms to 755, and if not, is there any harm in setting the perms to 755 in my bootsync.sh?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: piCore 14.x sftp not working after update from 13.x?
« Reply #18 on: April 03, 2024, 10:53:31 AM »
Hi Cheembus
... Now the next question is, why exactly the root path is 775 instead of 755 ...
It was probably 755 in piCore 13.x and inadvertently changed to 775 in 14.x.

Quote
... is there a way to permanently set the perms to 755, and if not, is there any harm in setting the perms to 755 in my bootsync.sh?
To permanently change it you would need to unpack/modify/repack the
image file. I recommend adding the change to bootsync.sh.

Offline Cheembus

  • Newbie
  • *
  • Posts: 13
  • I do not think, therefore I do not am
Re: piCore 14.x sftp not working after update from 13.x?
« Reply #19 on: April 03, 2024, 11:04:02 AM »
neato.

It looks like we found the cause and solution to my problem.

Thanks for all the help, everyone.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1240
Re: piCore 14.x sftp not working after update from 13.x?
« Reply #20 on: April 03, 2024, 11:14:21 AM »
Just checked a 13.x system and its 775 too, so likely openssh is just more stringent.  The initramfs is created by the rasperrypi firmware, I don't think the initrd file can change that.

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 708
Re: piCore 14.x sftp not working after update from 13.x?
« Reply #21 on: April 03, 2024, 11:38:49 AM »
That problem was deep as it can, to root(/). :)
Thanks for finding that.