tonychang-uk
Posts: 88
Joined: Mon Jun 18, 2012 1:42 pm

RASPBIAN STRETCH auto login as root not working

Tue Sep 12, 2017 11:18 am

in Jessie we can edit /etc/lightdm/lightdm.conf login as root and auto login

but in stretch can't login as this way.

How to auto login as root ?

User avatar
RaTTuS
Posts: 9895
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: RASPBIAN STRETCH auto login as root not working

Tue Sep 12, 2017 11:37 am

you don't want to log in as root under x
it is just the wrong way of everything
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

tonychang-uk
Posts: 88
Joined: Mon Jun 18, 2012 1:42 pm

Re: RASPBIAN STRETCH auto login as root not working

Tue Sep 12, 2017 10:27 pm

RaTTuS wrote:
Tue Sep 12, 2017 11:37 am
you don't want to log in as root under x
it is just the wrong way of everything
I want login as root under x , Jessie can use this way, but Stretch can't use this way.
any other way can login as root under x ? Thanks !

User avatar
RaTTuS
Posts: 9895
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: RASPBIAN STRETCH auto login as root not working

Wed Sep 13, 2017 7:00 am

before I answer this, can you explain to us
why you want to run as root under x
because what you are asking for is so monumentally insecure it is like <REDACTED>
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

tonychang-uk
Posts: 88
Joined: Mon Jun 18, 2012 1:42 pm

Re: RASPBIAN STRETCH auto login as root not working

Wed Sep 13, 2017 9:32 am

RaTTuS wrote:
Wed Sep 13, 2017 7:00 am
before I answer this, can you explain to us
why you want to run as root under x
because what you are asking for is so monumentally insecure it is like <REDACTED>
Because we need load driver for UART HAT, need use root for permission.
Pi user can't use some hardware resource.

tonychang-uk
Posts: 88
Joined: Mon Jun 18, 2012 1:42 pm

Re: RASPBIAN STRETCH auto login as root not working

Fri Sep 15, 2017 11:06 am

Any one know how to setting "RASPBIAN STRETCH auto login as root under x" ???

klricks
Posts: 5476
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: RASPBIAN STRETCH auto login as root not working

Fri Sep 15, 2017 1:04 pm

tonychang-uk wrote:
Fri Sep 15, 2017 11:06 am
Any one know how to setting "RASPBIAN STRETCH auto login as root under x" ???
Have you tried changing to root using su command under x?

First you need to set a root password:

Code: Select all

sudo passwd root
Then

Code: Select all

su
And enter the new root password
Unless specified otherwise my response is based on the latest and fully updated Raspbian Stretch w/ Desktop OS.

tonychang-uk
Posts: 88
Joined: Mon Jun 18, 2012 1:42 pm

Re: RASPBIAN STRETCH auto login as root not working

Sat Sep 16, 2017 12:51 pm

klricks wrote:
Fri Sep 15, 2017 1:04 pm
tonychang-uk wrote:
Fri Sep 15, 2017 11:06 am
Any one know how to setting "RASPBIAN STRETCH auto login as root under x" ???
Have you tried changing to root using su command under x?

First you need to set a root password:

Code: Select all

sudo passwd root
Then

Code: Select all

su
And enter the new root password
need automatic login as root, don't need input any password? got ideal how to setting??? Thanks!

knute
Posts: 330
Joined: Thu Oct 23, 2014 12:14 am

Re: RASPBIAN STRETCH auto login as root not working

Sun Sep 17, 2017 8:45 pm

tonychang-uk wrote:
Wed Sep 13, 2017 9:32 am
RaTTuS wrote:
Wed Sep 13, 2017 7:00 am
before I answer this, can you explain to us
why you want to run as root under x
because what you are asking for is so monumentally insecure it is like <REDACTED>
Because we need load driver for UART HAT, need use root for permission.
Pi user can't use some hardware resource.
So the driver only loads when you use X? You can't use a [DesktopEntry] file executed with sudo? You know that running X as root creates a whole host of possible issues?

Is your default user still pi? If it is then do this:

Click the Raspberry -> Preferences -> Raspberry Pi Configuration
Set Boot: To CLI
Set Auto login: Login as user 'pi'
Click the OK button

Edit pi's /home/pi/.profile file and put this at the end:

if [[ $(tty) == "/dev/tty1" && $ROOTX != "true" ]]; then
ROOTX="true"
export $ROOTX
sudo startx
fi

and reboot your computer.

It is moderately stable with nothing else running but who knows after you start installing drivers and other software.

Disclaimer: There is always a small risk of nuclear detonation if you run X as root.

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: RASPBIAN STRETCH auto login as root not working

Mon Sep 18, 2017 1:24 am

RaTTuS wrote:
Wed Sep 13, 2017 7:00 am
before I answer this, can you explain to us
why you want to run as root under x
because what you are asking for is so monumentally insecure it is like <REDACTED>
This. Don't do it.

User avatar
artisticforge
Posts: 27
Joined: Sat Sep 01, 2012 5:36 am
Location: Earth

Re: RASPBIAN STRETCH auto login as root not working

Wed Sep 20, 2017 12:06 pm

hello

If you are using lightdm, you need to edit /etc/lightdm/lightdm.conf

set
autologin-user=root

save edit

restart lightdm

Side comment: This is a terrible idea. You need to rethink the project for other alternatives
than brute force with root.
artisticforge ><>

knute
Posts: 330
Joined: Thu Oct 23, 2014 12:14 am

Re: RASPBIAN STRETCH auto login as root not working

Thu Sep 21, 2017 6:55 pm

artisticforge wrote:
Wed Sep 20, 2017 12:06 pm
hello

If you are using lightdm, you need to edit /etc/lightdm/lightdm.conf

set
autologin-user=root

save edit

restart lightdm

Side comment: This is a terrible idea. You need to rethink the project for other alternatives
than brute force with root.
That doesn't actually work on Stretch.

tonychang-uk
Posts: 88
Joined: Mon Jun 18, 2012 1:42 pm

Re: RASPBIAN STRETCH auto login as root not working

Thu Oct 12, 2017 1:24 pm

artisticforge wrote:
Wed Sep 20, 2017 12:06 pm
hello

If you are using lightdm, you need to edit /etc/lightdm/lightdm.conf

set
autologin-user=root

save edit

restart lightdm

Side comment: This is a terrible idea. You need to rethink the project for other alternatives
than brute force with root.

/etc/lightdm/lightdm.conf not work for stretch
Attachments
stretch-01.jpg
stretch-01.jpg (87.48 KiB) Viewed 4111 times

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: RASPBIAN STRETCH auto login as root not working

Fri Oct 13, 2017 1:12 am

tonychang-uk wrote:
Thu Oct 12, 2017 1:24 pm
/etc/lightdm/lightdm.conf not work for stretch
That's hopefully a feature as autologin as root is a an exceptionally bad/naive/stupid idea.

User avatar
ab1jx
Posts: 625
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: RASPBIAN STRETCH auto login as root not working

Tue Apr 10, 2018 11:55 pm

Ever hear "If you're not part of the solution, you're part of the problem"? Jeez. That's like telling someone they should never root an Android phone. Take the training wheels off, but you might fall down. You might screw it up so bad you have to reinstall, but you probably won't make the same mistake twice. I've been running as root for 20 years. I remember when you had to use adduser to have an alternative to root. AFAIK OpenBSD is still like that.

I think it's a deeply-ingrained permissions issue. Something somewhere specifically forbids you from doing autologin as root. Or else changing the autologin-user by itself isn't enough anymore. Almost smells like selinux at work, but it probably isn't. Android versions past about 5.0 have selinux enabled by default, it's a royal pain putting Debian on one, but it's the same sort of big brother is watching feeling.

If rooting Android wasn't a challenge there probably wouldn't be https://www.xda-developers.com Similar idea though, you paid your money for this hardware, you should have the right to do what you want with it (as long as it doesn't hurt anybody else).

User avatar
RaTTuS
Posts: 9895
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: RASPBIAN STRETCH auto login as root not working

Wed Apr 11, 2018 7:30 am

running x as root is way worse than running windows as admin IMO
however YMMV
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: RASPBIAN STRETCH auto login as root not working

Thu Apr 12, 2018 12:28 am

ab1jx wrote:
Tue Apr 10, 2018 11:55 pm
Ever hear "If you're not part of the solution, you're part of the problem"? Jeez. That's like telling someone they should never root an Android phone. Take the training wheels off, but you might fall down. You might screw it up so bad you have to reinstall, but you probably won't make the same mistake twice. I've been running as root for 20 years. I remember when you had to use adduser to have an alternative to root. AFAIK OpenBSD is still like that.

