Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

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.
aleksaldo

Sorry for making several post it was no option to edit since I'm not registered.
I added the following line in my CentOS 6 sudoers folder because I didn't 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 requiretty off for the user?
aleksaldo

Sorry, I found out that I had to turn off requiretty. It said that it was disabled by default but I guess not.
aleksaldo

Re: sftp support

@martin: I'm 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?
martin

Re: sftp support

@aleksaldo: 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.
RobHam

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.
aleksaldo

SFTP support

Hi, I have used WinSCP SFTP for quite some time. Then I decided to use it to upload and edit files in root. I couldn't 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 won't connect. It will connect with /usr/libexec/openssh/sftp-server. Why won't it do it with sudo like that post said?
How do I change user after login (e.g. su root)?
Please help, I really need to be able to edit root.