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?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

No, password is require by typing for telnet.

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

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!

or have a look at
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.
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

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

.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.
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.  
booksplusAuthor Commented:
Increase points to 100
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
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.
>  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.

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).

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.
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

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...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.