Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Plink.exe not executing secound cmd

Posted on 2012-08-24
9
Medium Priority
?
1,211 Views
Last Modified: 2013-05-18
C:\Reset>Plink.exe -load "SAN" -ssh -P 22  x@SAN -pw s5 -v -m 1.txt

the Below is the output
Started a shell/command
SAN ---------------- DISplaying the hostname
Server sent command exit status 0
Disconnected: All channels closed

1.txt containg 2 cmds one is Hostname and Dir  

its only outputs  Hostname and DIr cmds does not execute
0
Comment
Question by:reddy2388
  • 5
  • 3
9 Comments
 
LVL 9

Expert Comment

by:parparov
ID: 38346830
Could you try '-batch' switch to plink?
0
 

Author Comment

by:reddy2388
ID: 38347783
Still no Luck its not executing secound cmd
0
 
LVL 31

Expert Comment

by:serialband
ID: 38351490
Have you tried switching the order of the commands to see if the Dir command works?
0
Industry Leaders: 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!

 

Author Comment

by:reddy2388
ID: 38351557
I tried that Still no luck
0
 
LVL 31

Expert Comment

by:serialband
ID: 38351653
No luck with the dir command or no luck with the 2nd command when you swapped?
0
 

Author Comment

by:reddy2388
ID: 38364022
no luck with both
0
 
LVL 31

Expert Comment

by:serialband
ID: 38364314

C:\Reset>Plink.exe -load "SAN" -ssh -P 22  x@SAN -pw s5 -v -m 1.txt

I noticed now, that your command has a both a -load "SAN" and a x@SAN.  I've just tried this myself and plink complains to me that x@SAN is not a command not found.  I suspect this extra bit is throwing off your textfile commands.  

When you create your session named SAN, you likely entered only the server name. You can add the username in the field.  So, instead of just your server name of SAN, you should have x@SAN in the field when you save your session.  (e.g.  my_user_name@server_name.google.com)


If you can, the other thing you should add to your server is an ssh key, so you never have to type your password in clear text anywhere on the command line or in a script file.  Use pageant to load your keyfile, enter your passphrase, and all subsequent calls to your remote ssh server won't need passwords, assuming they support ssh keys.  I never type my password in the clear in any script if I can avoid it.
0
 

Accepted Solution

by:
reddy2388 earned 0 total points
ID: 39162658
the solution was you have & between two cmds

hostname & Dir & ipconfig
0
 

Author Closing Comment

by:reddy2388
ID: 39176912
it works as expected
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Cloud file services can fill many different roles for your business. Often, the use of cloud file services begins with employees using consumer products, like Dropbox, to share files with customers and each other. While sync-and-share can be an effe…
As a financial services provider, your business is impacted by two of the strictest federal regulations on record: the Sarbanes-Oxley Act and the Gramm-Leach-Bliley Act. Correctly implementing faxing into your organization to provide secure, real-ti…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Suggested Courses
Course of the Month11 days, 18 hours left to enroll

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question