Topic "Ubunut sudo su Cannot initialize SFTP protocol. Is the host"

Author Message
Torwart91
[View user's profile]

Joined: 2013-03-22
Posts: 1
Hi,

I have a issue with my Winscp. If I login without using sudo it working fine.
But if i set sudo I get the Error:

Code:
Cannot initialize SFTP protocol. Is the host running a SFTP server?


I'am using Ubunutu 12.04.2.

Thank for help!

(I hope you understand everything I wrote, sorry for my english Wink )
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24995
Location: Prague, Czechia
How do you "set sudo"?
Did you check this guide?
https://winscp.net/eng/docs/faq_su

Anyway, you should check the server's log.
_________________
Martin Prikryl
patrick73
[View user's profile]

Joined: 2013-04-15
Posts: 7
Location: France
I have the same problem (also with Ubuntu Linux 12.04.2 ).
my log :
Code:
sshd[34150]: Accepted password for myusername from 100.000.000.001 port 44253 ssh2
sshd[34150]: pam_unix(sshd:session): session opened for user myusername by (uid=0)
sudo: pam_unix(sudo:auth): conversation failed
sudo: pam_unix(sudo:auth): auth could not identify password for [myusername]
sudo: pam_unix(sudo:auth): conversation failed
sudo: pam_unix(sudo:auth): auth could not identify password for [myusername]
sudo: pam_unix(sudo:auth): conversation failed
sudo: pam_unix(sudo:auth): auth could not identify password for [myusername]
sudo:  myusername : 3 incorrect password attempts ; TTY=unknown ; PWD=/home/myusername ; USER=root ; COMMAND=/usr/lib/openssh/sftp-server
sshd[34150]: pam_unix(sshd:session): session closed for user myusername


in sudoers (with visudo) because there isnot "requiretty" option, i have try to add this:
Defaults:myusername!requiretty

and also add this line :
myusername ALL=NOPASSWD: /usr/lib/openssh/sftp-server

but dont work too!
In this ubuntu version, root isnt activated by default (for security raisons) so i prefer not active it...

Can you help me ?
nilven

Guest


Hi, I want to share my solution because I'm also searching several time for a workaround. I'm using CentOS7 right now and try to get connetion via WinSCP (Pubkey Auth).

sshd_config

Code:
 ..
    RSAAuthentication yes
    PubkeyAuthentication yes
    AuthorizedKeysFile   .ssh/authorized_keys
    PasswordAuthentication no
    UsePAM yes
    ..



@CentOS
visudo - add following 2 entrys

Code:
 username ALL=NOPASSWD: /bin/su
    Defaults:username !requiretty


WinSCP settings:

Disable keyboard-interactive @ SSH authentication settings solves the problem for me.
Shell command in SCP-settings: sudo su -
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