# file: /etc/apt/sources.list # Yandex deb http://mirror.yandex.ru/debian/ lenny main deb http://mirror.yandex.ru/debian/ lenny contrib non-free deb-src http://mirror.yandex.ru/debian/ lenny main deb-src http://mirror.yandex.ru/debian/ lenny contrib non-free # Security fix deb http://security.debian.org/ lenny/updates main deb http://security.debian.org/ lenny/updates contrib non-free deb-src http://security.debian.org/ lenny/updates main deb-src http://security.debian.org/ lenny/updates contrib non-free
debian:~# apt-get update debian:~# apt-get dist-upgrade
neoveneficus@book:~$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/neoveneficus/.ssh/id_rsa): /home/neoveneficus/.ssh/id_rsa already exists. Overwrite (y/n)? y Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/neoveneficus/.ssh/id_rsa. Your public key has been saved in /home/neoveneficus/.ssh/id_rsa.pub. The key fingerprint is: cb:07:dd:67:21:37:ab:93:e1:60:40:ce:0e:b8:b8:e3 neoveneficus@book The key's randomart image is: +--[ RSA 2048]----+ | . | | . + | |. . + . + | |.. o . . + + | |+ . o S . oo | |.o . + = . o | |.E . * o | | . o | | . | +-----------------+
neoveneficus@book:~/.ssh$ scp ~/.ssh/id_rsa.pub root@217.212.252.146:.ssh/authorized_keys neoveneficus@book:~/.ssh$ cat ~/.ssh/id_rsa.pub | ssh root@217.212.252.146 "cat > ~/.ssh/authorized_keys; chmod 600 ~/.ssh/authorized_keys"
debian:~# cd / debian:/# mkdir -m 755 web
debian:~# useradd site1 -b /web/ -m -U -s /bin/false debian:~# passwd site1 debian:~# chmod 754 /web/site1 debian:~# mkdir -p -m 754 /web/site1/public_html/www debian:~# mkdir -p -m 777 /web/site1/tmp debian:~# chmod +t /web/site1/tmp debian:~# chown -R site1:site1 /web/site1/
debian:~# apt-get install apache2-mpm-itk
AssignUserId site1 site1
drwxr-xr-- 2 site1 site1 4096 5 10:17 . drwxr-xr-x 3 site1 site1 4096 5 10:14 .. -rwxr-x--- 1 site1 site1 0 5 10:14 index.php -rwxrw---- 1 site1 site1 0 5 10:17 tmp.txt
AssignUserId www-data site1
debian:~# usermod -s /bin/false www-data
# file: /etc/apache2/sites-available/site1 <VirtualHost *:80> DocumentRoot "/web/site1/public_html/www/" ServerName "test1" ErrorLog /web/site1/error_log CustomLog /web/site1/access_log combined AssignUserId www-data site1 php_admin_value open_basedir "/web/site1/:." php_admin_value upload_tmp_dir "/web/site1/tmp" php_admin_value session.save_path "/web/site1/tmp" </VirtualHost>
debian:~# a2ensite site1
debian:~# /etc/init.d/apache2 reload
# file: /etc/php5/apacge2/php.ini [ ] ++ sendmail_path = /usr/sbin/exim4 -t
debian:~# dpkg-reconfigure exim4-config
debian:~# apt-get install vsftpd
# file:/etc/vsftpd.conf listen=YES # anonymous_enable=NO # FTP local_enable=YES # write_enable=YES dirmessage_enable=YES xferlog_enable=YES connect_from_port_20=YES ascii_upload_enable=YES ascii_download_enable=YES ftpd_banner=Welcome to our FTP service. # "" chroot_local_user=YES secure_chroot_dir=/var/run/vsftpd pam_service_name=vsftpd rsa_cert_file=/etc/ssl/certs/vsftpd.pem
debian:~# /etc/init.d/vsftpd reload
debian:~# apt-get install mysql-server phpmyadmin
debian:~# echo "CREATE USER 'site1'@'localhost' IDENTIFIED BY '___site1'; GRANT USAGE ON * . * TO 'site1'@'localhost' IDENTIFIED BY '___site1' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0; CREATE DATABASE IF NOT EXISTS site1 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; ; GRANT ALL PRIVILEGES ON site1 . * TO 'site1'@'localhost';" | mysql --user=root --password=_mysqlroot mysql
debian:~# apt-get install postgressql phppgadmin
debian:~# echo "\password" | sudo -u postgres psql Enter new password: __postgres Enter it again: __postgres
#file /etc/postgresql/8.3/main/pg_hba.conf -- local all postgres ident sameuser -- local all all ident sameuser ++ local all postgres md5 ++ local all postgres md5
order deny,allow deny from all allow from 127.0.0.0/255.0.0.0 ::1/128 # allow from all
order deny,allow deny from all allow from 127.0.0.0/255.0.0.0 ::1/128 # allow from all
debian:~# /etc/init.d/apache2 reload
# file:/etc/phppgadmin/config.inc.php -- $conf['owned_only'] = false; ++ $conf['owned_only'] = true;
debian:~# echo "CREATE USER site1 WITH PASSWORD '___site1' NOCREATEDB NOINHERIT NOCREATEUSER ; CREATE DATABASE site1 owner site1;" | sudo -u postgres psql
debian:~# apt-get install arno-iptables-firewall * Do you want to manage the firewall setup with debconf? : * External network interfaces: eth0 * Open external TCP-portrs: 21 22 53 80 443 3128 5432 5001 5900 6881:6889 * Open external UDP-portrs: 53 3130 5001 6881:6889 * Internal network interfaces: < > * firewall'.
debian:~# apt-get install libapache2-mod-chroot debian:~# a2enmod mod_chroot debian:~# /etc/init.d/apache2 restart
Source: https://habr.com/ru/post/92107/
All Articles