[+] Serwer plików

Konfiguracja serwerów, usług, itp.
konsola
Posty: 47
Rejestracja: 13 stycznia 2016, 09:33

Post autor: konsola »

Poradziłem sobie ale problem był w innym miejscu. Ale zato teraz nie mogę się połączyć do ftp po instalacji proftpd działało bez problemu a teraz mam komunikat

Kod: Zaznacz cały

tatus:    Łączenie z 192.168.1.21:2122...Status:    Połączenie nawiązanie, oczekiwanie na wiadomość powitalną...
Odpowiedź    SSH-2.0-OpenSSH_6.7p1 Debian-5
Błąd:    Nie można nawiązać połączenia FTP z serwerem SFTP. Wybierz odpowiedni protokół.
Błąd:    Critical error: Nie można połączyć się z serwerem
Wybrałem logowanie przez sftp ale nie chce się połączyć problem wystąpił po zainstalowaniu ssh w pakiecie był też sftp. Czy teraz muszę na nowo postawić serwer na sftp może to i lepiej bo teraz będę miał szyfrowanie.

Kod: Zaznacz cały

Status:	Łączenie z 192.168.1.21:2122...Odpowiedź	fzSftp started
Polecenie:	open "tajwan@192.168.1.21" 2122
Polecenie:	Ufaj nowemu kluczowi hosta: Raz
Polecenie:	Pass: *********
Status:	Connected to 192.168.1.21
Błąd:	Connection closed by server with exitcode 1
Błąd:	Nie można połączyć się z serwerem
Status:	Oczekiwanie na ponowienie...
Status:	Łączenie z 192.168.1.21:2122...
Odpowiedź	fzSftp started
Polecenie:	open "tajwan@192.168.1.21" 2122
Polecenie:	Ufaj nowemu kluczowi hosta: Raz
Polecenie:	Pass: *********
Status:	Connected to 192.168.1.21
Błąd:	Connection closed by server with exitcode 1
Błąd:	Nie można połączyć się z serwerem
Awatar użytkownika
pawkrol
Moderator
Posty: 939
Rejestracja: 03 kwietnia 2011, 10:25

Post autor: pawkrol »

Jeśli nie zmieniałeś standardowych portów to sftp masz na 22.
Chcesz mieć szyfrowaną transmisję ftp to wygeneruj sobie certyfikaty do proftp i używaj TLS.
konsola
Posty: 47
Rejestracja: 13 stycznia 2016, 09:33

Post autor: konsola »

Port zmieniałem tylko do proftpd na 2122 ale nie wiem czemu nie chce się połączyć. To wolał bym od nowa postawić przez sftp i mieć jeden niż kombinować. Tu proftpd a tu sftp. Zastanawiam się czy zostać na proftpd+TSL czy lepszym rozwiązaniem było by sftp

http://wklej.to/K9RnG

Kod: Zaznacz cały

