Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
################################################################################
# Generate an MD5 hash for a string.
# Created to allow me to set a blank Linux password. Required this to create
# multiple VsFTP accounts with anonymous style credientials.
#
# If all you want is the MD5 Hash for NULL (blank password) here's one...
# $1$VNMbpxGH$sew7cnwH9ixU.x27UbFNn.
#
# Advice: If replacing a Linux password with a blank string, ensure you give
# the user a shell of /sbin/nologin as you wouldn't want them to login!
################################################################################
# Load dependancies...
# perl -MCPAN -e 'install Crypt::PasswdMD5'
################################################################################
Replacing the second field in your /etc/shadow with the above bold part lets you login with an empty/blanck/NULL password (DO MAKE A BACKUP FIRST!)
Tried it and it works (doesn't feel good though.....)
Replacing <your user> with your username,
compile as: gcc -o autologin autologin.c, copy it in /usr/sbin
The program agetty has the following options :
man agetty
Code:
-l login_program
Invoke the specified login_program instead of /bin/login. This
allows the use of a non-standard login program (for example, one
that asks for a dial-up password or that uses a different pass-
word file).
-n Do not prompt the user for a login name. This can be used in
connection with -l option to invoke a non-standard login process
such as a BBS system. Note that with the -n option, agetty gets
no input from user who logs in and therefore won't be able to
figure out parity, character size, and newline processing of the
connection. It defaults to space parity, 7 bit characters, and
ASCII CR (13) end-of-line character. Beware that the program
that agetty starts (usually /bin/login) is run as root.
So in /etc/inittab, replace the line for the first tty:
Although you said it dosn't feel good is this not how Ubuntu suse etc let you set it up. If a user has no password will that affect if he wanted to have root privilages (sudo). I was also looking at no login as root but using the sudo option, I know it gives it a "commercial feel". I am only looking at the options at the moment
Although you said it dosn't feel good is this not how Ubuntu suse etc let you set it up. If a user has no password will that affect if he wanted to have root privilages (sudo).
I never tried a password-less user myself (feels to weird...) and cannot tell you if the method I posted has any side-effects.
I assume that if you set up sudo so that no password is needed it will work, not sure about an empty password (you can always try ).
Quote:
I was also looking at no login as root but using the sudo option, I know it gives it a "commercial feel". I am only looking at the options at the moment
Sudo can be configured in many different ways and is a good alternative. I personally don't use sudo at home, but I am enforcing it at work; Too many developers and tester think they need full blown root access while they don't need it. What they need is access to a few commands that need root access and sudo is perfect for things like that.
I did the autologin config like above in the computer of my old dad
Security wise, it requires physical access to use his computer without password, and at limited user privileges, it is good enough to me
I did like the idea of the auto login. I presume that I can still give the user a password and auto login so as to setup sudo
In my config, yes. It just auto logins in the first tty right after the boot. I set default runlevel to 3 in inittab, so I put a startx in the .bash_profile of the user to boot directly in X
.bash_profile
Code:
if [[ -z $DISPLAY && $(tty) = /dev/tty1 ]]; then
startx
fi
If it doesn't work, check tty with tty command output
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.