mercoledì 20 maggio 2009

Gestione Repository CentOS

DAG o RPMGORDE

Aggiungere la chiave
wget http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm --import RPM-GPG-KEY.dag.txt

Aggiungere il repository
I386
Scaricare pacchetto:
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2.2.el5.rf.i386.rpm
Verifica file:
rpm -K rpmforge-release-0.5.2.2.el5.rf.i386.rpm
Installa Repo:
rpm -ivh rpmforge-release-0.5.2.2.el5.rf.i386.rpm

x86_64
Scaricare pacchetto:
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2.2.el5.rf.x86_64.rpm
Verifica file:
rpm -K rpmforge-release-0.5.2.2.el5.rf.x86_64.rpm
Installa Repo:
rpm -ivh rpmforge-release-0.5.2.2.el5.rf.x86_64.rpm


SAMBA ENTERPRISE

Installare la chiave

wget http://ftp.sernet.de/pub/sernet-build-key-1.0-1.noarch.rpm
rpm -ivh  sernet-build-key-1.0-1.noarch.rpm

Aggiungere il repository
cd /etc/yum.repos.d
wget http://ftp.sernet.de/pub/samba/tested/centos/5/sernet-samba.repo

UTILIZZO DEI REPO

Per cercare/installare pacchetti da repository disabilitati aggiungere il seguente parametro: --enablerepo
Esempio: --enablerepo=dag

lunedì 11 maggio 2009

Pulire Cache Windows Update

Per poter liberare un pò di spazio dal disco in windows è consigliato ognitanto fare un pò di pulizia nella cache di windows update (aggiornamenti di windows).

L'operazione è abbastanza semplice:

Per Windows XP/Vista/2003

  1. Fermare il servizio windows update
    1. Avvio --> Esegui --> Cmd
    2. net stop wuauserv
  2. Cancellare tutti i file della Cache
    1. Avvio --> Esegui --> Cmd
    2. cd c:\windows (oppure cd %windir%)
    3. rd /s SoftwareDistribution
    4. y
  3. Avviare il servizio di windows update
    1. Avvio --> Esegui --> Cmd
    2. net start wuauserv
E il gioco è fatto.

Prima del punto 3 è consigliabile fare una defframmentazione del disco.

venerdì 24 aprile 2009

Ubuntu Client in Samba Domain

Questi sono i passi che ho fatto per mettere una workstation Ubuntu 9.04 in un dominio Windows gestito da Samba. Pacchetti da installare: winbind samba samba-common libpam-mount smbfs File da modificare: /etc/pam.d/common-account:
account sufficient pam_winbind.so
/etc/pam.d/common-auth
#auth required pam_cups.so debug
auth required pam_mount.so use_first_pass
auth sufficient pam_winbind.so use_first_pass
auth required pam_unix.so nullok_secure use_first_pass
/etc/pam.d/common-session
session required pam_unix.so nullok_secure
session required pam_mkhomedir.so skel=/etc/skel/ umask=0022
#session optional pam_cups.so debug min_uid=1000
session optional pam_mount.so
/etc/pam.d/common-password
password sufficient pam_winbind.so
password required pam_unix.so nullok obscure min=4 max=8 md5
/etc/security/pam_mount.conf.xml

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE pam_mount SYSTEM "pam_mount.conf.xml.dtd">
<pam_mount>

<debug enable="0" />

<luserconf name=".pam_mount.conf.xml" />

<mntoptions allow="nosuid,nodev,loop,encryption,fsck,nonempty,allow_root,allow_other" />
<mntoptions require="nosuid,nodev" />
<path>/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin</path>

<msg-authpw>password:</msg-authpw>
<msg-sessionpw>reenter password:</msg-sessionpw>

<logout wait="0" hup="0" term="0" kill="0" />

<mkmountpoint enable="1" remove="true" />

</pam_mount>
/etc/samba/smb.conf
workgroup = DOMAIN
server string = %h
security = domain
encrypt passwords = true
wins server = xxx.xxx.xxx.xxx
password server = *
domain master = false
preferred master = false
local master = no
lm announce = false
hosts allow = xxx.xxx.xxx.xxx, 127.0.0.1
hosts deny = all
socket options = TCP_NODELAY IPTOS_LOWDELAY
log file = /var/log/samba/log.%U
log level = 2
pam password change = yes
interfaces = eth0, lo
winbind uid = 1000-10000
winbind gid = 1000-10000
winbind enum users = yes
winbind enum groups = yes
winbind use default domain = yes
winbind cache time = 15
template shell = /bin/bash
template homedir = /home/%U
/etc/nsswitch.conf
passwd:         compat winbind
group:          compat winbind
shadow:         compat
Dopo aver modificato i file riavviare samba e winbind. Effettuare il join nel dominio: net rpc join -S serverpdc -U root Effettuare una verifica wbinfo -u wbinfo -g Dovrebbero venire visualizzati tutti gli utenti e i gruppi del dominio. Ora non rimane che configurare pam_mount per montare le cartelle degli utenti al login. Io ho impostato che venga caricato un file di configurazione di pam_mount diverso per ogni utente, il file si deve trovare nella home dell'utente e si deve chiamare .pam_mount.conf.xml. Questo nome lo si può cambiare modificando nel file /etc/security/pam_mount.conf.xml il parametro <luserconf name=".pam_mount.conf.xml"></luserconf> Questo è un esempio del file .pam_mount.conf.xml:

<pam_mount>
<volume fstype="smbfs" server="doaminserver" path="folder1" mountpoint="~/Server/folder1" />
<volume fstype="smbfs" server="domainserver" path="folder2" mountpoint="~/Server/folder2" />
<volume fstype="smbfs" server="domainserver" path="%(USER)" mountpoint="~/Server/%(USER)" />
</pam_mount>
Dove path è la cartella condivisa sul server, mountpoint è dove verrà montata la cartella. Riavviare il client e il gioco è fatto. Problemi D. Il comando su con utente di dominio non funziona.. R. Ho risolto modificando il file sudouser (visudo) aggiungendo gli utenti hai quali voglio abilitare il comando su. Fonti: http://foss.stat.unipd.it/mediawiki/index.php/Debian_Client_in_a_Samba_Domain http://tech.canterburyschool.org/tech/UbuntuWorkstations/AuthenticationSetup

giovedì 26 febbraio 2009

Shortcuts di Bash

Navigando in internet ho trovato questo elenco di tasti rapidi da utilizzare con bash:

____________CTRL Key Bound_____________
Ctrl + a - Jump to the start of the line
Ctrl + b - Move back a char
Ctrl + c - Terminate the command
Ctrl + d - Delete from under the cursor
Ctrl + e - Jump to the end of the line
Ctrl + f - Move forward a char
Ctrl + k - Delete to EOL
Ctrl + l - Clear the screen
Ctrl + r - Search the history backwards
Ctrl + R - Search the history backwards with multi occurrence
Ctrl + u - Delete backward from cursor
Ctrl + xx - Move between EOL and current cursor position
Ctrl + x @ - Show possible hostname completions
Ctrl + z - Suspend/ Stop the command

____________ALT Key Bound___________
Alt + < - Move to the first line in the history
Alt + > - Move to the last line in the history
Alt + ? - Show current completion list
Alt + * - Insert all possible completions
Alt + / - Attempt to complete filename
Alt + . - Yank last argument to previous command
Alt + b - Move backward
Alt + c - Capitalize the word
Alt + d - Delete word
Alt + f - Move forward
Alt + l - Make word lowercase
Alt + n - Search the history forwards non-incremental
Alt + p - Search the history backwards non-incremental
Alt + r - Recall command
Alt + t - Move words around
Alt + u - Make word uppercase
Alt + back-space - Delete backward from cursor

----------------More Special Keybindings-------------------

Here "2T" means Press TAB twice

$ 2T - All available commands(common)
$ (string)2T - All available commands starting with (string)
$ /2T - Entire directory structure including Hidden one
$ 2T - Only Sub Dirs inside including Hidden one
$ *2T - Only Sub Dirs inside without Hidden one
$ ~2T - All Present Users on system from "/etc/passwd"
$ $2T - All Sys variables
$ @2T - Entries from "/etc/hosts"
$ =2T - Output like ls or dir


Fonte: http://linuxhelp.blogspot.com/2005/08/bash-shell-shortcuts.html

martedì 11 novembre 2008

chmod e umask

  • chmod 777 is the same as umask=000 (or rwx)
  • chmod 666 is the same as umask=111 (or rw-)
  • chmod 555 is the same as umask=222 (or r-x)
  • chmod 444 is the same as umask=333 (or r--)
  • chmod 333 is the same as umask=444 (or -wx)
  • chmod 222 is the same as umask=555 (or -w-)
  • chmod 111 is the same as umask=666 (or --x)
  • chmod 000 is the same as umask=777 (or ---)

lunedì 10 novembre 2008

Gestione cache dns windows xp/vista

Per svuotare la cache dns in windows XP/Vista bisogna lanciare da linea di comando il seguente comando:

ipconfig /flushdns

in Vista, se è attivo l'UAC, bisogna aprire una shell comandi con diritti di amministratore.

Con ipconfig /displaydns visualizziamo tutta la cache.

lunedì 8 settembre 2008

Modifica dimensione massima del profilo

In windows xp/2000/2003/vista è possibile impostare una dimensione massima per i profili degli utenti.

Di default il valore massimo che può assumere un profilo è di 30000 Kb (30 Mb), per aumentare questo limite bisogna modificare il file System.adm che si trova in %SystemRoot%\Winnt\Inf.

E' possibile aprilo con un semplice editor di testi, poi bisogna cercare la sezione

VALUENAME "MaxProfileSize"

E cambiare il parametro MAX.

Salvare il documento e poi dall'editor dei criteri dei gruppi locali sotto la voce:

Configurazione Utente --> Modelli Amministrativi --> Sistema --> Profili Utente --> Limita Dimensione Profilo è possibile abilitare il controllo della dimensione del profilo degli utenti.

giovedì 12 giugno 2008

Firewall Layer 7

Navigando in internet ho trovato questa interessante guida su come configurare un firewall Layer 7 su una Debian Etch.

Debian con Layer 7

Questo invece è il sito del progetto Layer 7:

http://l7-filter.sourceforge.net/

Per saperne di può invece sui livelli del protocollo TCP/IP si può dare un'occhiata qui:

http://it.wikipedia.org/wiki/Open_Systems_Interconnection