OpenSuse 12.2 ftp connection from vmware host to a guest?

0

I've configured my suse guest os to run a webserver and a ftp but I can't open a ftp connection from my host. I can only open a http connection. My ftp client gives me:

 STATUS:>   [26.04.2012 13:15:20] Liste "" wird abgerufen...
 STATUS:>   [26.04.2012 13:15:20] Verbindung zum FTP-Server wird hergestellt...         
 192.168.92.128:21 (ip = 192.168.92.128)...
 STATUS:>   [26.04.2012 13:15:20] Socket verbunden. Warte auf Willkommensnachricht...
    [26.04.2012 13:15:20] 500 OOPS: could not bind listening IPv6 socket
 FEHLER:>   [26.04.2012 13:15:20] Syntaxfehler: Befehl nicht erkannt.

netstat -a on my guest os gives me this:

 Proto Recv-Q Send-Q Local Address           Foreign Address         State      
 tcp        0      0 *:mysql                 *:*                     LISTEN      
 tcp        0      0 *:ftp                   *:*                     LISTEN      
 tcp        0      0 localhost:ipp           *:*                     LISTEN      
 tcp        0      0 localhost:ipp           *:*                     LISTEN      
 udp        0      0 *:mdns                  *:*                                 
 udp        0      0 *:56897                 *:*                                  
 udp        0      0 *:27213                 *:*                                 
 udp        0      0 *:ipp                   *:*                                 
 udp        0      0 *:34000                 *:*                                 
 udp        0      0 *:dhcpv6-client         *:*  

How can I know what credentials I need to enter to connect with my ftp server? When I open a ftp session with anonymous it gives me this error:

STATUS:>    [26.04.2012 13:48:18] Liste "" wird abgerufen...
STATUS:>    [26.04.2012 13:48:18] Verbindung zum FTP-Server wird hergestellt...       
192.168.92.128:21 (ip = 192.168.92.128)...
STATUS:>    [26.04.2012 13:48:18] Socket verbunden. Warte auf Willkommensnachricht...
    [26.04.2012 13:48:18] 220 Willkommensnachricht
STATUS:>    [26.04.2012 13:48:18] Verbunden. Authentifizierung läuft...
BEFEHL:>    [26.04.2012 13:48:18] USER anonymous
    [26.04.2012 13:48:18] 331 Please specify the password.
BEFEHL:>    [26.04.2012 13:48:18] PASS *****
    [26.04.2012 13:48:18] 500 OOPS: vsftpd: refusing to run with writable root 
inside chroot()

Gigamegs

Posted 2012-04-26T11:23:24.727

Reputation: 1 784

1That last "OOPS" is requiring you, as the ftp site administrator, to change permissions on the root of the ftp site in your openSUSE guest. You can apply chmod a-w to it. After that you'll want to try again and report back if you reach further difficulties. – minopret – 2012-04-26T12:02:26.543

I run chmod -R a-w htdocs/ and it works! Thank you! – Gigamegs – 2012-04-26T12:17:50.243

@minopret: But chmod a-w doesn't allow write access!? I need write access with my ftp client? – Gigamegs – 2012-04-26T12:20:59.067

1It shouldn't be necessary to remove write permission on the entire site. It is necessary to remove write permission on the top directory of the site (no -R option). – minopret – 2012-04-26T12:22:34.570

Answers

1

That last "OOPS" is requiring you, as the ftp site administrator, to change permissions on the root of the ftp site in your openSUSE guest. You can apply chmod a-w to it. It is only necessary to remove write permission on the top directory of the site (no -R option)

minopret

Posted 2012-04-26T11:23:24.727

Reputation: 535

But how can I upload in my root folder when I need to remove my write permissions? – Gigamegs – 2012-04-27T13:46:27.060

It's better practice to create a subdirectory where you can upload. The purpose of the chroot is to prevent any ftp account from tampering with the programs that ftp allows them to execute, even if that account is in the hands of an intruder who has stolen or cracked the account credentials. Permitting anyone to upload to your root folder, even yourself, would defeat that purpose. – minopret – 2012-04-27T16:13:28.507

Do you mean chroot() that he/she can use path traversal to change to root or other folders? I don't really need it. Is there a workaround? – Gigamegs – 2012-04-27T16:29:26.410