Afegir usuari FTP: diferència entre les revisions
(Pàgina nova, amb el contingut: «FTP: Crear usuari: sudo adduser -m -G dafyngrp -s /bin/false dafyn sudo passwd dafyn Crear usuari usant una home ja existent: sudo useradd dafyn -G dafyngrp...».) |
|||
(Hi ha 3 revisions intermèdies del mateix usuari que no es mostren) | |||
Línia 1: | Línia 1: | ||
FTP: | =Usant el vsFTPd= | ||
Recommenat. Més info: http://cviorel.easyblog.ro/2009/03/05/how-to-setup-vsftpd-ftp-on-ubuntu-linux/ | |||
==Configurar== | |||
apt-get install vsftpd | |||
Assegurar que el /etc/vsftpd.conf conté per defecte: | |||
anonymous_enable=NO | |||
local_enable=YES | |||
també | |||
# Uncomment this to enable any form of FTP write command. | |||
write_enable=YES | |||
Per tancar usuaris especifics a la seva carpeta fer, afegir-hi també: | |||
chroot_list_enable=YES | |||
# (default follows) | |||
#chroot_list_file=/etc/vsftpd.chroot_list | |||
i en el fitxer /etc/vsftpd.chroot_list afegir-hi els usuaris especifics | |||
==Afegir usuaris== | |||
sudo useradd -d /var/www/camera/c -s /usr/sbin/nologin USUARI | |||
o bé | |||
sudo useradd -d /var/www/camera/c -s /bin/false USUARI | |||
Hem d'afegir el false o el nologin com a shell valid: | |||
==Adding a “fake” shell== | |||
Edit the /etc/shells file and add a non-existent shell name like /bin/false, for example. This fake shell will limit access on the system for FTP users. | |||
sudo vi /etc/shells | |||
/etc/shells: valid login shells | |||
/bin/sh | |||
/bin/bash | |||
/bin/false | |||
/bin/false is our added no-existent shell. With Red Hat Linux, a special device name /dev/null exists for purposes such as these. | |||
=Usant el ProFTPd= | |||
Crear usuari: | Crear usuari: | ||
Línia 26: | Línia 69: | ||
he posat /bin/false com a shell a /etc/shells | he posat /bin/false com a shell a /etc/shells | ||
si no tambe: RequireValidShell off | si no tambe: RequireValidShell off | ||
==Instalar el ProFTPD sense usar el portage== | |||
Step 1: Download Proftpd | |||
Step 2: Go to the dir where you downloaded it `cd /dir` | |||
Step 3: Untar the package `tar xzvf filename.tar.gz` | |||
Step 4: Go into the new dir `cd proftpd*` | |||
Step 5: Configure the package `./configure --prefix=/usr/local/proftpd` | |||
Step 6: Compile & Install the package `make; make install` - u must be root for this step | |||
Step 7: Start the ftp server `/usr/local/proftpd/sbin/proftpd` | |||
Step 8: To uninstall the server do the following: `killall -9 proftpd; rm -rf /usr/local/proftpd` |
Revisió de 20:27, 17 abr 2012
Usant el vsFTPd
Recommenat. Més info: http://cviorel.easyblog.ro/2009/03/05/how-to-setup-vsftpd-ftp-on-ubuntu-linux/
Configurar
apt-get install vsftpd
Assegurar que el /etc/vsftpd.conf conté per defecte:
anonymous_enable=NO local_enable=YES
també
# Uncomment this to enable any form of FTP write command. write_enable=YES
Per tancar usuaris especifics a la seva carpeta fer, afegir-hi també:
chroot_list_enable=YES # (default follows) #chroot_list_file=/etc/vsftpd.chroot_list
i en el fitxer /etc/vsftpd.chroot_list afegir-hi els usuaris especifics
Afegir usuaris
sudo useradd -d /var/www/camera/c -s /usr/sbin/nologin USUARI
o bé
sudo useradd -d /var/www/camera/c -s /bin/false USUARI
Hem d'afegir el false o el nologin com a shell valid:
Adding a “fake” shell
Edit the /etc/shells file and add a non-existent shell name like /bin/false, for example. This fake shell will limit access on the system for FTP users.
sudo vi /etc/shells
/etc/shells: valid login shells
/bin/sh /bin/bash /bin/false
/bin/false is our added no-existent shell. With Red Hat Linux, a special device name /dev/null exists for purposes such as these.
Usant el ProFTPd
Crear usuari:
sudo adduser -m -G dafyngrp -s /bin/false dafyn sudo passwd dafyn
Crear usuari usant una home ja existent:
sudo useradd dafyn -G dafyngrp -d /var/www/dafyn.com -s /bin/false sudo passwd dafyn
Afegir el usuari dins de /etc/proftpd/proftpd.conf:
AllowUser OR root,zeus,marti,webftp,familia,dafyn,trafalgar,dafynfitxers,trainee
Reiniciar:
sudo /etc/init.d/proftpd restart
Altres informacions: Config:
/etc/proftpd/proftpd.conf
he posat /bin/false com a shell a /etc/shells si no tambe: RequireValidShell off
Instalar el ProFTPD sense usar el portage
Step 1: Download Proftpd Step 2: Go to the dir where you downloaded it `cd /dir` Step 3: Untar the package `tar xzvf filename.tar.gz` Step 4: Go into the new dir `cd proftpd*` Step 5: Configure the package `./configure --prefix=/usr/local/proftpd` Step 6: Compile & Install the package `make; make install` - u must be root for this step Step 7: Start the ftp server `/usr/local/proftpd/sbin/proftpd` Step 8: To uninstall the server do the following: `killall -9 proftpd; rm -rf /usr/local/proftpd`