• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
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

Root Access denied although sshd_config is edited correctly.

Scheduled Pinned Locked Moved Help and Support
rootpasswordssh
14 Posts 4 Posters 4.1k 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.
  • H
    HAILtoSTARSCREAM
    last edited by HAILtoSTARSCREAM 14 Jul 2018, 10:48

    <SOLVED>

    I have edited and saved sshd_config with "PermitRootLogin yes" like it is advised. I set the password with "sudo passwd root". I tried setting different passwords but whenever I try to login as root and enter the password I get "Access denied".

    It's a new and up to date Retropie 4.4 Image, set it up a few days ago. Managed to get root access running in my previous build without problems.

    Help is appreciated!

    EDIT: Me, being stupid, forgot to remove the # in the PermitRootLogin line. Maybe this info should be added here: https://github.com/RetroPie/RetroPie-Setup/wiki/FAQ#why-cant-i-ssh-as-root-anymore

    1 Reply Last reply Reply Quote 1
    • M
      mitu Global Moderator
      last edited by 14 Jul 2018, 10:52

      The password is incorrect, most likely. Use sudo su to become root, then type passwd to change the password.

      1 Reply Last reply Reply Quote 0
      • S
        Sano
        last edited by Sano 14 Jul 2018, 11:02

        Anyway, enabling root login through ssh is a bad idea from a system/security point of view.
        You should login with pi (or any other user) and then take root privileges only when necessary.

        I know login directly as root is simplier, but it's considered as a newbie mistake by any linux user/sysadmin :)

        Keep in mind that a single space in root can f**k up a system

        ~#mkdir /test
        ~#touch /test/foo
        ~#rm -rf / test
        ~#rm: cannot remove 'test': No such file or directory
        

        DOH !

        H 1 Reply Last reply 14 Jul 2018, 11:19 Reply Quote 0
        • H
          HAILtoSTARSCREAM @Sano
          last edited by 14 Jul 2018, 11:19

          @sano I need to login as root in winscp so I can edit some cfg files.

          @mitu tried that before and just tried it again, always the same "Access denied"

          S 1 Reply Last reply 14 Jul 2018, 11:25 Reply Quote 0
          • S
            Sano @HAILtoSTARSCREAM
            last edited by Sano 14 Jul 2018, 11:25

            @hailtostarscream
            You may just use SCP protocol in WinSCP and configure a sudo -s as shell in winscp.
            See here : https://winscp.net/eng/docs/faq_su
            Edit : Sorry if I seem to give you answers on questions you didn't ask, but basically what you want to do is "wrong", so I try to provide alternatives.

            H 1 Reply Last reply 14 Jul 2018, 11:44 Reply Quote 1
            • H
              HAILtoSTARSCREAM
              last edited by 14 Jul 2018, 11:37

              No it's fine I appreciate it. I also tried that before in winscp. Still get permission denied when i try to save an edited cfg file. This build just won't give me root access and I am going crazy.

              1 Reply Last reply Reply Quote 0
              • H
                HAILtoSTARSCREAM @Sano
                last edited by 14 Jul 2018, 11:44

                @sano Ok I finally realized I had to remove the # in the PermitRootLogin line. I faintly remembered that removing # is a thing but I haven't used my pi in a looong time so I forgot. Also it is not mentioned here: https://github.com/RetroPie/RetroPie-Setup/wiki/FAQ#why-cant-i-ssh-as-root-anymore

                Thank you for trying to help me @Sano @mitu

                M D 2 Replies Last reply 14 Jul 2018, 11:47 Reply Quote 0
                • M
                  mitu Global Moderator @HAILtoSTARSCREAM
                  last edited by mitu 14 Jul 2018, 11:47

                  @hailtostarscream Such modifications require that you know what you're doing. As @sano said, a simple error - as root - might not be so simple.

                  1 Reply Last reply Reply Quote 0
                  • D
                    dudleydes @HAILtoSTARSCREAM
                    last edited by 14 Jul 2018, 11:54

                    @hailtostarscream Which cfg files requiring root access are you trying to edit?

                    There are usually better ways to edit these files in RetroPie. A common file that users like to edit is es_systems.cfg. Best practice here is to create a copy in /opt/retropie/configs/all/emulationstationand edit this file. This will take precedence over the one in /etc/emulationstation.

                    More info: https://retropie.org.uk/docs/EmulationStation/#es_systemscfg-edits

                    1 Reply Last reply Reply Quote 0
                    • H
                      HAILtoSTARSCREAM
                      last edited by HAILtoSTARSCREAM 14 Jul 2018, 12:00

                      Yeah it was that cfg, but I was about to do it the way you suggested. I just realized that I can't edit the file when I was testing something out and that made me try to get root access. I recently started this build from scratch with a pi3b+ and I remember in my previous build that I had several occasions where I needed Winscp root access. I just don't remember them exactly^^

                      One thing was because I use usbmount my video splashscreen sometimes would not trigger on startup, so I had to put my custom video splashscreen into the default folder or something like that. I think that required root access, but could be wrong.

                      D 1 Reply Last reply 14 Jul 2018, 12:07 Reply Quote 0
                      • D
                        dudleydes @HAILtoSTARSCREAM
                        last edited by 14 Jul 2018, 12:07

                        @hailtostarscream You should be able to access that file using WinSCP. The es_systems.cfg in /opt/retropie/configs/all/emulationstation is symlinked to the one in /home/pi/.emulationstation so that changes in one file will be reflected in the other.

                        Please note that .emulationstation is a hidden folder so you would need to adjust the options in WinSCP to show hidden files.

                        H 1 Reply Last reply 14 Jul 2018, 12:21 Reply Quote 0
                        • H
                          HAILtoSTARSCREAM @dudleydes
                          last edited by 14 Jul 2018, 12:21

                          @dudleydes Yes I already managed to get that going, thank you.

                          Another example where I needed root access was to edit the layout and other settings in the snes mini theme.

                          D 1 Reply Last reply 14 Jul 2018, 12:29 Reply Quote 0
                          • M
                            mitu Global Moderator
                            last edited by 14 Jul 2018, 12:23

                            Both these settings can be done by copying the appropriate files into the /home/pi/.emulationstation directory, you don't need root access for that.

                            1 Reply Last reply Reply Quote 0
                            • D
                              dudleydes @HAILtoSTARSCREAM
                              last edited by 14 Jul 2018, 12:29

                              @hailtostarscream If you wish to create a custom version of a theme, then you can create a copy of the theme folder from /etc/emulationstation/themes/ into /opt/retropie/configs/all/emulationstation/themes/. The themes folder may need to be created.

                              Alternatively, you can download the theme from the relevant Github repo and place it in /opt/retropie/configs/all/emulationstation/themes/. For example, the snes mini theme can be found at https://github.com/ruckage/es-theme-snes-mini.

                              1 Reply Last reply Reply Quote 0
                              14 out of 14
                              • First post
                                14/14
                                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.

                                This community forum collects and processes your personal information.
                                consent.not_received