jeudi 6 juin 2013

install and configure postfix/dovecot centos 6

Before install postfix, remove sendmail from the server. Because sendmail is the default MTA in Redhat/CentOS.
[root@server ~]# yum remove sendmail

Prerequisites:

  • The mail server should contain a valid MX record in the DNS server. Navigate to this link how to setup DNS server.
  • Firewall and SELinux should be disabled.
[root@server ~]# service iptables stop
[root@server ~]# service ip6tables stop
[root@server ~]# chkconfig iptables off
[root@server ~]# chkconfig ip6tables off
[root@server ~]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
Reboot the server.

Scenario

In this tutorial my test box
Hostname     = server.ostechnix.com
IP Address    = 192.168.1.200/24
And my server is configured with proper MX record in DNS server.

Installation

Postfix is installed by default. If it is not installed, use the below command to install postfix.
[root@server ~]# yum install postfix

Configuration

Open the postfix config file /etc/postfix/main.cf. Find the below lines and edit them as shown below.
[root@server ~]# vi /etc/postfix/main.cf
myhostname = server.ostechnix.com ##line no 75 - uncomment and enter your host name
mydomain = ostechnix.com  ##line no 83 - uncomment and enter your domain name 
myorigin = $mydomain  ##line no 99 - uncomment
inet_interfaces = all  ##line no 116 - change to all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain  ##line no 164 - add $domain at the end
mynetworks = 192.168.1.0/24, 127.0.0.0/8  ##line no 264 - uncomment and add your network range
home_mailbox = Maildir/  ##line no 419 - uncomment
Start the postfix service.
[root@server ~]# service postfix start
Starting postfix:                                          [  OK  ]
[root@server ~]# chkconfig postfix on

Test Postfix

The commands shown in bold letters should be entered by the user. 
Note: The dot after the test command is important.
[root@server ~]# telnet localhost smtp
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 server.ostechnix.com ESMTP Postfix
ehlo localhost
250-server.ostechnix.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from:
250 2.1.0 Ok
rcpt to:
250 2.1.5 Ok
data
354 End data with .
test
.
250 2.0.0 Ok: queued as 117113FF18
quit
221 2.0.0 Bye
Connection closed by foreign host.

Check Mail

Navigate to the user mail directory and check for the new mail.
[root@server ~]# cd /home/user1/Maildir/new/[root@server new]# ls
1360236956.Vfd00I35afM181256.server.ostechnix.com
[root@server new]# cat 1360236956.Vfd00I35afM181256.server.ostechnix.com Return-Path: 
X-Original-To: user1
Delivered-To: user1@ostechnix.com
Received: from localhost (localhost [IPv6:::1])
 by server.ostechnix.com (Postfix) with ESMTP id 117113FF18
 for ; Thu,  7 Feb 2013 17:05:32 +0530 (IST)
Message-Id: <20130207113547 .117113ff18="" server.ostechnix.com="">
Date: Thu,  7 Feb 2013 17:05:32 +0530 (IST)
From: user1@ostechnix.com
To: undisclosed-recipients:;
test
Thats it. Postfix working now.


Install Dovecot

[root@server ~]# yum install dovecot

Configure Dovecot

