Auto login and password requirement on ubuntu

godmode

Distinguished
Aug 27, 2008
69
0
18,630
hi, i just installed unbuntu on to my laptop along side with windows. so far, i like it but there are a few things i would like to change and get some info on.

one is to auto login, since i'm the only user on the machine and could care less about password protecting that user, having a login screen can become a pain. i already did some googling and found out how to do it here: http://blog.grprakash.com/2006/11/08/auto-login-in-ubuntu/ (didn't test this yet).

but after figuring out the auto login thing, i got the idea that maybe it might be possible to auto login as the root user (i assume that is the safe mode user equivalant to windows). that way, i might no longer need to enter an admin password to do admin task all the time, which is another annoying thing i would like to get rid of.

so is my above idea the right way to getting rid of the password requirement? or i'm i totally wrong? :na:
 

bmouring

Distinguished
May 6, 2006
1,215
0
19,360
godmode, that's a fitting username for such a heavy-handed (and dangerous) approach to that annoyance. It's very easy to have an "oh crap, I didn't mean to do that" moment, and when superuser or root it's just that much more destructive when you do. I would suggest if entering passwords really bother you that much, setting up auto-login for your normal user account and disabling passwords for sudo (howto). You will still somewhat be prompted to rethink your action by having to type "sudo" but won't be asked for a password. I still don't recommend this as it makes it easier to damage your system by errant modification and makes your system more vulnerable by giving anyone with physical access to your machine instant and full access to your system as well as any user exploit instant priviledge escalation capabilities, but I also understand usability concerns. Just don't say you haven't been warned :)
 

godmode

Distinguished
Aug 27, 2008
69
0
18,630


lmao, i live for the danger :kaola:. thanks for the warning but i really couldn't care less about what happens to my laptop lol. i'm a long time windows user and just now started playing around with ubuntu. obviously, i still have a lot to learn.

thanks guys! :D
 

linux_0

Splendid
:lol:

If you like living dangerously, since Linux is open source you have the power to change the system so you don't have to type any passwords ;)

Try unlocking the root account or google it
 

godmode

Distinguished
Aug 27, 2008
69
0
18,630
ok i tried to edit the sudoers file using the visudo cmd. i uncommented the "%sudo all=nopasswd all" line as discribed on the howto page but when i press "F3" nothing happens. for some reason, i can't seem to save the changes.

i tried all the F buttons and even Ctrl+S lol.....nothing.

i unlocked the root acount then tried to setup auto login but it came up with a "forbidden" error so i think i'll leave the root user alone. i just don't what to have to type passwords every where i go. i do more than enough of that at work :p.
 

bmouring

Distinguished
May 6, 2006
1,215
0
19,360
visudo may open one of many editors, can you tell us which one it's using? Try running (from a terminal)
Code:
echo $EDITOR
If that fails (i.e. blank), describe what the editor looks like.

Likely one of the following:
Nano/Pico: screenshot
VI/VIM: screenshot
Emacs: screenshot

Less likely:
Joe: screenshot
Ed: screenshot

Let us know!

(detailed description of what's happening: visudo isn't an editor itself, it just invokes your system editor or a default if one's not set, opens your 'sudoers' file, allows you to edit it, but saves it to a temporary location while it can check the syntax of the sudoers file to make sure you didn't make a syntax mistake, and upon a successful check, overwrites the old file with the updated temporary file.)
 

godmode

Distinguished
Aug 27, 2008
69
0
18,630
yea....the echo $editor cmd show nothing.

it looks like Joe. here's a screen shot:



it opens the suders file as suders.tmp and doesn't allow me save the changes.
 

Zorak

Distinguished
Mar 20, 2006
505
0
18,990
if it won't allow you to save the changes, it sounds like you are opening the file as non-root, which would open the file as read-only. My advice to you is login as root by doing 'sudo su' and then your password and then open the sudoers file in gedit/emacs/vim/nano/ whatever you use to change it. The sudoers file on my system is in /etc/sudoers, so i'd bet yours is in the same place.

Good luck

-Zorak

ps. it is: echo $EDITOR, the capitalization does matter, and if that command still returns nothing then that just means your system doesn't have a default editor set up.
 

godmode

Distinguished
Aug 27, 2008
69
0
18,630
i still couldn't save the changes even logged on as root. i then tried to edit the file directly using gedit and was able to save the changes; however, i got some kind of checksum error when i tried to re-open the sudoers file using visudo so i restored the original.

$EDITOR still show nothing even with all caps.
 

bmouring

Distinguished
May 6, 2006
1,215
0
19,360
Firstly, after checking the manpage for visudo (command: "man visudo" without the quotes), it appears it checks $VISUAL first then falls back on $EDITOR, so check this environment variable as well.

That appears to be vi(m). You can either use that (saving modifications is (esc) then :)wq), enter what's in parenthesis) or change one of the above environment variables to specify an editor (for example, using the command: "export VISUAL=nano" without the quotes will open the sudoers file in nano, which uses (ctrl+'o') to save).

You really should try to edit the sudoers file with visudo to make sure the configuration is sane, otherwise you could conceivably lock yourself out of the root account if you've not set the root password (you could always recover via a single-user login, but that's another post)