Ubunut sudo su Cannot initialize SFTP protocol. Is the host

Advertisement

Torwart91
Joined:
Posts:
1

Ubunut sudo su Cannot initialize SFTP protocol. Is the host

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:

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 ;) )

Reply with quote

Advertisement

patrick73
Joined:
Posts:
7
Location:
France

I have the same problem (also with Ubuntu Linux 12.04.2 ).
my log :
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 ?

Reply with quote

nilven
Guest

winscp

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

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


@CentOS
visudo - add following 2 entrys

 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 -

Reply with quote

Advertisement

You can post new topics in this forum