Для безпечного перенесення архівів через Інтернет, я вирішив завжди використовувати SFTP. Так я зробив інструкції, в якій ми використовуємо рішення OPENSSH.
Налаштування проводиться на Debian Squeeze, але також підійде будь-яка система *NIX, яка ви можете покласти OpenSSH на.
Встановіть команду Ssh:
aptitude install ssh
Додавання користувача back Під яким ми будемо працювати з папкою архіву:
useradd -d /dev/null -M -s /bin/bash back
Призначте пароль до команди, створеної користувачем - запитує пароль 2 рази, вхід не буде відображатися:
passwd back
Я рекомендую писати пароль в блокнот.
Створіть папку, в якій користувач може записувати архіви:
mkdir -p /sftp/back/
Давайте отримувати права на файл :
chown -R back:back /sftp/back/
!!! ChrootDirectory Для запису користувача не потрібно. back
Далі відредагуйте файл конфігурації. ssh втрьох /etc/ssh/sshd_config
vi /etc/ssh/sshd_config
був:
...
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 /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/Перезавантажити команду Ssh:
/etc/init.d/ssh restart
Завдання завершено, можна підключити до сервера на 22 портах (якщо це не було змінено) під логіном. back і пароль ви раніше писали.
Я був з вами. Сергій Лазаренко.




Про нас