LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 03-11-2003, 09:19 PM   #1
presstone
LQ Newbie
 
Registered: Dec 2002
Location: Pennsylvania
Distribution: Darwin (Mac OS X) and RedHat 8
Posts: 6

Rep: Reputation: 0
SSH and autologin?


Here's my situation. My server is Redhat 8. I use Mac OS X via the terminal to connect using ssh to the server. Now, is there anyway to have it just login and not as for a password when I use:

ssh -l default 192.168.1.3

? It always comes back asking for a password. I would like a way around that and have it so that i just gives me the command prompt of the redhat server and never ask for a password. I did read about using public and private keys but got lost . Can anyone help me here?

Last edited by presstone; 03-11-2003 at 09:26 PM.
 
Old 03-11-2003, 09:34 PM   #2
crichards
Member
 
Registered: Feb 2003
Location: Arizona
Distribution: Gentoo!
Posts: 124

Rep: Reputation: 15
Thats a good thing. You don't want to disable a password, especially for ssh and other remote connection software, since thats a major security problem.
 
Old 03-11-2003, 09:57 PM   #3
presstone
LQ Newbie
 
Registered: Dec 2002
Location: Pennsylvania
Distribution: Darwin (Mac OS X) and RedHat 8
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by crichards
Thats a good thing. You don't want to disable a password, especially for ssh and other remote connection software, since thats a major security problem.
I'd rather take the risk. I am trying to make a program that will get into my redhat server and display the log from a running process (using screen). I really need to get rid of the password question, at least on my side. I don't want to take it off the server but if i can do it that way, tell me how. I don't care if someone breaks into it because it's by itself on it's own network and if they trash the server i can just rebuild it, no biggie.
 
Old 03-12-2003, 07:51 AM   #4
Burke
Member
 
Registered: Dec 2002
Location: Virginia, USA
Distribution: Fedora Core 3
Posts: 131

Rep: Reputation: 15
Overall, you'd probably be better off just writing a php script that parses the log you're trying to check on.
 
Old 03-12-2003, 08:20 AM   #5
gmasci
LQ Newbie
 
Registered: Apr 2001
Posts: 8

Rep: Reputation: 0
You can use ssh-keygen to generate public and private keys. The public key you will want to paste to the know_hosts file in your ~/.ssh/ directory on the server. Also look into .shost file
 
Old 03-12-2003, 01:33 PM   #6
presstone
LQ Newbie
 
Registered: Dec 2002
Location: Pennsylvania
Distribution: Darwin (Mac OS X) and RedHat 8
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Burke
Overall, you'd probably be better off just writing a php script that parses the log you're trying to check on.
Nah, I want to do much more than just check log. My plan was to make a program for viewing the log and displaying (every minute or so) the response to the status command for the server. I have a counter-strike server running and I want to make a program for Mac OS X that displays the status of the server constantly. There's gotta be another way...
 
Old 03-12-2003, 08:02 PM   #7
m0rl0ck
Member
 
Registered: Nov 2002
Distribution: A totally 133t distro :)
Posts: 358

Rep: Reputation: 31
1. run ssh-agent to start a shell for ssh-keygen
2.run ssh-keygen to generate the needed keys
3. copy the users public key to the authorized_keys file of the remote machine
(authorized_keys2 if using ssh protocol 2)

Thats it. Your user should be able to log into the remote machine without passwords. You can also run programs on the remote machine just by doing:

ssh machine.mynet.com programname


Key authentication is pretty safe as long as the actual keys are safe. No passwords flying around the net for one thing, nothing to sniff

any questions?

If your reading a specific howto and getting lost, where is it and where are you getting lost?
 
Old 03-12-2003, 08:15 PM   #8
presstone
LQ Newbie
 
Registered: Dec 2002
Location: Pennsylvania
Distribution: Darwin (Mac OS X) and RedHat 8
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by m0rl0ck
1. run ssh-agent to start a shell for ssh-keygen
2.run ssh-keygen to generate the needed keys
3. copy the users public key to the authorized_keys file of the remote machine
(authorized_keys2 if using ssh protocol 2)
I did make the keys... rsa1, rsa and a dsa key. I did read somewhere that I need to copy that key to the other machine but it told me to put it in ~/.ssh but that doesn't exist. Where should I put it (RedHat 8) and what should it be called?

Quote:
Thats it. Your user should be able to log into the remote machine without passwords. You can also run programs on the remote machine just by doing:

ssh machine.mynet.com programname
I actually log in using ssh, run screen and run the program from screen. If the server is running, I use screen -r to see the server. I love that screen program :-)

Thanks for your help. This is exactly what I was looking for :-)
 
Old 03-12-2003, 08:40 PM   #9
m0rl0ck
Member
 
Registered: Nov 2002
Distribution: A totally 133t distro :)
Posts: 358

Rep: Reputation: 31
Quote:
told me to put it in ~/.ssh but that doesn't exist. Where should I put it (RedHat 8) and what should it be called

The user has to be the same on both machines. Lets say the user is gbush.

The public key generated would go into the /home/gbush/.ssh/authorized_keys file on the remote machine.
Now gbush can log into the remote machine without a password.

Be careful copying the keys to the remote machine if you get a line break in them they wont work.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH/SCP Autologin overpeer Linux - Security 8 10-19-2005 06:51 AM
Autologin to KDE from SSH skorpi0wn Linux - Software 1 04-18-2005 11:22 PM
autologin zaicheke Linux - General 1 07-16-2004 07:15 PM
autologin on RH 7.2 mehesque Linux - General 0 06-08-2004 08:16 AM
KDE 3.2 autologin js72 Fedora 4 02-16-2004 04:40 PM


All times are GMT -5. The time now is 11:19 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration