Categories: linuxubuntu

Basic Server Setup Ubuntu 14.04 LTS in OpenVZ

apt-get update && apt-get upgrade
apt-get dist-upgrade

apt-get install bash-completion htop iftop mc nano aptitude fail2ban


service rsyslog stop
sed -i -e 's/^\$ModLoad imklog/#\$ModLoad imklog/g' /etc/rsyslog.conf
service rsyslog start
 

echo 'deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib' >> /etc/apt/sources.list
wget http://www.webmin.com/jcameron-key.asc
apt-key add jcameron-key.asc
rm jcameron-key.asc
apt-get update
 
apt-get install webmin usermin portsentry logcheck

Неиспользуемые модули >Системный журнал>Настройка модуля

Путь к файлу конфигурации системного журнала > /etc/syslog.conf

Включаем SFTP, ниже готовый файл /etc/ssh/sshd_config

# What ports, IPs and protocols we listen for
Port 22222
# 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
HostKey /etc/ssh/ssh_host_ecdsa_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 /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
GatewayPorts no
AllowTcpForwarding yes
KeepAlive yes

service ssh restart

Transmission

apt-get install transmission-daemon

config in ~/.config/transmission-daemon/settings.json

{
 "alt-speed-down": 50, 
 "alt-speed-enabled": false, 
 "alt-speed-time-begin": 540, 
 "alt-speed-time-day": 127, 
 "alt-speed-time-enabled": false, 
 "alt-speed-time-end": 1020, 
 "alt-speed-up": 50, 
 "bind-address-ipv4": "0.0.0.0", 
 "bind-address-ipv6": "::", 
 "blocklist-enabled": false, 
 "blocklist-url": "http://www.example.com/blocklist", 
 "cache-size-mb": 4, 
 "dht-enabled": true, 
 "download-dir": "/home/downloads", 
 "download-queue-enabled": true, 
 "download-queue-size": 5, 
 "encryption": 1, 
 "idle-seeding-limit": 30, 
 "idle-seeding-limit-enabled": false, 
 "incomplete-dir": "/root/downloads", 
 "incomplete-dir-enabled": false, 
 "lpd-enabled": true, 
 "message-level": 1, 
 "peer-congestion-algorithm": "", 
 "peer-id-ttl-hours": 6,
 "peer-limit-global": 450, 
 "peer-limit-per-torrent": 120, 
 "peer-port": 60597, 
 "peer-port-random-high": 65535, 
 "peer-port-random-low": 49152, 
 "peer-port-random-on-start": true, 
 "peer-socket-tos": "default", 
 "pex-enabled": true, 
 "port-forwarding-enabled": true, 
 "preallocation": 1, 
 "prefetch-enabled": 1, 
 "queue-stalled-enabled": true, 
 "queue-stalled-minutes": 30, 
 "ratio-limit": 2, 
 "ratio-limit-enabled": false, 
 "rename-partial-files": true, 
 "rpc-authentication-required": true, 
 "rpc-bind-address": "0.0.0.0", 
 "rpc-enabled": true, 
 "rpc-password": "{13575fb0fd849a44f7a2d1350d21f1bb8c7c84b0zX6vUke4", 
 "rpc-port": 9091, 
 "rpc-url": "/transmission/", 
 "rpc-username": "1", 
 "rpc-whitelist": "0.0.0.0", 
 "rpc-whitelist-enabled": false, 
 "scrape-paused-torrents-enabled": true, 
 "script-torrent-done-enabled": false, 
 "script-torrent-done-filename": "", 
 "seed-queue-enabled": false, 
 "seed-queue-size": 10, 
 "speed-limit-down": 100, 
 "speed-limit-down-enabled": false, 
 "speed-limit-up": 100, 
 "speed-limit-up-enabled": false, 
 "start-added-torrents": false, 
 "trash-original-torrent-files": false, 
 "umask": 18, 
 "upload-slots-per-torrent": 14, 
 "utp-enabled": true
}
admin

Recent Posts

How to back up and restore the ESXi host configuration

Original https://kb.vmware.com/s/article/2042141 Backing up ESXi host configuration data To synchronize the configuration changed with persistent…

11 месяцев ago

vCenter Converter Standalone download

vCenter Converter Standalone 6.6.0 download (далее…)

12 месяцев ago

VMware remote console (VMRC) 12 download

VMware remote console (VMRC) 12.0.5 download Last version: VMware Remote Console 12.0.5  28 NOV 2023…

2 года ago

Mysql calculate row size for all tables

SELECT col_sizes.TABLE_SCHEMA, col_sizes.TABLE_NAME, SUM(col_sizes.col_size) AS EST_MAX_ROW_SIZE FROM ( SELECT cols.TABLE_SCHEMA, cols.TABLE_NAME, cols.COLUMN_NAME, CASE cols.DATA_TYPE WHEN…

2 года ago

Mysql change date format in database

UPDATE DB SET column = DATE(STR_TO_DATE(column, '%Y-%d-%m')) WHERE DATE(STR_TO_DATE(column, '%d-%m-%Y')) <> '0000-00-00'

2 года ago

esxi debian lvm extend partition

echo 1 > /sys/class/block/sda/device/rescan #maybe run under root> sudo fdisk /dev/sda2 > d > 2…

2 года ago