RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    WinSCP Permissions tip

    Scheduled Pinned Locked Moved Help and Support
    8 Posts 3 Posters 9.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • rbakerR
      rbaker
      last edited by

      If you are having trouble with your permissions when editing your config files like I was then there is a quick way to make WinSCP give you root access. I read this but still had issues due to my lack of expertise. I found that if you choose "Advanced" before logging in with WinSCP (you'll probably need to press "Edit" first) and then click "Shell". You can then add this:

       sudo su -
      

      then hit OK. After that, you will have root access forever. Works great.

      1 Reply Last reply Reply Quote 2
      • RiverstormR
        Riverstorm
        last edited by

        Is this ok to use or will it change permissions to root on the files that need pi permissions?

        rbakerR 1 Reply Last reply Reply Quote 0
        • B
          ben_thatmustbeme
          last edited by

          This will make it so any file you create will be owned by root instead of by pi. Which is likely not what you want.

          A better solution would be to get something like PuTTY to connect to the pi (same connection info as WinSCP)

          and just run
          sudo chown pi:pi /home/pi/somethingorother
          literally change ownership of a file to user:pi group:pi

          Or, if its an etc file
          sudo chmod o+w /etc/emulationstation/whateverconfigfile
          literally set it so anyone can write to the file.
          This would be a big security concern in a normal linux system, but for a retropie i wouldn't be too worried.

          1 Reply Last reply Reply Quote 0
          • B
            ben_thatmustbeme
            last edited by

            other option is to just make sure to turn that sudo su - off after you edit that one file you need

            1 Reply Last reply Reply Quote 0
            • RiverstormR
              Riverstorm
              last edited by

              Thanks for the reply. Let me try to explain it better what I am trying to ask. If I edit a file that is "owned" by Pi and use that setting in WinSCP will it change ownership to root or leave the owner as Pi?

              I know Buzz had made a comment in another thread that said certain files need to maintain Pi ownership for things to work properly in RetroPie and I was wondering if I edit a file with that option set would it change it to root, something else or leave it as the original owner.

              B 1 Reply Last reply Reply Quote 0
              • rbakerR
                rbaker @Riverstorm
                last edited by

                @Riverstorm All I can say is that I had some issues editing files like the Pi boot-up config and other essential files. I found that doing it in the command line was too fiddly. I found that solution on the web somewhere and now when I log in with winSCP, it starts with that parameter. I have edited config files about 50 times in the last 10 days across various folders and emulators in RetroPie and it continues to work perfectly. No more access denied errors. Here was the source, the first bit as I recall:

                https://blog.jamesbayley.com/2014/01/28/how-to-connect-as-root-using-winscp/

                1 Reply Last reply Reply Quote 0
                • B
                  ben_thatmustbeme @Riverstorm
                  last edited by

                  @Riverstorm I believe it would recreate the file owned by root. I'd have to test to make sure, but I pretty sure it would.

                  1 Reply Last reply Reply Quote 0
                  • RiverstormR
                    Riverstorm
                    last edited by

                    I did a quick test and it seems you can not edit root owned files with that setting. I left "Return code variable" set to the default Autodetect. The file I was testing with:

                    /boot/config.txt
                    
                    1 Reply Last reply Reply Quote 1
                    • First post
                      Last post

                    Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                    Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.