Cannot log in with ROOT

This forum is for topics dealing with problems with software specifically in the ARMv6h repo.

Cannot log in with ROOT

Postby bhaules » Wed Aug 15, 2018 1:25 pm

Hi everyone,
Just installed Arch Linux on a Raspberry Pi Zero. Configured it so it connects to the wifi automatically.
Now when I try to log in with alarm I get:
$this->bbcode_second_pass_code('', 'ssh alarm@192.168.0.10
alarm@192.168.0.10's password:
Welcome to Arch Linux ARM

Website: http://archlinuxarm.org
Forum: http://archlinuxarm.org/forum
IRC: #archlinux-arm on irc.Freenode.net
Last login: Wed Aug 15 12:24:31 2018 from 192.168.0.100
Could not chdir to home directory /home/alarm: Permission denied
-bash: /home/alarm/.bash_profile: Permission denied
[alarm@alarmpi /]$ pwd
/
[alarm@alarmpi /]$
')

I thought this was a permission issue somehow so I then tried to log in with root/root (as this is a new install)
$this->bbcode_second_pass_code('', '[alarm@alarmpi /]$ su -
Password:
su: Authentication failure
')
I also tried su root, su, and it still didn't work

I tried some other things just to poke around like:
$this->bbcode_second_pass_code('', '[alarm@alarmpi /]$ id root
uid=0(root) gid=0(root) groups=0(root)
[alarm@alarmpi /]$ id
uid=1000(alarm) gid=1000(alarm) groups=1000(alarm),998(wheel)
')
and
$this->bbcode_second_pass_code('', '[alarm@alarmpi home]$ ls -la
total 12
drwxr-xr-x 3 root root 4096 Aug 15 10:54 .
drwxr-xr-x 17 root root 4096 Jul 5 19:46 ..
drwx------ 2 root root 4096 Aug 15 10:54 alarm
')

Any ideas what I am doing wrong?
bhaules
 
Posts: 6
Joined: Wed Aug 15, 2018 1:12 pm

Re: Cannot log in with ROOT

Postby summers » Wed Aug 15, 2018 2:06 pm

$this->bbcode_second_pass_code('', 'sudo bash')?

E.g. sudo=/=su ....

and probably /home/alarm should be owned and in the group alarm ...
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Cannot log in with ROOT

Postby bhaules » Wed Aug 15, 2018 8:10 pm

I’m sorry, I don’t quite understand. I’m fairly new to this.
Sudo does not work as I cannot install it using the alarm account.

This is a fresh install, so don’t know why it’s not owned by the group alarm.
bhaules
 
Posts: 6
Joined: Wed Aug 15, 2018 1:12 pm

Re: Cannot log in with ROOT

Postby summers » Thu Aug 16, 2018 6:48 am

Oh apols - I that that "sudo" was in the initial install - must just be one of the commands I install first on fresh installs ...

So what we know is wrong is you can't "su" to root, and the owner:group of "/home/alarm" is wrong. Its possible that the second would cause the first (e.g. linux sees you as a logged in process without a home directory - and that looks like a hack ...).

So it gives two questions:
1) How did your install end up like this? Was it a problem with the image installed, or did you unpack it incorrectly?
2) How do you cure the problem

On 2) first of all, I see two methods.
a) Pop the root file system, mount on another computer, and change the owner:group of /home/alarm to 1000:1000
b) if you can access u-boot on power up (does RPiZero use uboot?) - then add to the bootargs "single". That should when booting drop you into a root shell in single user mode.

I've never done b) on an arm arch system btw, but it should work - you may need to mount the correct root fs, as it may drop you into the initfs ...

On 1) how did you install? We need to check if your image you used was incorrect ...

EDIT: just checked http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-latest.tar.gz /home/alarm has user:group set to leming:leming - this seems the same as the other images. Not clear to me how leming gets mapped to 1000:1000; but its certainly different from other files which are root:root. So questions how you unpacked the image? did you use bsdtar?
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Cannot log in with ROOT

Postby TheSaint » Thu Aug 16, 2018 2:04 pm

I also faced these issues, at first installation. No sudo in the base group package.
So I then removed the SD card, opened in my laptop environment and cancel the passwords in /etc/shadows. Then I installed sudo and renew the passwords.

The normal Archlinux 64 installation doesn't pose a password during installation, if I recall correctly.
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am

Re: Cannot log in with ROOT

