Page 1 of 1

SAMA5D27_SOM1_EK Buildroot: permit root login via ssh

Posted: Thu May 09, 2019 9:50 am
by rdgtk
Hi,
I'm new to Linux. I'm using SAMA5D27 SOM1 EK, and followed the instructions from the Linux4SAM Buildroot page.
I configure and make the system, and I get an img file and burn an SD card with Etcher. Everything goes fine:
-After inserting the SD and power up, the blue LED starts blinking.
-I connect to the console from my Ubuntu host via minicom and the system executes commands.
-I set and start eth0. The board takes an IP address from DHCP server and I can get answers to ping.

Now:
ssh server is up an running and accepts connections, but I can't log in as root nor as any other user: "Permission denied, please try again"
I modified /etc/ssh/sshd_config to "PermitRootLogin yes", I tryed with and without password and no success.
I tryed other sshd_config options after some examples from the net and also from my own Ubuntu host.

I'm connecting to ssh from my Ubuntu host, and also from a Windows host using Teraterm. These clients can log in with no problems to other systems, including this same board with a demo image.

What am I missing? Thank you for any suggestion.

Re: SAMA5D27_SOM1_EK Buildroot: permit root login via ssh

Posted: Fri May 10, 2019 1:26 am
by blue_z
A /etc/ssh/sshd_config with
"PermitRootLogin yes",
"PermitEmptyPasswords yes", and
"ChallengeResponseAuthentication no"
allows me to ssh in as user "root" with no password.

Regards

Re: SAMA5D27_SOM1_EK Buildroot: permit root login via ssh

Posted: Tue May 14, 2019 1:26 pm
by rdgtk
Thank you blue_z.
No success. I'm searching other reasons. I think it has to do with the authorized_keys file.
If I succeed I'll come back with the solution, for I suppose that everybody using Buildroot and following the instructions at Linux4Sam Buildroot will find the same problem.
Of course in the meanwhile any suggestion is welcome.

Re: SAMA5D27_SOM1_EK Buildroot: permit root login via ssh

Posted: Wed May 15, 2019 10:51 am
by rdgtk
Problem solved!
I followed a friend's suggestion:
-List files at /etc/init.d
-If you find both S50dropbear and S50sshd, delete S50dropbear

The point was that two ssh servers were up.

By the way: I tryed keeping S50dropbear and deleting S50sshd instead and could not log in. So the solution is:
Delete /etc/init.d/S50dropbear

To any interested user: remember that I got to this problem when configuring my system specifically with Buildroot.
If you are using something different may be everything is OK concerning ssh and remote log in.

Sometimes friends are better than Google :D

Re: SAMA5D27_SOM1_EK Buildroot: permit root login via ssh

Posted: Thu May 16, 2019 12:50 am
by blue_z
rdgtk wrote: To any interested user: remember that I got to this problem when configuring my system specifically with Buildroot.
The problem is not with Buildroot itself, but rather with which defconfig file you start your build.
For most Atmel/Microchip boards you can choose to build either a minimal root filesystem by specifying the plain <board>_defconfig file, or build almost a desktop environment on a SBC using the <board>_dev_defconfig file.
Of course you can then use `make menuconfig` to modify the package selections.
For whatever reason the SAMA5D27_SOM1_EK does not have a minimalist _defconfig file but only a _dev_defconfig file (and also demo, headless and nodered defconfigs in buildroot-external-microchip).

In buildroot-at91 from the Linux4SAM github, the Atmel <board>_dev_defconfig files specify both the OpenSSH and Dropbear packages, which lead to the problem you had.

Note that you would not encounter this issue if you download a recent Buildroot from buildroot.org.
The mainline versions of Atmel <board>_dev_defconfig files, including atmel_sama5d27_som1_ek_mmc_dev_defconfig, build the OpenSSH package but not Dropbear.
Microchip should be aware of this change, but apparently has not (yet) applied this commit to the Linux4SAM git.

Regards