Results 1 to 6 of 6
Hey everybody,
I have just a one line script that runs telnet, and even though I've looked around I thought maybe someone could just tell me if there is a ...
- 01-19-2011 #1Just Joined!
- Join Date
- Oct 2008
- Posts
- 44
Telnet and automatic login
Hey everybody,
I have just a one line script that runs telnet, and even though I've looked around I thought maybe someone could just tell me if there is a way to automatically login to the telnet server without having to type it in everytime. It's more of a hassle type of thing, but no matter what I've tried, I can't get anything to work. Any suggestions?
G.
- 01-19-2011 #2
the short answer is a scripting language called expect. the long answer is why would you ever want to use telnet and not SSH?
With ssh you can use public / private keypair to have authentication without password prompts. That and the fact that it is not sending password in clear text make it a MUCH better option.New to the internet, technical forums, or the hacker / open source community??
Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html
RHCE for RHEL version 5
RHCT for RHEL version 4
- 01-19-2011 #3Just Joined!
- Join Date
- Oct 2008
- Posts
- 44
Hmmm...
I've heard of (and likely used) SSH since I installed Linux, but I don't know how to integrate it with Telnet through a standard TTY with a shell running. Any comments?
G.
- 01-21-2011 #4Just Joined!
- Join Date
- Oct 2008
- Posts
- 44
Still not quite sure
Well, I fooled around with it some, but I can't figure out how to get the user/pass combo to log in. Something like "ssh uname@machine.com telnet remote.com" but that doesn't seem to do it. Can anybody give an example or something to point me in the right direction?
- 01-21-2011 #5Just Joined!
- Join Date
- Mar 2009
- Location
- Norway
- Posts
- 52
Hi,
create a keypair:
answer yes to all questions (default is perfectly fine)Code:ssh-keygen -t rsa -b 2048
copy the file $HOME/.ssh/id_rsa.pub to your target machine, it must be *appended* in $HOME/.ssh/authorized_keys2 on the target.
Then, log in via ssh
Don't bother adding telnet to an ssh-command, they are *not* the same commands. And ssh will use a tty, so you should not have to change all that much in your script.Code:ssh username@server.example.org
- 01-22-2011 #6Just Joined!
- Join Date
- Oct 2008
- Posts
- 44


Reply With Quote