Postby bhaules » Thu Aug 16, 2018 2:47 pm

$this->bbcode_second_pass_quote('', 'S')o questions how you unpacked the image? did you use bsdtar?

I did use bsdtar as per the instructions found here: https://archlinuxarm.org/platforms/armv6/raspberry-pi.
I had to fiddle with the install of bsdtar on my Raspbian but eventually I got there and everything worked in regards to unpacking.

$this->bbcode_second_pass_quote('', 'b')) if you can access u-boot on power up (does RPiZero use uboot?) - then add to the bootargs "single". That should when booting drop you into a root shell in single user mode.

I've never done b) on an arm arch system btw, but it should work - you may need to mount the correct root fs, as it may drop you into the initfs ...

Apologies for my noobiness but the above quote doesn't make much sense to me.

$this->bbcode_second_pass_quote('', 'I') also faced these issues, at first installation. No sudo in the base group package.
So I then removed the SD card, opened in my laptop environment and cancel the passwords in /etc/shadows. Then I installed sudo and renew the passwords.

The normal Archlinux 64 installation doesn't pose a password during installation, if I recall correctly.


Do you mind giving me a few more instructions on how to cancel the passwords in /etc/shadows, and how can I install sudo and renew passwords?

Appreciate your help, guys.
bhaules
 
Posts: 6
Joined: Wed Aug 15, 2018 1:12 pm
Top

Re: Cannot log in with ROOT

Postby summers » Thu Aug 16, 2018 3:09 pm

Looking at your /boot - looks like Rpi doesn't do uboot - so that is no help.

To remove the root and alarm password, edit the file "/etc/shadow" on another system.

You see the lines:

$this->bbcode_second_pass_code('', 'root:much text here:17744::::::
alarm:much test here:17744:0:99999:7:::')

The much text is the encrypted password. To remove you just remove all of the "much text here" so you get

$this->bbcode_second_pass_code('', 'root::17744::::::
alarm::17744:0:99999:7:::')

and whilst there do a

$this->bbcode_second_pass_code('', 'chown 1000:1000 /home/alarm')
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Cannot log in with ROOT

Postby TheSaint » Thu Aug 16, 2018 3:54 pm

$this->bbcode_second_pass_quote('bhaules', 'a')nd how can I install sudo and renew passwords?

At the time you'll restart your system, once cleared the password, you'll login straight away without any password.
At the first you should do for the root$this->bbcode_second_pass_code('', '# passwod')
Then you might install$this->bbcode_second_pass_code('', '# pacman -S sudo')
Later you should log to the user$this->bbcode_second_pass_code('', '# su alarm
$ passwd')
Last, you may add the user alarm to the wheel group, so you will have the administration's power every time you use sudo$this->bbcode_second_pass_code('', '# gpasswd -a alarm wheel')
You may also change the default user name $this->bbcode_second_pass_code('', '$ sudo usermod -l alarm <new_user_name>')
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am
Top

Re: Cannot log in with ROOT

Postby bhaules » Thu Aug 16, 2018 11:33 pm

I don't know what, but there is something definitely wrong with my system.
> went into etc/shadow and removed the root password on another machine
> restarted the Pi0 and tried to log in using alarm/alarm - that worked fine this time because I also changed the permissions as directed.
> tried su - and I still get:
$this->bbcode_second_pass_code('', 'alarm@192.168.0.10's password:
Welcome to Arch Linux ARM

Website: http://archlinuxarm.org
Forum: http://archlinuxarm.org/forum
IRC: #archlinux-arm on irc.Freenode.net
Last login: Thu Aug 16 23:23:01 2018 from 192.168.0.100
[alarm@alarmpi ~]$ su -
Password:
su: Authentication failure
')
>went back to my other computer and added the "alarm" encrypted password to the root password in /etc/shadow
>same thing happens when I do a su - to log in as root.

Other than reinstalling everything from scratch, do you guys have any other suggestions?
bhaules
 
Posts: 6
Joined: Wed Aug 15, 2018 1:12 pm

Re: Cannot log in with ROOT

Postby TheSaint » Fri Aug 17, 2018 7:19 am

I hardly believe you can copy /etc/shadow and /etc/password to a different machine. Much more harder if you try to work across SSH, while the machine is running.
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am

Next

Return to ARMv6h

Who is online

Users browsing this forum: No registered users and 5 guests