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

Author Message
jazz
[View user's profile]

Joined: 2005-04-17
Posts: 2
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
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
jazz wrote:
Is there a way to use winscp's already logged in session with plink?

What for?

Quote:
How does winscp maintain state when scp is a stateless protocol?

Well it maintains it itself Smile But maybe I do not understand what your ask for.

Quote:
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?
_________________
Martin Prikryl
Guest




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

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

Quote:
What are you missing?

I'm a bit confused about when to use what. Smile
For example:
Code:
winscp3.exe user@server /upload C:/test.txt
works but
Code:
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. Smile

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?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
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.

Quote:
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?

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

Quote:
I'm a bit confused about when to use what. Smile
For example:
Code:
winscp3.exe user@server /upload C:/test.txt
works but
Code:
winscp3.exe user@server /console put C:/test.txt
doesn't.

You cannot execute command directly from command line, yet.

Quote:
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. Smile

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.
_________________
Martin Prikryl
Guest




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

Quote:
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. Smile
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
Quote:
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.

Quote:
Quote:
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 Smile
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License