Topic "sftp support"

Author Message
aleksaldo

Guest


Hi, i have used winscp sftp for quite some time. Then i decided to use it to upload and edit files in root. I couldnt do that even when my user has nopasswd to sudo. So i saw on this page i could type sudo before the sftp server in the sftp tab. I did like this "sudo /usr/libexec/openssh/sftp-server" but it wont connect. It will connect with "/usr/libexec/openssh/sftp-server". Why wont it do it with sudo like that post said? http://winscp.net/eng/docs/faq_su#fn1 please help, i really need to be able to edit root.
Advertisements
RobHam
[View user's profile]

Joined: 2009-05-25
Posts: 15
Location: Wales, UK
My method to edit root user files when I am logged in as a standard user is to open a putty terminal session and then type

sudo nano /file_path/file_name

and to create a blank root user file ready for editing use

sudo touch /file_path/file_name


Perhaps a wishlist item could be a way of running the Winscp GUI editor as a super user by opening a second SFTP connection just for the editor and somehow swapping the user with su to root for this second connection.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
aleksaldo wrote:
Hi, i have used winscp sftp for quite some time. Then i decided to use it to upload and edit files in root. I couldnt do that even when my user has nopasswd to sudo. So i saw on this page i could type sudo before the sftp server in the sftp tab. I did like this "sudo /usr/libexec/openssh/sftp-server" but it wont connect. It will connect with "/usr/libexec/openssh/sftp-server". Why wont it do it with sudo like that post said? http://winscp.net/eng/docs/faq_su#fn1 please help, i really need to be able to edit root.

Sorry, I'm not an *nix expert. The FAQ covers everything I know on the topic. It works for me.
Try checking the server-side logs to see why it won't connect.
_________________
Martin Prikryl
aleksaldo

Guest


prikryl wrote:
aleksaldo wrote:
Hi, i have used winscp sftp for quite some time. Then i decided to use it to upload and edit files in root. I couldnt do that even when my user has nopasswd to sudo. So i saw on this page i could type sudo before the sftp server in the sftp tab. I did like this "sudo /usr/libexec/openssh/sftp-server" but it wont connect. It will connect with "/usr/libexec/openssh/sftp-server". Why wont it do it with sudo like that post said? http://winscp.net/eng/docs/faq_su#fn1 please help, i really need to be able to edit root.

Sorry, I'm not an *nix expert. The FAQ covers everything I know on the topic. It works for me.
Try checking the server-side logs to see why it won't connect.

Im not an expert with these servers and that stuff. But i found this in the log "sudo: sorry, you must have a tty to run sudo" does that mean that i need to be connected throught a command line?
aleksaldo

Guest


Sorry, i found out that i had to turn of requretty. It said that it was disabled by default but i guess not.
aleksaldo

Guest


Sorry for making several post it was no option to edit since im not registered*
I added the following line in my CentOS 6 sudoers folder because i didnt want all users to have
requiretty off:
Defaults requiretty
Defaults:aleksaldo !requiretty
Defaults!/usr/libexec/openssh/sftp-server !requiretty
(line nr 3 is just a security experiment)
Now it changed from:
sudo: sorry, you must have a tty to run sudo
to:
sudo: no tty present and no askpass program specified

but i have requretty off for the user?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
Looks like it is still trying to prompt you for a password. Make sure you have ALL=NOPASSWD set for your account, as per the FAQ.
_________________
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