I think it's a deeply-ingrained permissions issue. Something somewhere specifically forbids you from doing autologin as root. Or else changing the autologin-user by itself isn't enough anymore. Almost smells like selinux at work, but it probably isn't. Android versions past about 5.0 have selinux enabled by default, it's a royal pain putting Debian on one, but it's the same sort of big brother is watching feeling.

If rooting Android wasn't a challenge there probably wouldn't be https://www.xda-developers.com Similar idea though, you paid your money for this hardware, you should have the right to do what you want with it (as long as it doesn't hurt anybody else).
I've been running as root for 20+ years as well, but I don't need to ask how to do it - if you need to ask you shouldn't be doing it.

User avatar
ab1jx
Posts: 625
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: RASPBIAN STRETCH auto login as root not working

Thu Apr 12, 2018 12:06 pm

Well, I didn't need to ask until Stretch. Hint, look at /etc/pam.d/lightdm-autologin, I won't say more. I wanted autologin as root on my tablet because there's no physical keyboard. I got it eventually.

I'm behind NAT on a dynamic IP so I don't really worry about people getting in. But the touchscreen does introduce a certain clumsiness factor. I don't drag and drop much anyway, it's a foreign concept to me.

User avatar
ab1jx
Posts: 625
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: RASPBIAN STRETCH auto login as root not working

Thu May 10, 2018 6:58 pm

And try dmesg | grep -i pam sometime, I see:

Code: Select all

[   11.206570] systemd[1]: systemd 232 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
Where did all that come from? Pam, apparmor, selinux? Yuck.

OK, cd /boot then
grep -r -i pam .
Binary file ./start.elf matches
Binary file ./kernel.img matches
Binary file ./kernel7.img matches
Binary file ./start_db.elf matches
Binary file ./start_x.elf matches

There was probably less of it in Jessie. I have an old Debian laptop from last summer and it's not in there at all. uname -a on that says
Linux hp 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2 (2017-04-30) x86_64 GNU/Linux
By the /etc/sources.list file it's Jessie.

donbrew
Posts: 33
Joined: Sun Sep 04, 2016 2:32 pm

Re: RASPBIAN STRETCH auto login as root not working

Fri May 11, 2018 8:28 pm

Is it because the root user is disabled by default in Stretch? In order to activate it you have to give it a password.

The security Nazis strike again!

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: RASPBIAN STRETCH auto login as root not working

Fri May 11, 2018 9:15 pm

donbrew wrote:
Fri May 11, 2018 8:28 pm
Is it because the root user is disabled by default in Stretch? In order to activate it you have to give it a password.

The security Nazis strike again!
AFAIA, root has never had a password in any Raspbian version because you should never need to log in as root (there are other ways to get the privs you think you need).

This discussion has been done to death here and other places. It's not a case of security Nazis, or being insultingly called a problem ("If you're not part of the solution, you're part of the problem"), we're actually trying to stop you making all the mistakes we made years ago...(and I've worked many a long night recovering Sun systems that have been trashed by DBAs and developers who insisted they needed root access).

...and when the people wanting such access FUBAR, they tend to shout the loudest "Why didn't you tell me", "There should be things in place to stop this", "Why did rm -f * wipe my system"

donbrew
Posts: 33
Joined: Sun Sep 04, 2016 2:32 pm

Re: RASPBIAN STRETCH auto login as root not working

Sun May 13, 2018 4:19 pm

Well gee, why does the wiki explain how to enable the root user then? And why is it so easy to do?

I currently login as root with WinSCP/Putty so I can edit config files with notepad++ instead of sudo nano in Putty; that makes for a lot less typing of paths.

I totally agree that commercial operations just don't need anyone to have root access. I am a hobbyist.

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: RASPBIAN STRETCH auto login as root not working

Mon May 14, 2018 12:13 am

donbrew wrote:
Sun May 13, 2018 4:19 pm
Well gee, why does the wiki explain how to enable the root user then? And why is it so easy to do?

I currently login as root with WinSCP/Putty so I can edit config files with notepad++ instead of sudo nano in Putty; that makes for a lot less typing of paths.

I totally agree that commercial operations just don't need anyone to have root access. I am a hobbyist.
I think the goal is to have root the default login user, complete with GUI.

No more messing around with sudo.

No more hard things like working out permissions and groups.

No more being told they can't do things - this is my Pi goddammit! - I own it I must have complete control!

Oh course, when it all goes all wrong - it's why would it let me do this? how can I recover it?

We've seen this many times here, and it always ends in tears.

Return to “Raspbian”

Who is online

Users browsing this forum: No registered users and 31 guests