Topic "Problem with sudo -s and SFTP"

Author Message
DaSilva
[View user's profile]

Joined: 2008-12-22
Posts: 10
Location: localhost
I have followed the guide on https://winscp.net/eng/docs/faq_su and it works with my Debian Etch server as long as I log in with SCP but as soon as I want to use SFTP instead of SCP I cannot get su rights.
When I use SFTP only the "Default" SFTP server option works but then I miss the su rights. When I try to use "sudo /usr/bin/sftp" (where sftp is located from my OpenSSH installation) WinSCP says "Cannot initialize SFTP protocol. Is the host running a SFTP server?". I have tried several changes in the sshd_config but always the same problem.
Currently I have to use (slow) SCP if I want to have the su rights.
How can I get them as well with SFTP?
Thanks in advance.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Have you checked log file of the SSH server?
_________________
Martin Prikryl
DaSilva
[View user's profile]

Joined: 2008-12-22
Posts: 10
Location: localhost
Code:
Apr 20 12:32:10 s1 sshd[9356]: Accepted password for user from 12.34.56.78 port 63457 ssh2
Apr 20 12:32:10 s1 sshd[9358]: (pam_unix) session opened for user user by (uid=0)
Apr 20 12:32:10 s1 sudo:  user : TTY=unknown ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/sftp
Apr 20 12:32:10 s1 sshd[9358]: (pam_unix) session closed for user user

Apr 20 12:32:48 s1 sshd[9378]: subsystem request for sftp

Apr 20 12:55:56 s1 sshd[14453]: Accepted password for user from 12.34.56.78 port 63815 ssh2
Apr 20 12:55:56 s1 sshd[14455]: (pam_unix) session opened for user user by (uid=0)
Apr 20 12:55:56 s1 sshd[14455]: subsystem request for sftp
Apr 20 12:55:56 s1 sshd[14455]: error: subsystem: cannot stat internal-sftp: No such file or directory
Apr 20 12:55:56 s1 sshd[14455]: subsystem request for sftp failed, subsystem not found
Apr 20 12:55:56 s1 sudo:  user : TTY=unknown ; PWD=/home/user ; USER=root ; COMMAND=/bin/bash
Apr 20 12:56:00 s1 sshd[12526]: (pam_unix) session closed for user user
Apr 20 12:56:00 s1 sshd[14460]: Accepted password for user from 12.34.56.78 port 63816 ssh2
Apr 20 12:56:01 s1 sshd[14462]: (pam_unix) session opened for user user by (uid=0)
Apr 20 12:56:01 s1 CRON[14482]: (pam_unix) session opened for user root by (uid=0)


You can see my different approaches...
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
I'm confused by the:
error: subsystem: cannot stat internal-sftp: No such file or directory
_________________
Martin Prikryl
DaSilva
[View user's profile]

Joined: 2008-12-22
Posts: 10
Location: localhost
I have tried to set the subsystem to "internal-sftp" because of an entry from Google and that was the error message. So it is only another subsystem in the config which I tried (unsuccessfully).
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Then I do not see when entries in the log file corresponds to the actual test with sudo. Anyway, I can hardly help you with setting up your SSH server.
_________________
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