Moje knowledge base, pro Vás i pro mne. Ale také spousta blbin okolo.

TrueFlip

Jak otevrit soubory ve winscp jako root

13.08.2015 10:02

I would like to share a tip, frequently we need modify protected files (i.e. in an Ubuntu box) from WinSCP remotely, but sometimes that is impossible.

If you have a non-privileged user and want to edit a root protected file of an Ubuntu box but with WinSCP, you can do it with a few changes.

Requirements:

1. Server:

– Ubuntu 11.04
– Non-privileged user: chilcano

2. Client:

– Any S.O. but with WinSCP 4.3.6 (https://winscp.net)

Steps:

1. In the server side add this line to /etc/sudoers

chilcano@sso1:/$ sudo nano /etc/sudoers

and

[...]
#### added
chilcano ALL=NOPASSWD: /usr/lib/openssh/sftp-server

2. In the client side open WinSCP and do the following

Check SFTP protocol in WinSCP

Check SFTP protocol in WinSCP

and

Add customized command to sftp-server in Ubuntu

Add customized command to sftp-server in Ubuntu

3. Test it, open a protected file and modify. You could do changes on it.

Open as ROOT from WinSCP

Open as ROOT from WinSCP

End.

I hope this help you.

 

ZDROJ: https://holisticsecurity.wordpress.com/2012/09/03/open-files-ubuntu-root-from-winscp-remotely/