Für die sichere Übertragung von Archiven über das Internet habe ich mich entschieden, immer zu verwenden SFTP. Also machte ich eine Anweisung, in der wir die Entscheidung OPENSSH.
Das Setup wird auf Debian Squeeze gemacht, aber es passt auch zu jedem * NIX-System, auf das Sie OPENSSH setzen können.
Installieren Sie den Befehl ssh:
aptitude install ssh
Hinzufügen eines Benutzers back Unter dem wir mit dem Archivordner arbeiten werden:
useradd -d /dev/null -M -s /bin/bash back
Weisen Sie dem vom Benutzer erstellten Team ein Passwort zu - fragt 2 Mal nach einem Passwort, die Eingabe wird nicht angezeigt:
passwd back
Ich empfehle Ihnen, Ihr Passwort in ein Notizbuch zu schreiben.
Erstellen Sie einen Ordner, in dem der Benutzer Archive aufzeichnen kann:
mkdir -p /sftp/back/
Lassen Sie uns die Dateirechte erhalten :
chown -R back:back /sftp/back/
!!! ChrootDirectory Es sollte nicht für die aufnahme für den benutzer verfügbar sein. back
Bearbeiten Sie als nächstes die Konfigurationsdatei. ssh nach unten /etc/ssh/sshd_config
vi /etc/ssh/sshd_config
war:
...
Subsystem sftp /usr/lib/openssh/sftp-server
# 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
...
wurde:
...
#Subsystem sftp /usr/lib/openssh/sftp-server
# 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
Subsystem sftp internal-sftp
Match User back
X11Forwarding no
AllowTcpForwarding no
AllowAgentForwarding no
ForceCommand internal-sftp
ChrootDirectory /sftp/Starten Sie den Befehl ssh neu:
/etc/init.d/ssh restart
Die Aufgabe ist abgeschlossen, Sie können sich unter dem Login an 22 Ports mit dem Server verbinden (wenn es nicht geändert wurde). back und das Passwort, das Sie zuvor aufgeschrieben haben.
Ich war bei dir. Sergej Lazarenko.




Kommentar