WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Root login issues  (Read 3599 times)

Offline xenodius

  • Newbie
  • *
  • Posts: 43
Root login issues
« on: October 04, 2020, 12:12:27 PM »
Hello, I am trying to setup Picore-11.0beta2 to run a Python app on startup to interface with a 56 kilowatt motor controller. This OS seems amazing for the Rpi especially, and perfect for my needs. Incredible work!

After troubleshooting I got wifi autoconnect configured and python-3.8 to correctly install modules via pip3. I tried to copy some files to the Rpi using WinSCP as user 'tc' but get an error3: no root permissions. So I logged in as tc, used 'sudo passwd' to set a root password, but could not login as root user (I got 'incorrect password'). So I edited sshd_config, to uncomment/edit the '#PermitRootLogin' line to 'PermitRootLogin yes'... backed it up, rebooted, and now it recognizes the root user password I set.

However, every time I set a password I get these warnings, even for >12 char passwords with letters, numbers, and special characters:
Code: [Select]
Bad password: too weak
Bad password: too short.

And when I try to login as root, it says my password expired, and I must login again-- because of this I can never actually login, even with very long and complex passwords... I always get the bad password warning and have to reset and retry on login:
Code: [Select]
WARNING: Your password has expired.
You must change your password now and login again!
Changing password for root
New password:

Any advice? I'm a Linux novice and only made it this far by scouring this forum.  :-[
« Last Edit: October 04, 2020, 12:18:46 PM by xenodius »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14790
Re: Root login issues
« Reply #1 on: October 04, 2020, 12:35:46 PM »
Where are you trying to copy the files to with winscp? Is it a location with permissions for user tc?

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: Root login issues
« Reply #2 on: October 04, 2020, 03:30:43 PM »
To setup root access in winSCP

Code: [Select]
Click [New Session] tab
Select Site
Click [Edit]
Click [Advanced Site Settings]
Select Environment > SCP/Shell
Edit Shell: sudo -s
Click [OK]
Click [Save]
Click [Login]

There is no root password. You log in as tc and:
use sudo before each command, or
$ sudo -s to get a shell as root

Offline xenodius

  • Newbie
  • *
  • Posts: 43
Re: Root login issues
« Reply #3 on: October 06, 2020, 02:05:29 PM »
I see. I thought, as there was a 'root user', I needed that user instead of tc.

Where are you trying to copy the files to with winscp? Is it a location with permissions for user tc?
I tried many locations of I believe the primary partition, including /home/, /home/lib/, /home/usr/lib/, here are my permissions from "ls / -l":
Code: [Select]

drwxr-xr-x    2 root     root          1380 Jan  1 00:00 bin/
drwxrwxr-x   13 root     root          5740 Jan  1 00:00 dev/
drwxr-xr-x    8 root     root           680 Jan  1 00:02 etc/
drwxrwxr-x    3 root     staff           60 Jan  1 00:00 home/
-rwxr-xr-x    1 root     root           496 May 30  2020 init
drwxr-xr-x    5 root     root           700 Jan  1 00:00 lib/
lrwxrwxrwx    1 root     root            11 Jan  1 00:00 linuxrc -> bin/busybox
drwxr-xr-x    4 root     root            80 Jan  1 00:00 mnt/
drwxrwsr-x    3 root     staff          200 Jan  1 00:00 opt/
dr-xr-xr-x  159 root     root             0 Jan  1 00:00 proc/
drwxrwxr-x    2 root     root            80 Jan  1 00:00 root/
drwxrwxr-x    4 root     root            80 Jan  1 00:00 run/
drwxr-xr-x    2 root     root           960 Jan  1 00:00 sbin/
dr-xr-xr-x   12 root     root             0 Jan  1 00:00 sys/
drwxrwxrwt    4 root     root           160 Jan  1 00:02 tmp/
drwxr-xr-x    7 root     root           140 Jan  1 00:00 usr/
drwxrwxr-x    9 root     root           200 Jan  1 00:00 var/

Greg, I didn't realize. I have edited my winSCP accordingly but still get an error 3: permissions denied.

If I remove the SD I can transfer files to the other partition... Probably I could workaround and transfer them to the home partition this way. But I'll be doing this a lot and would rather learn the right way. Thank you both for your fast responses!

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14790
Re: Root login issues
« Reply #4 on: October 06, 2020, 03:25:23 PM »
Have you tried to copy files to /home/tc?

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: Root login issues
« Reply #5 on: October 06, 2020, 03:55:24 PM »
OK. I am not testing on Picore-11.0beta2. I must have been lucky the last 6 or 7 years. ;D

Offline xenodius

  • Newbie
  • *
  • Posts: 43
Re: Root login issues
« Reply #6 on: October 07, 2020, 12:16:22 AM »
Have you tried to copy files to /home/tc?

I had not but will you look at that  :-X

It worked! I guess the problem was as simple as permissions (and my misunderstanding of tc user sudo vs. 'root' user).

Thank you both!!