PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : proftpd mit virtualhosting



cubaff
09.10.04, 17:34
hi ich habe root zugriff auf einen server und möchte dort einem bestimmten user in ein verzeichniss einsperren, aber nicht in das home verzeichniss dass er als standard zugewiesen bekommen hatte. auf dem server laufen mehrere virtuelle server und ich weiß nicht, wie und wo (in welcher proftpd.conf) ich das einstellen muss.

eine config liegt ganz normal in: etc/proftpd.conf
und eine weitere in: home/virtual/site1/fst/etc/proftpd.conf

die sehen auch ziemlich ähnlich aus, nur das die erste servertype standalone hat und die zweite inetd.

ich hoffe jemand kann damit was anfangen, wenn ihr noch mehr infos braucht sagt mir bitte welche. arbeite noch nicht sehr lange mit linux und kenn mich halt dementsprechend aus...

thx schonmal im vorraus
mfg Felix

corresponder
09.10.04, 19:36
hi,

du willst einfach eine chroot?
also eine change-root umgebung?!
somot den user in ein verzeichnis einspreen oder wie?

gruss

c.

cubaff
09.10.04, 19:52
ja, ich weiß, dass ich das mit defaultroot machen muss, hab aber keine ahnung wo ich das reinschreiben muss, da das filesystem etwas kompliziert ist, ich denk mal das ichs in die home/virtual/site1/fst/etc/proftpd.conf schreiben muss. wenn ich nun den benutzer hugo in das verzeichniss home/virtual/site1/fst/var/www/html/bilder/ einsperren will, was muss ich dann schreiben?

cubaff
09.10.04, 20:54
hier ist die config aus etc/:

# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use. It establishes a single server
# and a single anonymous login. It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName "ProFTPD"
ServerType Standalone
DefaultServer on

# Define this if you want to prevent your server from displaying what FTP
# server and version you are using.
ServerIdent on "AM"

#Time out parameters
TimeoutIdle 600
TimeoutNoTransfer 600
TimeoutLogin 300

# Port 21 is the standard FTP port.
Port 21

# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances 30

# Set the user and group that the server normally runs at.
User root
Group root

# To disable use of system-wide password file
PersistentPasswd off

<Global>
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022

# Setting this to 'on' makes PAM the final authority on what gets
# authenticated. Turning this off will tell PAM to allow other
# authentication modules compiled into ProFTPD a chance at the user.
AuthPAMAuthoritative On

# This is the PAM configuration file that will be referenced when
# authenticating. It can be set globally and/or per VirtualHost.
# The default is 'ftp'. Note: all PAM configuration files must be in
# /etc/pam.d
AuthPAMConfig ftp

# Don't let people pass % characters to the server and to protect against DoS attacks (Bugzilla ID 1066)
DenyFilter (\*.*/)|%

<Limit SITE_CHMOD>
AllowAll
</Limit>

RequireValidShell on
</Global>

# Normally, we want files to be overwriteable.
<Directory /*>
AllowOverwrite on
</Directory>

include "/etc/proftpd/proftpd.conf.wp"

cubaff
09.10.04, 20:56
und hier die aus home/virtual/site1/fst/etc/:

# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use. It establishes a single server
# and a single anonymous login. It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName "ProFTPD"
ServerType inetd
DefaultServer on

# Define this if you want to prevent your server from displaying what FTP
# server and version you are using.
ServerIdent off
IdentLookups off

# Port 21 is the standard FTP port.
Port 21

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022

# Setting this to 'on' makes PAM the final authority on what gets
# authenticated. Turning this off will tell PAM to allow other
# authentication modules compiled into ProFTPD a chance at the user.
AuthPAMAuthoritative On

# This is the PAM configuration file that will be referenced when
# authenticating. It can be set globally and/or per VirtualHost.
# The default is 'ftp'. Note: all PAM configuration files must be in
# /etc/pam.d
AuthPAMConfig ftp

# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances 30

# Don't let people pass % characters to the server and to protect against DoS attacks (Bugzilla ID 1066)
DenyFilter (\*.*/)|%

# Normally, we want files to be overwriteable.
AllowChmod true
<Directory /*>
AllowOverwrite on
</Directory>
RequireValidShell on

corresponder
09.10.04, 21:36
hi,

ich mach das über die passwd und halt die chroot in etc.

gruss

c.

cubaff
09.10.04, 22:00
das mit der passwd hab ich auch gesehen und hab dort das homeverzeichniss geändert. wenn ich mich jetzt über ftp anmelde, bin ich zwar in dem verzeichniss, kann aber dort nichts schreiben, das geht nur in dem alten home verzeichniss, ka warum.

eine chroot hab ich net in dem etc ordner

corresponder
09.10.04, 22:14
hi,

mit dem befehl chown änderst du die rechte von ordnern
der ordner, welcher dem user gehört muss natürlich seine rechte oder der user in einer gruppe sein, die den ordner nutzen darf...

die chroot geht so:

in der passwd folgendes machen:

test:x:1001:1001:,,,:/home/test:/bin/bash
test:x:1001:1001:,,,:/home/test:/etc/ftponly

test is der user deiner wahl

dann legst du in /etc eine datei ftponly an
diese trägst du in die datei shells ein- fertig

/etc/ftponly
muss in der datzei shells stehen...

gruss

c.