script command plink.exe
-
- Member
- Posts: 6
- Joined: 09 Dec 2016 09:55
script command plink.exe
Hello, i tried to create a script with plink which it execute commands in a file .txt
It contains : start C:\Users\Administrateur\Desktop\plink.exe -ssh 10.1.1.1 -t -l admin -pw switch -m command.txt
the command.txt contains just "mkdir test"
start C:\Users\Administrateur\Desktop\plink.exe -ssh 10.1.1.1 -t -l admin -pw switch < command.txt doesn't work too
it result with an "FATAL Error"
with powershell there is this error :
plink.exe : FATAL ERROR: Server sent disconnect message
+ CategoryInfo : NotSpecified: (FATAL ERROR: Se...connect message:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
type 2 (protocol error):
"ssh + command not available"
can you please help me to fix it
It contains : start C:\Users\Administrateur\Desktop\plink.exe -ssh 10.1.1.1 -t -l admin -pw switch -m command.txt
the command.txt contains just "mkdir test"
start C:\Users\Administrateur\Desktop\plink.exe -ssh 10.1.1.1 -t -l admin -pw switch < command.txt doesn't work too
it result with an "FATAL Error"
with powershell there is this error :
plink.exe : FATAL ERROR: Server sent disconnect message
+ CategoryInfo : NotSpecified: (FATAL ERROR: Se...connect message:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
type 2 (protocol error):
"ssh + command not available"
can you please help me to fix it
Re: script command plink.exe
plink doesn't use local command files. you can only start scripts, that are present in the remote file system.
regards...
--- back to basics... focus your eyes to the essential things... ---
regards...
--- back to basics... focus your eyes to the essential things... ---
--- back to basics... focus your eyes to the essential things... ---
-
- Member
- Posts: 6
- Joined: 09 Dec 2016 09:55
Re: script command plink.exe
Thanks to you for reply, I tried to run a .sh in /flash with "mkdir test" inside but it doesn't work. How can I start it please?
There is always the same error
There is always the same error
Re: script command plink.exe
have tried it with a ssh via plink to a linux system. and it works (even with the option -m for local commandfile > which i've never used before )...
Are you sure that "mkdir test" is possible via a "normal" ssh-session?
regards...
--- back to basics... focus your eyes to the essential things... ---
Are you sure that "mkdir test" is possible via a "normal" ssh-session?
regards...
--- back to basics... focus your eyes to the essential things... ---
--- back to basics... focus your eyes to the essential things... ---
Re: script command plink.exe
Also try plink without any options.
regards...
--- back to basics... focus your eyes to the essential things... ---
regards...
--- back to basics... focus your eyes to the essential things... ---
--- back to basics... focus your eyes to the essential things... ---
-
- Member
- Posts: 6
- Joined: 09 Dec 2016 09:55
Re: script command plink.exe
start C:\Users\Administrateur\Desktop\plink.exe -ssh 10.1.1.1 -t -l admin -pw switch
It works
"Welcome to the Alcatel-Lucent OmniSwitch 6000
Software Version 6.3.1.1052.R01 Service Release, December 11, 2008.
Copyright(c), 1994-2007 Alcatel-Lucent. All Rights reserved.
OmniSwitch(TM) is a trademark of Alcatel-Lucent registered
in the United States Patent and Trademark Office." appears
with "-m file.txt" or "< file.txt" or just a command after the password it doesn't works there is the same error
"mkdir test" works when I use putty and that I write it myself...
Regards
It works
"Welcome to the Alcatel-Lucent OmniSwitch 6000
Software Version 6.3.1.1052.R01 Service Release, December 11, 2008.
Copyright(c), 1994-2007 Alcatel-Lucent. All Rights reserved.
OmniSwitch(TM) is a trademark of Alcatel-Lucent registered
in the United States Patent and Trademark Office." appears
with "-m file.txt" or "< file.txt" or just a command after the password it doesn't works there is the same error
"mkdir test" works when I use putty and that I write it myself...
Regards
-
- Member
- Posts: 6
- Joined: 09 Dec 2016 09:55
Re: script command plink.exe
Please find attached the error that powershell and plink evoke
Regards
Regards
You do not have the required permissions to view the files attached to this post.
Re: script command plink.exe
the server closes the connection because the execution of pure commands without a ssh-session is not supported.
maybe this example for a cisco switch will lead you to success -> https://zeleskitech.com/2014/08/02/send ... owershell/
it opens a ssh.session and sends the commands trough an input stream object.
i've found it with a simple google search. https://www.google.de/search?q=ssh+powe ... 8gfYkbq4Cw
if it works pelase share it
may the force be with you
regards...
maybe this example for a cisco switch will lead you to success -> https://zeleskitech.com/2014/08/02/send ... owershell/
it opens a ssh.session and sends the commands trough an input stream object.
i've found it with a simple google search. https://www.google.de/search?q=ssh+powe ... 8gfYkbq4Cw
if it works pelase share it
may the force be with you
regards...
--- back to basics... focus your eyes to the essential things... ---
-
- Member
- Posts: 6
- Joined: 09 Dec 2016 09:55
Re: script command plink.exe
Hello, first of all thanks to you for your response and your involvement . I tried the solution that you have proposed and there are a number of errors. So I tried this solution from PowerShell Module and I noticed that the connection was apparently fine but there is no index associated with the connection (necessary when calling the command "Get-SSHSession"). I think this is not normal compared to what I found on internet, so I still do not know what to do.
You can find attached what I have done on PowerShell module..
Regards
You can find attached what I have done on PowerShell module..
Regards
You do not have the required permissions to view the files attached to this post.
-
- Member
- Posts: 6
- Joined: 09 Dec 2016 09:55
Re: script command plink.exe
So I updated PowerShell and I got a number for the SessionID but when I try to send a command it say me that the client is not connected and just before it say connected : true
You do not have the required permissions to view the files attached to this post.