Topic "Copy file with su another_userid"

Author Message
BijuGC
[View user's profile]

Joined: 2005-01-29
Posts: 8
First of all thanks for WinSCP. As I am more familiar with WinSCP, I use it religiously even though my company provide another proprietary SCP client application.

In my work place, we can access our RedHat Linux system with our userid (authentication controlled by Microsoft Active Directory) or by a generic application user id.
We run all the web apps using app user id, and the application files and directories are under the ownership of app user id.
To copy files from windows to Linux app dirs we login with app user id in WinSCP.

But after the Target department store security breach they are restricting many facilities.
They are removing remote login access for app user id.
We have to login using MS-AD userid, then do su app user id.
This works for PuTTY, but not for WinSCP ( http://winscp.net/eng/docs/faq_su )
As well as my uid is not in the sudoers.

Along with this is another problem, we are unable to do chown or chgrp for files with my id or app user id.
But I can do chmod with my MS-AD user id or app user id for files with respective ownership.

So I do following steps to transfer files from Windows to Linux.

1. In WinSCP Login using ms-ad-uid
2. Run PuTTY, login with ms-ad-uid
3. In PuTTY, su app-uid
4. In PuTTY, go to the destination file transfer directory
5. In PuTTY, run “mkdir x” or another dir name which dont exist
6. In PuTTY, chmod 777 x
7. In PuTTY, cd x
8. In PuTTY, pwd
9. In PuTTY, copy output of pwd
10. In WinSCP, paste the new dir path from the clipboard
11. In WinSCP, copy file from Windows to Linux, wait till file transfer is over
12. In PuTTY, copy the newly transferred file to the parent dir
13. Repeat this process for every file.
14. In PuTTY, goto parent dir of “x”, then “rm -r x”

Now my RFE, is it possible to add an automated process for above steps using windows api SendMessage or some thing.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Did you try to automate this with plink and WinSCP scripting? I assume you need to enter a password for the su command, right?
_________________
Martin Prikryl
BijuGC
[View user's profile]

Joined: 2005-01-29
Posts: 8
prikryl wrote:
I assume you need to enter a password for the su command, right?
correct.
prikryl wrote:
Did you try to automate this with plink and WinSCP scripting? I assume you need to enter a password for the su command, right?
no.
I don't think you can login as one user and switch to other user with out prompting password. And the su command don't have password as a parameter.
So when I do
Code:
plink -ssh my_user_id@app-server su app_user_id
it gives error msg "standard in must be a tty"
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
OK, and for the same reason you would not be able to do it from WinSCP.
_________________
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