LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   How to Enable Automatic Login on Debian 8 Jessie (for Console)? (https://www.linuxquestions.org/questions/debian-26/how-to-enable-automatic-login-on-debian-8-jessie-for-console-4175550342/)

Xeratul 08-09-2015 11:59 PM

How to Enable Automatic Login on Debian 8 Jessie (for Console)?
 
Hello,

I would like to enable autologin without using inittab (since jessie hasnt) and without gdm.

I found this:

Code:

Autologin to text in Debian Jessie
article #756, updated 168 days ago

First do this:

sudo mkdir -pv /etc/systemd/system/getty@tty1.service.d
sudo nano /etc/systemd/system/getty@tty1.service.d/autologin.conf

This will edit a new file autologin.conf. Here is the text for it:

[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin $username --noclear I 38400 linux

Make sure you replace $username with the username with which you want login to occur.

If, peradventure, you would like X to automatically start up after the above autologin to text, add the following to ~/.profile:

[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx





Are they other methods?


thank you

(more nfo: https://bbs.archlinux.org/viewtopic.php?id=169483)

mzsade 08-10-2015 11:37 AM

http://forums.debian.net/viewtopic.php?f=16&t=123694

Your way is very much like the one above except that you don't have to make any directory, it's already there (Systemd stuff, i guess). It has worked for me both on my Jessie xfce install and Debian with standalone OpenBox install so i feel safe to venture that it should work for you too.

Xeratul 08-10-2015 02:28 PM

Hello

would you know if there is a simpler solution, I have in mind such as

apt-get install flashplugin-nonfree


or apt-get install console-autologin
dpkg-reconfigure console-autologin
give please username: myusername

et voila !

mzsade 08-10-2015 03:36 PM

What could be simpler than copy-pasting 2 lines of code in the designated places and running exactly 1 command after that? Did you even open the link i posted? :)

Edit: Aha! I see now that you are a senior member and were just out to have some fun. I am such an ass for taking the bait. :LOL

Xeratul 08-10-2015 03:39 PM

Quote:

Originally Posted by mzsade (Post 5404003)
What could be simpler than copy-pasting 2 lines of code in the designated places and running exactly 1 command after that? Did you even open the link i posted? :)

quite tiring that we must always find a workaround, while someone could make it available to all of us, right.

Why to do x100-1000 times users things?

mzsade 08-10-2015 03:56 PM

It's the sheer minimalism of the method that i am taken in by, even though i hardly know any bash to speak of, i daresay you couldn't find a more elegant way to do it. All i can hope to do is one day parse the code for myself and understand exactly how it worked.

ntubski 08-10-2015 04:05 PM

Quote:

Originally Posted by Xeratul (Post 5404006)
someone could make it available to all of us, right.

That someone could be you! :)

mzsade 08-11-2015 03:26 PM

2 Attachment(s)
Since the OP has neither marked this as solved nor has pursued it further i see fit to not let this thread go to waste and open a new one, for my question is related to what happens after implementation of auto-login and auto-startX as per the aforementioned method.

I succumbed to temptation and decided to make my openbox window pretty. Followed these instructions in the Debian OpenBox wiki faithfully;
Code:

# apt-get install feh

Now, pick a wallpaper and try this command in a terminal:

feh --bg-scale /path/to/your/background/image.jpg

Note: Apart from JPEG, feh can also handle a variety of other image file types, including PNG, TIFF and GIF.

Once you have chosen a wallpaper, feh stores its name in a file called .fehbg. That means you can tell it to restore the wallpaper on the next boot by checking that file. Add the following to the autostart.sh file in /etc/xdg/openbox.

#My wallpaper
eval `cat $HOME/.fehbg` &

. Because of the auto-login, or because i have rEFind installed on another partition that supersedes the boot loaders of all other partitions, whatever the reason, nothing happened, my session started normally without any wallpaper.

Next i created this .xsession file and made it executable.
Code:

#!/bin/bash

gkrellm &
eval `cat $HOME/.fehbg` &
exec openbox-session

.

Now here's curious part, this is what i get when i boot or reboot my computer, i see the wallpaper for a brief instant, then it disappears and i'm left with what's in the first Screenshot;

It is only after i "Exit" the openbox session from it's menu, sometimes twice, that the session restarts automaticlly and i get to what's in the second one.

mzsade 08-12-2015 03:44 AM

On a hunch i went to my LMDE partition and did a fsck -y on this partition from it. Sure enough, it told me that there was an error on line 4 in my /etc/fstab which was magnanimously ignored (has to be by rEFind, this bootloader is a real blessing for the newbie), a "dirty bit" was removed and the partition was clean..tee-hee, "dirty bit". I booted back into my Debian partition and edited my /etc/fstab. Did a
Code:

ls /etc/xdg/openbox
and now there was an autostart.sh file next to autostart. This time i put this line in /etc/xdg/openbox/autostart
Code:

eval `cat $HOME/.fehbg` && gkrellm &
and saved it to ~/.config/openbox/autosart. Voila, problem solved! :D

The issue mentioned in the title of this thread should now either be considered resolved or followed up and it irks me no end that the OP despite his seniority has left it hanging out to dry and not had the courtesy to do either. :(

Xeratul 08-12-2015 10:32 AM

Quote:

Originally Posted by mzsade (Post 5404003)
What could be simpler than copy-pasting 2 lines of code in the designated places and running exactly 1 command after that? Did you even open the link i posted? :)

Edit: Aha! I see now that you are a senior member and were just out to have some fun. I am such an ass for taking the bait. :LOL

try to understand. What is simple for you might not be simple for everybody, you know...

I like to think about common Linux users.

Xeratul 08-12-2015 11:02 AM

Virtual console

Edit the provided unit either manually by creating the following drop-in snippet, or by running systemctl edit getty@tty1 and pasting its content:

/etc/systemd/system/getty@tty1.service.d/override.conf

[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin username --noclear I 38400 linux

Xeratul 08-12-2015 11:23 AM

Quote:

Originally Posted by ntubski (Post 5404013)
That someone could be you! :)

or You !! :)





it would be seriously nice that there is a package

Code:

apt-get install console-autologin
to setup the whole thing with assistance !!!!!!!!!!

mzsade 08-12-2015 02:24 PM

Quote:

Originally Posted by Xeratul (Post 5404799)
try to understand. What is simple for you might not be simple for everybody, you know...

I like to think about common Linux users.

You do much injustice to "common Linux users" if you attribute to them an IQ level of a trained chimpanzee. Mine is not especially higher than that of one btw, i assure you. ;) Those who switch to Linux from other operating systems do so to understand their systems better and have more control over them if nothing else and not just to avoid spending money.

Timothy Miller 08-12-2015 02:31 PM

Quote:

Originally Posted by mzsade (Post 5404889)
You do much injustice to "common Linux users" if you attribute to them an IQ level of a trained chimpanzee. Mine is not especially higher than that of one btw, i assure you. ;) Those who switch to Linux from other operating systems do so to understand their systems better and have more control over them if nothing else and not just to avoid spending money.

Or just to keep their system running after the original OS is no longer supported, but they don't feel there's any reason to purchase a new OS. That's been a lot of people since XP support went away.

mzsade 08-12-2015 02:54 PM

Quote:

Originally Posted by Timothy Miller (Post 5404892)
Or just to keep their system running after the original OS is no longer supported, but they don't feel there's any reason to purchase a new OS. That's been a lot of people since XP support went away.

There's that lot too..hmmm, do i really care if they want a Windows like system and won't lift a finger to type a basic command?


All times are GMT -5. The time now is 03:43 PM.