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

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

Re: sftp support

martin 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? https://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?
martin

Re: sftp support

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? https://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.
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 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? https://winscp.net/eng/docs/faq_su#fn1 please help, i really need to be able to edit root.