|
Home > Archive > Unix administration > December 2005 > How to set up to allow local root login in Linux ?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How to set up to allow local root login in Linux ?
|
|
|
|
| Adam Price 2005-12-15, 6:05 pm |
| On 15 Dec 2005 09:56:29 -0800, yezi wrote:
> rt.
>
> Thanks
On most versions of Linux it is allowed by default. Which Distro are you
running.
Adam
| |
|
| I am sorry, the question is just allow the local root login.
| |
| Dave Hinz 2005-12-15, 6:05 pm |
| On 15 Dec 2005 10:22:30 -0800, yezi <ye_line@hotmail.com> wrote:
> I am sorry, the question is just allow the local root login.
First, you need to quote what and who you're responding to, or your
message makes no sense.
Second, what specifically do you need the root account for?
| |
| phil-news-nospam@ipal.net 2005-12-15, 6:05 pm |
| On 15 Dec 2005 09:56:29 -0800 yezi <ye_line@hotmail.com> wrote:
| Subject: Re: How to set up to allow local root login in Linux ?
|
| rt.
|
| Thanks
I do it by putting the following in /etc/inittab, replacing an existing
tty entry:
=====<CUT HERE>=========<CUT HERE>=========<CUT HERE>=========<CUT HERE>=====
#-----------------------------------------------------------------------------
# Define console logins to start.
# If you cannot trust your physical security, do not use autologin.
#-----------------------------------------------------------------------------
c1:12345:respawn:/sbin/agetty -n -l /etc/autologin 38400 tty1 linux
# c1:12345:respawn:/sbin/agetty 38400 tty1 linux
=====<CUT HERE>=========<CUT HERE>=========<CUT HERE>=========<CUT HERE>=====
as well as:
=====<CUT HERE>=========<CUT HERE>=========<CUT HERE>=========<CUT HERE>=====
#-----------------------------------------------------------------------------
# Define serial port logins.
# If you cannot trust your physical security, do not use autologin.
#-----------------------------------------------------------------------------
s0:12345:respawn:/sbin/agetty -n -l /etc/autologin 9600 ttyS0 vt100
# s1:12345:respawn:/sbin/agetty -n -l /etc/autologin 9600 ttyS1 vt100
# s0:12345:respawn:/sbin/agetty 9600 ttyS0 vt100
# s1:12345:respawn:/sbin/agetty 9600 ttyS1 vt100
=====<CUT HERE>=========<CUT HERE>=========<CUT HERE>=========<CUT HERE>=====
Then I have this script named "/etc/autologin":
=====<CUT HERE>=========<CUT HERE>=========<CUT HERE>=========<CUT HERE>=====
#!/bin/bash
pid="$$"
dev=$( /usr/bin/find "/proc/${pid}/fd/0" -maxdepth 0 -type l -printf '%l\n' )
tty=$( echo "${dev}" | /usr/bin/cut -d / -f 3 )
speed=$( /usr/bin/stty -a | /usr/bin/head -1 | /usr/bin/cut -d ' ' -f 2 )
if [[ -x "/etc/autologin-${tty}-OK" ]]; then
echo ""
echo "Welcome to `exec uname -s` `exec uname -r`."
echo ""
echo "`exec uname -n` login: root"
echo "Password:"
cd /root
export AUTOLOGIN=1
export AUTOLOGIN_DEV="${dev}"
export AUTOLOGIN_TTY="${tty}"
export AUTOLOGIN_SPEED="${speed}"
exec /bin/su -
fi
if [[ -c "${dev}" ]]; then
exec /sbin/agetty "${speed}" "${tty}" linux
fi
echo "Unable to enable console ${dev}"
if [[ -x /bin/sleep ]]; then
exec /bin/sleep 3600
fi
exec /usr/bin/sleep 3600
=====<CUT HERE>=========<CUT HERE>=========<CUT HERE>=========<CUT HERE>=====
Then I touch the following files into existance:
/etc/autologin-tty1-OK
/etc/autologin-ttyS1-OK
Your mileage may vary, but mine gets me there.
--
-----------------------------------------------------------------------------
| Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
| (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------
| |
| Adam Price 2005-12-17, 2:48 am |
| On 15 Dec 2005 10:22:30 -0800, yezi wrote:
> I am sorry, the question is just allow the local root login.
Piss off and do your own homework. If you can't answer civil questions with
reasonable answers then you don't deserve any help.
|
|
|
|
|