Nieuws:

Ubuntu-NL weer online!

Na een periode van technische problemen en een overbelaste server zijn we eindelijk weer bereikbaar.
Samen met Hobbynet, onze sponsor en hostingpartner, hebben we een oplossing gevonden zodat alles weer soepel draait.

Bedankt voor jullie geduld en begrip. We hopen nu weer verder te gaan waar we gebleven waren.

Het team van Ubuntu-NL

Welkom, Gast. Alsjeblieft inloggen of registreren.
Heb je de activerings-mail niet ontvangen?

Auteur Topic: VSFTPD filesysteem beveiligen  (gelezen 1115 keer)

Offline pascal7

  • Lid
VSFTPD filesysteem beveiligen
« Gepost op: 2011/03/22, 11:30:21 »
Hoi ubuntu guru's  ;),

Ik ben op dit moment ben ik bezig met het installeren van de VSFTPD.
Hiermee wil ik dat de gebruikers alleen in hun homefolder kunnen komen en niet het hele filesystem door kunnen zoeken.
Dit blijkt allemaal iets ingewikkelder dan het lijkt.

Ik heb de volgende regel toegevoegd:
local_root=/home/drivers/
Hierdoor wordt de /home/drivers/ map standaard geladen.
Volgens het wereld wijde web kan met onderstaande regel dit gerealiseerd worden
chroot_list_enable=NO.
Alleen werkt het bij mij dus niet.

Offline Rachid

  • Lid
    • rachidbm
    • Mijn blog
Re: VSFTPD filesysteem beveiligen
« Reactie #1 Gepost op: 2011/03/22, 11:38:11 »
Ik zou dit veilige FTP gewoon via OpenSSH regelen. Dat zit al standaard in Ubuntu en is ook zo'n beetje de standaard in de linux-wereld.
Hier een howto: http://wiki.ubuntu-nl.org/community/SftpServer
Ben je ook blij dat Ubuntu zo toegankelijk en gratis is, en wil je graag net als ik iets terugdoen, kijk dan eens rond bij mwanzo, dé poort naar het bijdragen aan Ubuntu en haar gemeenschap!

Offline pascal7

  • Lid
Re: VSFTPD filesysteem beveiligen
« Reactie #2 Gepost op: 2011/03/31, 13:48:10 »
Ik heb het geprobeerd maar nadat alles ingesteld is en de SSH service probeer te herstarten dan krijg ik de volgende melding

beheer@beheer-laptop:~$ sudo /etc/init.d/ssh restart
/etc/ssh/sshd_config line 93: Directive 'UsePAM' is not allowed within a Match block
beheer@beheer-laptop:~$

Op die lijn 93 staat:
# 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
Als ik bij de UsePam no zet dan krijg ik nogsteeds de melding en als ik van de regel commentaar maak # dan start de service maar dan werken de aanpassingen niet.

Offline Johan van Dijk

  • Administrator
    • johanvandijk
Re: VSFTPD filesysteem beveiligen
« Reactie #3 Gepost op: 2011/03/31, 13:50:41 »
Dan is het handig als je de rest van de configuratie ook even post. (evt. wel ip-adressen en inlognamen anonimiseren)
Blijkbaar staat boven het stuk wat je hier geplaatst hebt iets wat de rest in de war schopt.

Offline pascal7

  • Lid
Re: VSFTPD filesysteem beveiligen
« Reactie #4 Gepost op: 2011/03/31, 14:02:05 »
Hierbij het config bestand. Iedereen alvast bedankt voor de moeite:

# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
Port 22
# 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
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

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

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
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

Match group sftponly
ChrootDirectory /home/drivers
X11Forwarding no
AllowTcpForwarding no
ForceCommand 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

Offline Johan van Dijk

  • Administrator
    • johanvandijk
Re: VSFTPD filesysteem beveiligen
« Reactie #5 Gepost op: 2011/03/31, 14:11:58 »
Ik zou dit hele blok:
Subsystem sftp internal-sftp

Match group sftponly
ChrootDirectory /home/drivers
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp

Verplaatsen naar helemaal onderaan het bestand.