Let plink use winscp's session? How winscp maintain session?

Advertisement

jazz
Joined:
Posts:
2

Let plink use winscp's session? How winscp maintain session?

Hi,

Is there a way to use winscp's already logged in session with plink? How does winscp maintain state when scp is a stateless protocol?

I have a script on windows that uploads a whole bunch files (file and directory names are dynamic) to a remote server. Currently I'm using plink + pageant, this works although I'm using ssh keys and it's still somewhat of a hassle. It'd be nice if I could just keep winscp running and let the script use that already logged in session.

I'm thinking of incorporating winscp3.exe into the script to use instead of plink although the command lines args aren't performing the same way plink did.

The only other thing I can think of is to have my script dynamically write a script to a temporary file and then pass that file to winscp like:
winscp3 /console /script generated_temp.file

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Let plink use winscp's session? How winscp maintain session?

jazz wrote:

Is there a way to use winscp's already logged in session with plink?
What for?

How does winscp maintain state when scp is a stateless protocol?
Well it maintains it itself :-) But maybe I do not understand what your ask for.

I'm thinking of incorporating winscp3.exe into the script to use instead of plink although the command lines args aren't performing the same way plink did.
What are you missing?

Reply with quote

Guest

What for?
So users don't have to log in again and can just use the existing "logged in" session of winscp (which will be running anyway) with the script.
Although the use of ssh-keys + plink works (and also pageant), it's a hassle to setup for new users and there's also an issue with having users have to play around in their .ssh directory on the remoteserver, which the sys admins probably don't want.

But maybe I do not understand what your ask for.
When I've used scp in the past, either from a shell script (in unix) or otherwise (pscp), scp performs it's operations and then closes the connection. This requires you to log in after every operation unless you use ssh-keys. How does winscp keep it's logged in status even after hours of inactivity without using ssh keys?

I'd like to be able to use winscp's logged in status from my script so I don't have to log in again and avoid using ssh keys.

What are you missing?
I'm a bit confused about when to use what. :)
For example:
winscp3.exe user@server /upload C:/test.txt
works but
winscp3.exe user@server /console put C:/test.txt
doesn't.

I guess someway to execute commands on the remoteserver 'cd','mv','rm','put','ls' without going into interactive mode and using the existing authenticated session of winscp. :)

Ideally, I would have winscp running constantly, which keeps me logged in, while I would be able to execute a series of commands from my script like 'cd','put','rm','mv' etc.

Maybe this is already possible?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Anonymous wrote:

So users don't have to log in again and can just use the existing "logged in" session of winscp (which will be running anyway) with the script.
You cannot execute whatever you want on top of session of WinSCP. Only solution is that WinSCP opens additional session for you. But this would be rather ad hoc solution for your particular problem, which noone else had have before.

Although the use of ssh-keys + plink works (and also pageant), it's a hassle to setup for new users and there's also an issue with having users have to play around in their .ssh directory on the remoteserver, which the sys admins probably don't want.
So you want to let user connect thus existing connection of another user? So why don't you gave all of them access to that account straight away?

When I've used scp in the past, either from a shell script (in unix) or otherwise (pscp), scp performs it's operations and then closes the connection. This requires you to log in after every operation unless you use ssh-keys. How does winscp keep it's logged in status even after hours of inactivity without using ssh keys?
In SCP mode, WinSCP is not strictly SCP client. It opens regular shell connnection and executes shell commands. For transfers it uses SCP command. So the "state" is kept by the SSH/shell session.

I'm a bit confused about when to use what. :)
For example:
winscp3.exe user@server /upload C:/test.txt
works but
winscp3.exe user@server /console put C:/test.txt
doesn't.
You cannot execute command directly from command line, yet.

I guess someway to execute commands on the remoteserver 'cd','mv','rm','put','ls' without going into interactive mode and using the existing authenticated session of winscp. :)

Ideally, I would have winscp running constantly, which keeps me logged in, while I would be able to execute a series of commands from my script like 'cd','put','rm','mv' etc.
The same as above. Technically possible, but a bit our of WinSCP's purpose. And potentially big security issue.

Reply with quote

Guest

So you want to let user connect thus existing connection of another user? So why don't you gave all of them access to that account straight away?

No.

If user_A has winscp running and is connected to the remote server, I would like that user_A be able to use plink/pscp from a script using the already logged in winscp session.

Winscp would almost act like pageant does allowing other programs to use the existing authenticated session.

You cannot execute command directly from command line, yet.

Cool sounds like it will be a feature in an upcoming release.

Hey btw, this is a great program it's really well done. :)

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

If user_A has winscp running and is connected to the remote server, I would like that user_A be able to use plink/pscp from a script using the already logged in winscp session.

Winscp would almost act like pageant does allowing other programs to use the existing authenticated session.
Sorry, I do not see this functionality as very useful. Mainly as you can achieve the same with pageant.

You cannot execute command directly from command line, yet.

Cool sounds like it will be a feature in an upcoming release.
Well I haven't wrote that. But maybe :-)

Reply with quote

Advertisement

You can post new topics in this forum