Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Auto Log In, workstation to connect to Terminal srv.
ctrunk514
post Jul 17 2003, 10:14 AM
Post #1


./configure
***

Group: Members
Posts: 93
Joined: 29-May 03
From: Denver, CO, USA
Member No.: 902



OK, don't freak out.

I want to know if there is a way to make linux (redhat 9.0) auto log in for a certain user. of course there would still have to be a way to break out of the auto log on if I needed to get in as root.

Basically what I am doing is make a system that boots up and automatically logs in as some user then starts up rdesktop and connects to my Terminal Server. I already have rdesktop working and as soon as my user logs in, rdesktop auto starts and connects to the terminal server, then the user logs into the network -- it works great. i'm just trying to get around the user having to log in twice.

I figured ya'll would know if this was possible or not.
Go to the top of the page
 
+Quote Post
Joey
post Jul 17 2003, 10:18 AM
Post #2


LinuxHelp Admin
*******

Group: Admin
Posts: 1,096
Joined: 18-September 02
Member No.: 1



I think this can be done using GDM.

I found this off google:

"Gnome menu -> Programs -> System -> GDM configurator

The GDM configuration tool will allow you to set GDM up to automatically
log a user in at startup. That user can still log out and log in as
another user (or CTRL+ALT+Backspace to log in again!)"
Go to the top of the page
 
+Quote Post
ctrunk514
post Jul 17 2003, 10:22 AM
Post #3


./configure
***

Group: Members
Posts: 93
Joined: 29-May 03
From: Denver, CO, USA
Member No.: 902



Thanks for the Tip, I'll look into it.

If anyone has any other information on GMD or anything else, I appreciate it
Go to the top of the page
 
+Quote Post
Joey
post Jul 17 2003, 10:25 AM
Post #4


LinuxHelp Admin
*******

Group: Admin
Posts: 1,096
Joined: 18-September 02
Member No.: 1



More info on it can be found at http://www.jirka.org/gdm.html and http://www.jirka.org/gdmtalk.pdf
Go to the top of the page
 
+Quote Post
ctrunk514
post Jul 18 2003, 09:00 AM
Post #5


./configure
***

Group: Members
Posts: 93
Joined: 29-May 03
From: Denver, CO, USA
Member No.: 902



I don't think that GDM is going to work for me. I need to make this happen in console mode (command prompt only). Im working with older systems and have not installed Gnome or KDE. As a matter of fact the only things I install are Xwindows, and rdesktop, the less I install the better.

Maybe what I'm trying to do is not possible, does any one have any other thougts?
Go to the top of the page
 
+Quote Post
Joey
post Jul 18 2003, 09:08 AM
Post #6


LinuxHelp Admin
*******

Group: Admin
Posts: 1,096
Joined: 18-September 02
Member No.: 1



Try searching google.com for "autologin linux console" or something similar.

I came across http://www.linuxgazette.com/issue27/kodis.html but dont have time right now to fully read through it.
Go to the top of the page
 
+Quote Post
ctrunk514
post Jul 22 2003, 03:33 PM
Post #7


./configure
***

Group: Members
Posts: 93
Joined: 29-May 03
From: Denver, CO, USA
Member No.: 902



Would it be possible to use rc.local?

any thoughts?
Go to the top of the page
 
+Quote Post
ctrunk514
post Jul 23 2003, 07:14 AM
Post #8


./configure
***

Group: Members
Posts: 93
Joined: 29-May 03
From: Denver, CO, USA
Member No.: 902



Another fellow is telling me:

you should be able to run a script as some user from rc.local that starts up X & rdesktop with 'su - username -c /path-to/startup-script'

What do you guys think of this?
Go to the top of the page
 
+Quote Post
Joey
post Jul 23 2003, 11:35 AM
Post #9


LinuxHelp Admin
*******

Group: Admin
Posts: 1,096
Joined: 18-September 02
Member No.: 1



No idea if it will work. Give it a shot and let us know.
Go to the top of the page
 
+Quote Post
ctrunk514
post Jul 24 2003, 07:02 AM
Post #10


./configure
***

Group: Members
Posts: 93
Joined: 29-May 03
From: Denver, CO, USA
Member No.: 902



I got it to work!! (kind of)

This is what I did:

For automatic login, you will need to create a user (and the home directory is required).
I will use guest.

Create a file (autologin) in /sbin
In the file, add:
exec su --login guest

Save it and make it executable:
chmod 755 autologin

In the /etc/inittab, replace the line
1:2345:respawn:/sbin/mingetty tty1
with
1:2345:respawn:/sbin/autologin tty1

