[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 751
  • Last Modified:

telnet (with userId/password as parameters)??

Is there a way to execute telnet with user id and password as parameters, so that you can skip the input and have the window
come right up already logged in?
0
booksplus
Asked:
booksplus
  • 5
  • 3
  • 2
  • +3
1 Solution
 
wesly_chenCommented:
No, password is require by typing for telnet.

However, you can use rsh (remote shell) which without typing password ( put "+" in ~/.rhost)

Wesly
0
 
yuzhCommented:
I would not use telnet to do this kind of job. A sniffer can capture the plain text package from a telnet connetion including user + password. ssh can do the job.

If you really want to use telnet, expect is a tool to help make an automatic telnet script, and you can redirect the output to a local file!  
http://expect.nist.gov/

or have a look at
http:Q_20995574.html
0
 
gheistCommented:
some systems support unsafe file named .netrc to store raw passwords.
ssh is much safer and supports passwordless authentication using public key authentication with ssh agent, so consider exploring this posibility instead of others.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
manav_mathurCommented:
Does .netrc work for telnet too?? I though it was FTP only

Manav
0
 
chris_calabreseCommented:
.netrc is FTP only.

Unlike FTP, telnet is a totally unstructured protocol and does not have native concepts of user-id and password.

I'd have to throw my hat in with yuzh and say to use ssh or telnet+expect.
0
 
booksplusAuthor Commented:
What I was hoping for is to have telnet (or PuTTY) shortcuts on my desktop such that I could double click on one and it would
open to a machine and I would not have to be prompted for user/passwd (just provide it as a parm).

This would be a great convenience at times.  
0
 
booksplusAuthor Commented:
Increase points to 100
0
 
chris_calabreseCommented:
I take it this is a Windows desktop.

My suggestion is to:
o Use SSH instead of Telnet, using PuTTY as the client
o Setup keys so you can login with the keys instead of a password
o Use PuTTY's key-agent so that you only get prompted for the key's passphrase once instead of on every login
0
 
booksplusAuthor Commented:
Yes this is a Windows desktop.


If I use SSH, then can I only execute a command?  Because I want a session (with the mere convenience of
not being prompted with userId/passwd), not just a command.
0
 
wesly_chenCommented:
Hi,
>  want a session (with the mere convenience of lot being prompted with userId/passwd), not just a command
Yes, you can with ssh as chris_calabrese's post.

Rsh will do the same thing if you donot care about the security very much. Because it will be easier for you to implement
passwordless login ( put "+" in ~/.rhost).

However, it's up to you.

Wesly
0
 
booksplusAuthor Commented:
Sounds good Chris.  Can you provide me more detail on the PuTTY way.  I've tried it, but it's
not clear how I should proceed.

Increasing points to 200 (for more detail).

thanks.
0
 
booksplusAuthor Commented:
PS -
I have a PuTTY client on my Windows desktop.  I want to use it to create a session with a Unix machine such that I am not prompted
for user Id and password.  I have an account on the Unix machine.  This is only for the convenience to be able to double click on an
icon and have the Unix session ready to go w/o being prompted for login.
0
 
chris_calabreseCommented:
Yes, you can have a terminal session through SSH in PuTTY.

As to how to do it...

1. Set PuTTY to use SSH Protocol 2 (protocol 1 is insecure and almost all systems support 2 now) by setting Session...Protocol to SSH and Connect...SSH...Preferred SSH Protocol Version to 2. Save this as a PuTTY session.

2. Generate an SSH2 DSA key with the puttygen utility. Save the private key in your My Documents folder as Identity and the public key as Identity.pub

3. Add the public key information to the system you're logging into by loading your key in puttygen, copying the "Public key for pasting into OpenSSH" into the clipboard, and adding it to $HOME/.ssh/authorized_keys on the Unix/Linux server in question.

4. Setup PuTTY's keyagent to hold your key and to start keyagent on login to your PC by cutting and pasting the following into a DOS window:

cd "%USERPROFILE%\Start Menu\Programs\Startup"
echo set mydocs=%HOMEDRIVE%%HOMEPATH%\My Documents> start_pagent.bat
echo cd "%mydocs%">> start_pagent.bat
echo for /f "TOKENS=1*" %%A in ('dir/b *.ppk') DO SET key=%%A>> start_pagent.bat
echo start "%ProgramFiles%\PuTTY\pageant.exe" "%mydocs%\%key%">> start_pagent.bat
"%USERPROFILE%\Start Menu\Programs\Startup\start_pagent.bat"

5. Create Sart Menu short-cuts by calling
"c:\program files\putty\putty\putty.exe" –ssh <logname>@<host>


See the PuTTY help pages for additional background...
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 3
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now