[color=#333333][font=monaco]Plik: ssh_config                                 [/font][/color]
# This is the ssh client system-wide configuration file.  See
# ssh_config(5) for more information.  This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.


# Configuration data is parsed as follows:
#  1. command line options
#  2. user-specific file
#  3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.


# Site-wide defaults for some commonly used options.  For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.


Host *
#   ForwardAgent no
#   ForwardX11 no
#   ForwardX11Trusted yes
#   RhostsRSAAuthentication no
#   RSAAuthentication yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   GSSAPIKeyExchange no
#   GSSAPITrustDNS no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/identity
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   Port 2122
#   Protocol 2,1
#   Cipher 3des
#   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
#   MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
#   EscapeChar ~
#   Tunnel no
#   RSAAuthentication yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   GSSAPIKeyExchange no
#   GSSAPITrustDNS no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/identity
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   Port 2122
#   Protocol 2,1
#   Cipher 3des
#   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
#   MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
#   EscapeChar ~
#   Tunnel no
 #   TunnelDevice any:any
#   PermitLocalCommand no
#   VisualHostKey no
#   ProxyCommand ssh -q -W %h:%p gateway.example.com
#   RekeyLimit 1G 1h
    SendEnv LANG LC_*
    HashKnownHosts yes
    GSSAPIAuthentication yes
    GSSAPIDelegateCredentials no



Kod: Zaznacz cały

[color=#333333][font=monaco]Plik: sshd_config                               [/font][/color][color=#333333][font=Verdana]
[/font][/color]# Package generated configuration file
# See the sshd_config(5) manpage for details


# What ports, IPs and protocols we listen for
Port 2122
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes


# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024


# Logging
SyslogFacility AUTH
LogLevel INFO


# Authentication:
LoginGraceTime 120
PermitRootLogin without-password
StrictModes yes


RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile     %h/.ssh/authorized_keys


# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes


# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no


# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes


# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes


# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes


X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no


#MaxStartups 10:30:60
#Banner /etc/issue.net


# Allow client to pass locale environment variables
AcceptEnv LANG LC_*


Subsystem sftp internal-sftp


# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
Match Group sftp
ChrootDirectory /sftp/%u
AllowTCPForwarding no
X11Forwarding no
ForceCommand internal-sftp
Match



Kod: Zaznacz cały

[color=#333333][font=monaco]/usr/lib/openssh/sftp-server                       [/font][/color][color=#333333][font=Verdana]
^?ELF^B^A^A^@^@^@^@^@^@^@^@^@^C^@>^@^A^@^@^@a/^@^@^@^@^@^@@^@^@^@^@^@^@^@`e^A^@$^@^@^@^@^@^@�^X^@^@^@^@^@^@^@^@ ^@^@^@^@^@^B^@^@^@^F^@^@^@PZ^A^@^@^@^@^@PZ!^@^@$^C^@^@"^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@�^B^@^@^R^@^@^@^@^@^@^@^@^@^@^@^@^$^@��^@^@^@^@^@^@�^@^@^@^@^@^@^@�^A^@^@^R^@^@��^@^@^@^@^@^@^C^@^@^@^@^@^@^@^@libc.so.6^@socket^@fchmod^@readdir^@gai_strer$^@^@^G^@(^D^@^@^P^@^@^@^Sii^@^@^F^@2^D^@^@^P^@^@^@���^F^@^@^E^@<^D^@^@^P^@^@^@^Tii^@^@^D^@G^D^@^@^P^@^@^@t^Yi     ^@^@^C^@Q^D^@^@^P^@^@^@u^Zi     ^@^@^B^@]^D^@^@$^A^@^@^@^@^@�X!^@^@^@^@^@^H^@^@^@^@^@^@^@^F^A^@^@^@^@^@^@Y!^@^@^@^@^@^H^@^@^@^@^@^@^@^K^A^@^@^@^@^@^PY!^@^@^@^@^@^H^@^@^@^@^@^@^@^P^A^@^@^@^@^@ Y!^@^@^@^@^@^H^@^@^@^@^@^@^@^U^A^@^@^@^@^@0Y!^@^@^@^@^@^H^@^@^@^@^@^@^@^Z^A^@^@^@^@^@@Y!^@^@^@^@^@^H^@^@^@^@^@^@^@^_^A^@^@^@^@^@PY!^@^@^@^@^@^H^@^@^@^@^@^@^@$^A^@^@^@^@^@`Y!^@^@^@^@^@^H^@^@^@^@^@^@^@)^A^@^@^@^@^@pY!^@^@^@^@^@^H^@^@^@^@^@^@^@.^A^@^@^@^@^@�Y!^@^@^@^@^@^H^@^@^@^@^@^@^@3^A^@^@^@^@^@�Y!^@^@^@^@^@^H^@^@^@^@^@^@^@7



[/font][/color]
Awatar użytkownika
marcin1982
Moderator
Posty: 1732
Rejestracja: 05 maja 2011, 12:59
Lokalizacja: Zagłębie Dąbrowskie

Post autor: marcin1982 »

Proszę wklej te pliki jeszcze raz po ludzku, bo narazie są nieczytelne.
konsola
Posty: 47
Rejestracja: 13 stycznia 2016, 09:33

Post autor: konsola »

Nie wiem co się stało było dobrze wklejone. Poprawione.
konsola
Posty: 47
Rejestracja: 13 stycznia 2016, 09:33

Post autor: konsola »

Postawiłem system na nowo zainstalowałem open-ssh i serwer ftp zadziałał od strzała . Tylko teraz przez ssh nie mogę się połączyć z serwerem.http://wklej.to/DgtLnknown_hosts
http://wklej.to/IRYII
mariaczi
Member
Posty: 1343
Rejestracja: 08 lutego 2008, 12:58
Lokalizacja: localhost@śląskie

Post autor: mariaczi »

Jaki masz wynik polecenia

Kod: Zaznacz cały

netstat -tnpl
z tej maszyny?
konsola
Posty: 47
Rejestracja: 13 stycznia 2016, 09:33

Post autor: konsola »

Kod: Zaznacz cały

 netstat -tnpl(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:55518           0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      -               
tcp6       0      0 :::42627                :::*                    LISTEN      -               
tcp6       0      0 :::111                  :::*                    LISTEN      -               
tcp6       0      0 ::1:25                  :::*                    LISTEN      -               


Kod: Zaznacz cały

netstat -tnplActive Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:55518           0.0.0.0:*               LISTEN      500/rpc.statd   
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      476/rpcbind     
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      518/inetd       
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      858/exim4       
tcp6       0      0 :::42627                :::*                    LISTEN      500/rpc.statd   
tcp6       0      0 :::111                  :::*                    LISTEN      476/rpcbind     
tcp6       0      0 ::1:25                  :::*                    LISTEN      858/exim4       
mariaczi
Member
Posty: 1343
Rejestracja: 08 lutego 2008, 12:58
Lokalizacja: localhost@śląskie

Post autor: mariaczi »

konsola pisze:Tylko teraz przez ssh nie mogę się połączyć z serwerem.
Ponieważ nie masz zainstalowanego (bądź uruchomionego tylko) serwera ssh.
konsola
Posty: 47
Rejestracja: 13 stycznia 2016, 09:33

Post autor: konsola »

Wszystko jest dobrze zainstalowane i włączone pomogło wyczyszczenie pliku known_hosts
Zablokowany