You should set automatic login on tty1, since tty1 is where the guest login will default to.



OK, I did not use the guest account, instead I used a user that I have been working with on my system. It worked, my machine auto logged !! im stoked!

My problem now is that my user can not startx, he could before and root can still. I get an error that says "Pam authentication failed, can not start server. Perhaps you do not have console ownership"

what do you think?
Go to the top of the page
 
+Quote Post
Joey
post Jul 24 2003, 09:32 AM
Post #11


LinuxHelp Admin
*******

Group: Admin
Posts: 1,096
Joined: 18-September 02
Member No.: 1



well I would say it has to do with removing "mingetty tty1". After you log in, run ps aux and see who has ownership of the tty1.
Go to the top of the page
 
+Quote Post
ctrunk514
post Jul 24 2003, 10:41 AM
Post #12


./configure
***

Group: Members
Posts: 93
Joined: 29-May 03
From: Denver, CO, USA
Member No.: 902



I believe that you are correct, this must be the problem.

When I do a ps aux, mingetty tty1 does not show up. mingetty tty3, 4, 5 and 6 show up all owned by root.

When I put the inittab file back to the way it was, my user can startx normally.

my bubble has burst :-(
Go to the top of the page
 
+Quote Post
Joey
post Jul 24 2003, 11:11 AM
Post #13


LinuxHelp Admin
*******

Group: Admin
Posts: 1,096
Joined: 18-September 02
Member No.: 1



Have a look at http://www.linuxgazette.com/issue72/chung.html
Go to the top of the page
 
+Quote Post
ctrunk514
post Jul 24 2003, 11:38 AM
Post #14


./configure
***

Group: Members
Posts: 93
Joined: 29-May 03
From: Denver, CO, USA
Member No.: 902



OK this is great, I think it going to work.

Just one quick question: (remember i'm a newbe)

There is a line in these instuctions that says "compile this tiny C program using the GNU C-compiler" Then goes on to give an example:

gcc -o autologonfred autologonfred.c

It does not seem that gcc is installed on my system, do I need to install it? Or is this example wrong, or does redhat use some other c compiler?

Thanks for all you help by the way.
Go to the top of the page
 
+Quote Post
Joey
post Jul 24 2003, 12:08 PM
Post #15


LinuxHelp Admin
*******

Group: Admin
Posts: 1,096
Joined: 18-September 02
Member No.: 1



You'll need to install gcc. Just grab the RPM from your redhat cds or from the redhat ftp site.
Go to the top of the page
 
+Quote Post
ctrunk514
post Jul 24 2003, 02:23 PM
Post #16


./configure
***

Group: Members
Posts: 93
Joined: 29-May 03
From: Denver, CO, USA
Member No.: 902



RIGHT ON!! That was it!

Thanks again Joey for all the help.



Just in case that link you provided stops working one day (I found this to be very common while searching for answers to this problem), i'm posting the directions so that if any one is looking to do this same thing can benefit from them.

HOW TO MAKE LINUX AUTO LOG ON to the console (command prompt):


Using your favourite text editor create a file named autologinfred.c and type in this short C program:


int main() {
execlp( "login", "login", "-f", "fred", 0);
}

The execlp system call invokes the command "login -f fred" and replaces the current processing context with this invocation. The man page for login describes the action of the -f argument. Compile this tiny C program using the GNU C-compiler:


$ gcc -o autologinfred autologinfred.c

Gain root privileges (using su) and copy the executable to a public directory:


# cp autologinfred /usr/local/sbin/

Now take a look at /etc/inittab. This is the configuration file is used by init, the very first process started when Linux initialises. You should observe lines similar to the following:


1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3

The exact contents of /etc/inittab differ from distribution to distribution. On Debian systems one sees:


1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3

Edit the line beginning with "1:2345" so that it reads as follows:


1:2345:respawn:/sbin/getty -n -l /usr/local/sbin/autologinfred 38400 tty1

The above will cause the user fred to be logged in automatically on the first virtual console. On some GNU/Linux distributions (like RedHat) /sbin/agetty must be used instead. The -l <alternative login> argument to getty substitutes the default /sbin/login program with the one we compiled earlier. The -n tells getty to not prompt for a user ID.



Good luck and thanks again!
Go to the top of the page
 
+Quote Post
Joey
post Jul 24 2003, 02:25 PM
Post #17


LinuxHelp Admin
*******

Group: Admin
Posts: 1,096
Joined: 18-September 02
Member No.: 1



Awesome smile.gif
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 10th December 2017 - 11:02 PM