Enable access to files via WinSCP

HI,
I am aware about the risc of removing all kind of restrictions/permissions from the filestructure, but it is anoying not being able to do quick adjustments via WinSCP.
How can I easy set permissions to all files so everybody is able to adjust/edit files? Maybe via PuTTY. But what to type in?
It is especially about config files like octopi.txt , ...
Thanks

  • Have WinSCP make its remote connection as the pi user and you're home-free
  • Create a local user on the Pi called winscp, issue it a password and at it to the pi group

Honestly, if a file has permissions set to 600 or 644 that's nature's way of saying "you really shouldn't be doing this if you're not the owner". So ~/.octoprint/config.yaml is 644 and ~/.octoprint/users.yaml is 600, for example. ~/.octoprint/watched is basically 644 as well.

If it were me and I were considering using something like this to sync files to the Pi, I would do this with at least the octoprint service turned off. OctoPrint seriously logs to at least ~/.octoprint/logs/octoprint.log and you shouldn't be competing with this.

Why not describe a scenario where you're trying to adjust something? I routinely use scp and rsync to brings things to/from my rig but I know what I'm doing (and I credential as pi).

1 Like

Hi,
Ivam struggling with camera-settings, so I need to play around with settings in octopi.txt.
As it is really uncomfortable to remove SDcard all the time, I want to adjust file via WinSCP and restart Octopi. But WinSCP always blocks writeaccess to this file. I tried to change settings via PuTTY on this file, but I didn’t manage.
What exactly do I need to type in in PuTTY to change at least the permissions of my this file, so everybody can adjust it?

Open WinSCP and change the file protocol to SCP.
Enter your credentials and click on Advanced
grafik

Click on SCP/Shell and change the Shell type in the dropdown menu to sudo su -
grafik

Click on OK and then connect to your pi. You should now be able to edit octopi.txt and other files.

edit: this works with a stock raspbian image - I don't know whether there are changes made in the octopi image which prevent this from working or not.

2 Likes

Settings are not working:
image

I have a sneaking suspicion this wont work, the boot partition is mounted read only, even root can't tweak it unless you do something like:-

mount -o remount, rw /boot

as root first, also, I think the file only gets read a boot time... and a reboot reinstates the partition as read only.

2 Likes

If I were the developer for OctoPi (guy/foosel) then I might temporarily change the location of ~/boot/octopi.txt to somewhere within the pi user's home directory which would allow the workflow that you're attempting.

But then again, there's nothing to say that you couldn't be doing this from a PuTTY session to the Pi and using...

sudo nano ~/boot/octopi.txt
...
sudo reboot

...in order to do your iterative testing. And you won't have to shuttle the microSD.

1 Like

What @OutsourcedGuru describes is how I have always tweaked settings - for camera settings as well as for other things. I log in via Putty as the pi user, or if I'm accessing from a Mac, I just use Apple's Terminal program to log in as the pi user.

As others have noted, you will need to reboot for the new setting to take effect.