Open the dovecot config file /etc/dovecot/dovecot.conf. Find and uncomment the line as shown below.
[root@server ~]# vi /etc/dovecot/dovecot.conf
protocols = imap pop3 lmtp
Open the file /etc/dovecot/conf.d/10-mail.conf and uncomment the line as shown below.
[root@server ~]# vi /etc/dovecot/conf.d/10-mail.conf
mail_location = maildir:~/Maildir  ##line no 24 - uncomment
Open the /etc/dovecot/conf.d/10-auth.conf and edit as shown below.
[root@server ~]# vi /etc/dovecot/conf.d/10-auth.conf
disable_plaintext_auth = no  ##line no 9 - uncomment and change from yes to no.
auth_mechanisms = plain login  ##line no 97 - add the text "login"
Open the /etc/dovecot/conf.d/10-master.conf and edit as shown below.
unix_listener auth-userdb {
    #mode = 0600
    user = postfix  ##line no 83 - uncomment and enter postfix
    group = postfix  ##line no 84 - uncomment and enter postfix
Start the dovecot service.
[root@server ~]# service dovecot start
Starting Dovecot Imap:                                     [  OK  ]
[root@server ~]# chkconfig dovecot on 

Test Dovecot

The commands shown in bold should be entered by the user.
[root@server ~]# telnet localhost pop3
Trying ::1...
Connected to localhost.
Escape character is '^]'.
+OK Dovecot ready.
user user1
+OK
pass user1
+OK Logged in.
list
+OK 1 messages:
1 428
.
retr 1
+OK 428 octets
Return-Path: 
X-Original-To: user1
Delivered-To: user1@ostechnix.com
Received: from localhost (localhost [IPv6:::1])
 by server.ostechnix.com (Postfix) with ESMTP id 117113FF18
 for ; Thu,  7 Feb 2013 17:05:32 +0530 (IST)
Message-Id: <20130207113547 .117113ff18="" server.ostechnix.com="">
Date: Thu,  7 Feb 2013 17:05:32 +0530 (IST)
From: user1@ostechnix.com
To: undisclosed-recipients:;
test
.
quit 
+OK Logging out.
Connection closed by foreign host.
[root@server ~]# 

jeudi 10 janvier 2013

Top 30 Nmap Command Examples For Sys/Network Admins

http://www.cyberciti.biz/networking/nmap-command-examples-tutorials/

mardi 27 novembre 2012

lancer les video youtube automatiquement et en plain ecran

supposant que votre url est le suivant
http://www.youtube.com/watch?v=GsF1jnTjRLo 
modifiez le comme suit : et ajoutez &autoplay=1 a la fin
http://www.youtube.com/v/GsF1jnTjRLo&autoplay=1

integration de iframe :

mardi 3 juillet 2012

freeraduis with Dialup Admin

0 - plateform : linux centos 5.5 ip : 172.16.249.230/16

yum install freeradius

/etc/init.d/radiusd start

netstat -natup

udp        0      0 0.0.0.0:1812                0.0.0.0:*                               6149/radiusd      
udp        0      0 0.0.0.0:1813                0.0.0.0:*                               6149/radiusd      
udp        0      0 0.0.0.0:54550               0.0.0.0:*                              6149/radiusd      
udp        0      0 0.0.0.0:1814                0.0.0.0:*                               6149/radiusd           
udp        0      0 127.0.0.1:18120             0.0.0.0:*                            6149/radiusd

chkconfig radiusd on

yum install freeradius2-mysql
yum install freeradius2-utils
 
2 configuration :

2.1 - Define RADIUS clients (usually a NAS -Network Access Server-, Access Point, etc.).
/etc/raddb/clients.conf

2.2 - Define a user :
/etc/raddb/users
testing Cleartext-Password := "password"

2.3 test locally
#radiusd -X  ( radiusd mast be stopped ) (you mast have this message)
Ready to process requests.


#radtest testing password localhost 0 testing123  (this message)
rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=189, length=20


explication :
testing : name of user
password : his pass
testing123 : the secret of the client localhost


3 test from network with windows machine (172.16.249.218) :

3.1 add  the client windows to radius server file : /etc/raddb/clients.conf

client 172.16.249.218 {
  ipaddr = 172.16.249.218
  secret = SECRET
}


3.2 install "ntradping"

download from http://www.mastersoft-usa.com/download/









vendredi 29 juin 2012

Problème activé et avoir le droit d'administrateur Windows 7

1 - Redémarrez en mode sans échec en appuyant sur F5 ou F8


2 - allez a "panneau de configuration -> outils d'administration -> gestion de l'ordinateur"


3 - dans la partie "utilisateurs et groups locaux -> utilisateurs"  propriété de l'administrateur 


 4 - découchez "compte désactivé"


 5 - redémarrez pour avoir l'accès en mode "administrateur"