strutture:lnf:dr:calcolo:sistemi:ubuntu_16.04_template
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| strutture:lnf:dr:calcolo:sistemi:ubuntu_16.04_template [2016/11/29 17:12] – [Tivoli Storage Manager e configurazione backup] tota@infn.it | strutture:lnf:dr:calcolo:sistemi:ubuntu_16.04_template [2017/10/31 14:51] (current) – [Script di setup hostname] dmaselli@infn.it | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ===== Ubuntu 16.04 Template ===== | ||
| + | |||
| + | ==== Rimozione dummy user ==== | ||
| + | |||
| + | Ubuntu 16.04 non offre di default la possibilità di effettuare l' | ||
| + | |||
| + | Creiamo una password per l' | ||
| + | |||
| + | < | ||
| + | # sudo -i | ||
| + | # passwd | ||
| + | </ | ||
| + | |||
| + | Abilitiamo l' | ||
| + | |||
| + | < | ||
| + | PermitRootLogin yes | ||
| + | </ | ||
| + | |||
| + | Quindi riavviamo il servizio sshd | ||
| + | |||
| + | < | ||
| + | # systemctl restart sshd | ||
| + | </ | ||
| + | |||
| + | A questo punto possiamo eliminare l' | ||
| + | |||
| + | < | ||
| + | # userdel -r [dummy user] | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Rigenerazione chiavi SSH al boot ==== | ||
| + | |||
| + | Aggiungere nel file / | ||
| + | < | ||
| + | echo [ -f / | ||
| + | </ | ||
| + | |||
| + | ==== Script di setup hostname ==== | ||
| + | |||
| + | < | ||
| + | cat > / | ||
| + | #!/bin/sh | ||
| + | |||
| + | if [ " | ||
| + | && | ||
| + | then | ||
| + | return | ||
| + | fi | ||
| + | |||
| + | hostname " | ||
| + | |||
| + | echo -n " | ||
| + | |||
| + | HOSTS='/ | ||
| + | TARGET_KEY=' | ||
| + | |||
| + | sed -i " | ||
| + | EOT | ||
| + | |||
| + | </ | ||
| + | |||
| + | ==== Data e ora ==== | ||
| + | |||
| + | Installare il servizio NTP: | ||
| + | < | ||
| + | | ||
| + | Controllare che in ''/ | ||
| + | < | ||
| + | server ntp1.lnf.infn.it iburst | ||
| + | server ntp2.lnf.infn.it iburst | ||
| + | server ntp3.lnf.infn.it iburst | ||
| + | </ | ||
| + | | ||
| + | Abilitare la sincronizzazione: | ||
| + | < | ||
| + | | ||
| + | ==== Mail ==== | ||
| + | |||
| + | Installiamo il pacchetto '' | ||
| + | < | ||
| + | |||
| + | Durante il processo di installazione inseriamo le seguenti impostazioni: | ||
| + | |||
| + | < | ||
| + | General type of mail configuration: | ||
| + | System mail name: lnf.infn.it | ||
| + | Relay host: smtp.lnf.infn.it | ||
| + | </ | ||
| + | |||
| + | Modifichiamo nel file main.cf di postfix ('' | ||
| + | |||
| + | < | ||
| + | #myhostname | ||
| + | mydomain = lnf.infn.it | ||
| + | mydestination = $myhostname, | ||
| + | relayhost = [smtp.lnf.infn.it] | ||
| + | </ | ||
| + | |||
| + | ==== Kerberos ==== | ||
| + | |||
| + | Installiamo i pacchetti per il client Kerberos | ||
| + | |||
| + | < | ||
| + | |||
| + | Editiamo il file di configurazione ''/ | ||
| + | |||
| + | < | ||
| + | [libdefaults] | ||
| + | default_realm = LNF.INFN.IT | ||
| + | |||
| + | [domain_realm] | ||
| + | .lnf.infn.it = LNF.INFN.IT | ||
| + | lnf.infn.it | ||
| + | |||
| + | [realms] | ||
| + | LNF.INFN.IT = { | ||
| + | kdc = kdc5s3.lnf.infn.it: | ||
| + | kdc = kdc5s2.lnf.infn.it: | ||
| + | kdc = kdc5s1.lnf.infn.it: | ||
| + | kdc = kdc5s0.lnf.infn.it: | ||
| + | kdc = kdc5p.lnf.infn.it: | ||
| + | admin_server = kdc5p.lnf.infn.it: | ||
| + | default_domain = lnf.infn.it | ||
| + | } | ||
| + | INFN.IT = { | ||
| + | kdc = k5.infn.it: | ||
| + | kdc = afscnaf.infn.it: | ||
| + | kdc = afsrm1.roma1.infn.it: | ||
| + | kdc = afsna.na.infn.it: | ||
| + | admin_server = k5.infn.it: | ||
| + | default_domain = infn.it | ||
| + | } | ||
| + | |||
| + | [appdefaults] | ||
| + | |||
| + | aklog_homedir = true | ||
| + | |||
| + | pam-afs-session = { | ||
| + | minimum_uid = 1000 | ||
| + | ignore_root = true | ||
| + | debug = true | ||
| + | } | ||
| + | |||
| + | pam = { | ||
| + | minimum_uid = 1000 | ||
| + | ticket_lifetime = 259200 # 86400 | ||
| + | renew_lifetime = 604800 | ||
| + | forwardable = true | ||
| + | krb4_convert = false | ||
| + | ccache_dir = /tmp | ||
| + | tokens = true | ||
| + | krb4_convert_524 = false | ||
| + | krb4_use_as_req = false | ||
| + | #afs_cells = lnf.infn.it=afs@LNF.INFN.IT | ||
| + | afs_cells = lnf.infn.it=afs/ | ||
| + | # | ||
| + | validate = true | ||
| + | #validate = false | ||
| + | keytab = FILE:/ | ||
| + | debug = false | ||
| + | #debug = true | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== OpenAFS ==== | ||
| + | |||
| + | Installiamo i seguenti pacchetti confermando, | ||
| + | |||
| + | < | ||
| + | |||
| + | Modifichiamo il file '' | ||
| + | < | ||
| + | |||
| + | e il file '' | ||
| + | < | ||
| + | |||
| + | Riavviamo quindi '' | ||
| + | |||
| + | < | ||
| + | # systemctl stop openafs-client | ||
| + | # systemctl start openafs-client | ||
| + | # systemctl status openafs-client | ||
| + | </ | ||
| + | ==== Abilitare gli aggiornamenti automatici di sicurezza ==== | ||
| + | |||
| + | Verifichiamo che in ''/ | ||
| + | |||
| + | < | ||
| + | Unattended-Upgrade:: | ||
| + | " | ||
| + | }; | ||
| + | </ | ||
| + | |||
| + | Per abilitare gli aggiornamenti automatici, modificare ''/ | ||
| + | |||
| + | < | ||
| + | APT:: | ||
| + | APT:: | ||
| + | APT:: | ||
| + | APT:: | ||
| + | </ | ||
| + | |||
| + | La configurazione precedente aggiorna l' | ||
| + | |||
| + | ==== Disabilitare ipv6 ==== | ||
| + | |||
| + | Aggungiamo le seguenti voci in fondo al file ''/ | ||
| + | < | ||
| + | net.ipv6.conf.all.disable_ipv6 = 1 | ||
| + | net.ipv6.conf.default.disable_ipv6 = 1 | ||
| + | net.ipv6.conf.lo.disable_ipv6 = 1 | ||
| + | </ | ||
| + | |||
| + | Rendiamo effettive le modifiche eseguendo il comando: | ||
| + | |||
| + | < | ||
| + | |||
| + | Inseriamo la voce '' | ||
| + | |||
| + | < | ||
| + | |||
| + | Quindi riavviamo '' | ||
| + | |||
| + | Infine modifichiamo la voce '' | ||
| + | |||
| + | < | ||
| + | inet_interfaces = 127.0.0.1 | ||
| + | </ | ||
| + | ==== oVirt agent ==== | ||
| + | |||
| + | Installiamo il pacchetto relativo ai guest agent di oVirt | ||
| + | |||
| + | < | ||
| + | |||
| + | Modifichiamo il proprietario della directory ''/ | ||
| + | |||
| + | < | ||
| + | # chown ovirtagent: | ||
| + | </ | ||
| + | |||
| + | Eseguiamo i seguenti comandi per avviare il servizio e abilitarlo al boot: | ||
| + | |||
| + | < | ||
| + | # systemctl enable ovirt-guest-agent.service | ||
| + | # systemctl start ovirt-guest-agent.service | ||
| + | </ | ||
| + | |||
| + | ==== check-mk agent ==== | ||
| + | |||
| + | Installiamo i pacchetti '' | ||
| + | |||
| + | < | ||
| + | |||
| + | Modifichiamo il file ''/ | ||
| + | |||
| + | < | ||
| + | only_from = 127.0.0.1 193.206.84.50 | ||
| + | </ | ||
| + | |||
| + | Riavviamo il servizio '' | ||
| + | |||
| + | < | ||
| + | # systemctl restart xinetd.service | ||
| + | </ | ||
| + | |||
| + | ==== Log alert script ==== | ||
| + | |||
| + | Modifichiamo il file ''/ | ||
| + | |||
| + | < | ||
| + | # Custom hourly warning mail | ||
| + | *.warning | ||
| + | |||
| + | # Send all logs to logsrv.lnf.infn.it | ||
| + | *.* | ||
| + | </ | ||
| + | |||
| + | Creiamo la directory ''/ | ||
| + | |||
| + | < | ||
| + | |||
| + | Copiamo nella directory appena create gli script: | ||
| + | |||
| + | * z-send.warnings | ||
| + | * summarize | ||
| + | |||
| + | Creiamo il file '' | ||
| + | |||
| + | < | ||
| + | |||
| + | Creiamo un link simbolico dallo script '' | ||
| + | |||
| + | < | ||
| + | |||
| + | Infine riavviamo il servizio '' | ||
| + | |||
| + | < | ||
| + | ==== Tivoli Storage Manager e configurazione backup ==== | ||
| + | |||
| + | Scarichiamo la versione client di Tivoli Storage Manager | ||
| + | |||
| + | < | ||
| + | |||
| + | Estraiamo il contenuto: | ||
| + | |||
| + | < | ||
| + | # tar -xf 6.4.3.4-TIV-TSMBAC-LinuxX86.tar | ||
| + | </ | ||
| + | |||
| + | Istalliamo il tool di conversione '' | ||
| + | < | ||
| + | |||
| + | Questo tool consente di convertire i pacchetti Linux RPM in pacchetti Ubuntu Debian. | ||
| + | |||
| + | < | ||
| + | # alien -k --scripts gskcrypt64-8.0.14.53.linux.x86_64.rpm | ||
| + | # alien -k --scripts gskssl64-8.0.14.53.linux.x86_64.rpm | ||
| + | # alien -k --scripts TIVsm-API64.x86_64.rpm | ||
| + | # alien -k --scripts TIVsm-BA.x86_64.rpm | ||
| + | </ | ||
| + | |||
| + | Lanciamo l' | ||
| + | |||
| + | < | ||
| + | # dpkg -i tivsm-api64_6.4.3-4_amd64.deb tivsm-ba_6.4.3-4_amd64.deb gskcrypt64_8.0-14.53_amd64.deb gskssl64_8.0-14.53_amd64.deb | ||
| + | </ | ||
| + | |||
| + | Creiamo i seguenti link simbolici: | ||
| + | < | ||
| + | # ln -s / | ||
| + | # ln -s / | ||
| + | # ln -s / | ||
| + | # ln -s / | ||
| + | # ln -s / | ||
| + | # ln -s / | ||
| + | </ | ||
| + | |||
| + | Modifichiamo il file ''/ | ||
| + | |||
| + | < | ||
| + | ************************************************************************ | ||
| + | * Tivoli Storage Manager | ||
| + | * * | ||
| + | * Sample Client System Options file for UNIX (dsm.sys.smp) | ||
| + | ************************************************************************ | ||
| + | |||
| + | * This file contains the minimum options required to get started | ||
| + | * using TSM. Copy dsm.sys.smp to dsm.sys. | ||
| + | * enter the appropriate values for each option listed below and | ||
| + | * remove the leading asterisk (*) for each one. | ||
| + | |||
| + | * If your client node communicates with multiple TSM servers, be | ||
| + | * sure to add a stanza, beginning with the SERVERNAME option, for | ||
| + | * each additional server. | ||
| + | |||
| + | ************************************************************************ | ||
| + | |||
| + | servername | ||
| + | commmethod | ||
| + | tcpport | ||
| + | tcpserveraddress | ||
| + | Inclexcl | ||
| + | passwordaccess | ||
| + | passworddir | ||
| + | nodename | ||
| + | users root | ||
| + | schedlogname | ||
| + | errorlogname | ||
| + | |||
| + | </ | ||
| + | |||
| + | Analogamente modifichiamo il file ''/ | ||
| + | |||
| + | < | ||
| + | ************************************************************************ | ||
| + | * Tivoli Storage Manager | ||
| + | * * | ||
| + | * Sample Client User Options file for UNIX (dsm.opt.smp) | ||
| + | ************************************************************************ | ||
| + | |||
| + | * This file contains an option you can use to specify the TSM | ||
| + | * server to contact if more than one is defined in your client | ||
| + | * system options file (dsm.sys). | ||
| + | * If you enter a server name for the option below, remove the | ||
| + | * leading asterisk (*). | ||
| + | |||
| + | ************************************************************************ | ||
| + | |||
| + | * SErvername | ||
| + | servername tsm01 | ||
| + | compressalways no | ||
| + | |||
| + | </ | ||
| + | |||
| + | Modifichiamo lo scheduler in ''/ | ||
| + | |||
| + | < | ||
| + | [Unit] | ||
| + | Description=Tivoli Storage Manager Client Scheduler | ||
| + | After=network.target | ||
| + | |||
| + | [Service] | ||
| + | ExecStart=/ | ||
| + | StandardOutput=null | ||
| + | StandardError=journal | ||
| + | KillMode=process | ||
| + | Restart=always | ||
| + | RestartSec=10m | ||
| + | |||
| + | [Install] | ||
| + | WantedBy=multi-user.target | ||
| + | |||
| + | </ | ||
| + | ==== Templetize script ==== | ||
| + | |||
| + | Configurati tutti i servizi precedenti è necessario eseguire il seguente script per ripulire la macchina da tutte le configurazioni non necessarie: | ||
| + | |||
| + | < | ||
| + | #!/bin/bash | ||
| + | |||
| + | echo ' | ||
| + | apt-get clean | ||
| + | apt-get autoclean | ||
| + | echo ' | ||
| + | |||
| + | echo ' | ||
| + | rm -vrf / | ||
| + | echo ' | ||
| + | |||
| + | echo ' | ||
| + | sleep 10 | ||
| + | |||
| + | history -c | ||
| + | |||
| + | shutdown -h now | ||
| + | </ | ||
