Jumat, 06 Desember 2013

Kisi-kisi Di Windows Server

1.Mengubah Password:
net user User_name New_password

2.Melihat ketersediaan User:
net user

3.Delete User
net user User_Name /delete

4.Add ke Group
net group  Name_group User_Neme /add

Sabtu, 26 Oktober 2013

% No password set

 Telnet adalah protokol tingkat aplikasi yang memungkinkan perangkat jaringan untuk berkomunikasi jarak jauh. Ini banyak digunakan oleh administrator jaringan untuk mengkonfigurasi dan troubleshooting perangkat jaringan seperti router dan switch.

Terkadang apabila kita ingin telnet ke router atau switch di cisco megalami tidak bisa masuknya Privileged exec mode % No password set atau
Switch>en
% No password set.
Switch>


Hal tersebut dikarenakan tidak adanya izin untuk masuk ke exec mode. Ada 2 Cara untuk masuk ke telnet yaitu 
1.Dengan memberi tingkat level (Privilege Level) contoh :
Switch>en 
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
 
Switch(config)#line vty 0 4 
Switch(config-line)#privilege level 15 
Switch(config-line)#end 
Switch#
Dan apabila sudah diberikan tingkat hak akses maka seharusnya sudah tidak akan tampil % No password set. perlu diketahui tingkat level mulai dari 0-15, tingak level 15(administrator atau super user) adalah tingkat tertinggi dalam cisco atau sama dengan device aslinya atau console. contoh berhasil masuk lewat telnet.
Switch>telnet 192.168.24.254
Trying 192.168.24.254 ... Open


User Access Verification

Password:
Switch#en
Switch#



2.Dengan Memberi the Local Authentication Database.
Buatlah UserName Beserta HakAkses tingkatlevel password. contoh
Switch(config)# username admin priv 15 password cisco
Setelah itu Pengaktifan Line dengan menggunakan database Otentikasi Lokal
Switch(config-line)#line vty 0 4
Switch(config-line)#login local
Switch(config-line)#^z
Switch#
Untuk Memberikan UserName dan Password via Console sama saja.Bedanya hanya tinggal mengganti line con 0
Switch(config-line)#line con 0
Switch(config-line)#login local
Switch(config-line)#^z
Switch#
Lalu melakukan pengujian baik dari telnet maupun console, dengan ketik exit. jika sudah login sesuai username yang dibuat lalu ketikan sho priv maka anda bisa melihat tingkat level.
Switch#show priv
Current privilege  level is 15




 

 

Rabu, 09 Oktober 2013

Perintah Dasar Linux

Mengahapus Direktori
==========================
1. jika ingin mengahpus hanya 1 direktori/folder menggunakan rmdir atau rm.
[root@localhost ~]#rmdir gallery

2. jika ingin menghapus folder beserta isi di dalamnya. menemabahkan perintah -r. apabila tidak menginkan tampil sebuah pernyataan bisa menambkan -f jadi rm -rf.
[root@localhost ~]#rm -rf gallery

3.Change Password For Other User Account, reset password user dari root. anda harus login menggunakan root. Di bawah saya ingin mereset password user dengan nama userweb.
[root@localhost ~]#passwd namauser
Changing password for user userweb.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@localhost ~]#

4.Set or Change User Password,reset password root atau reset password user.
[root@localhost ~]#passwd
 Changing password for root
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

5.Change Group Password, mengganti password group. passwd -g adalah perintah untuk mengganti password group. contoh nama group adalah it.
[root@localhost ~]#passwd -g it

6. Menghidupkan NTPD
[root@localhost ~]#chkconfig ntpd on
[root@localhost ~]#service ntpd start

Sabtu, 05 Oktober 2013

Mounting

1. Create Directory cth direktori flashdisk
mkdir -p /mnt/flashdisk

2. Cek Keberadaan partisi
fdisk -l
cth output :
Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14       38913   312464250   8e  Linux LVM

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1      121601   976760001    7  HPFS/NTFS

3. Lakukan mount dari direktori /dev/sdb1 ke /mnt/flashdisk
 mount /dev/sdb1 /mnt/flashdisk/

4. Lakukan copy pada direktori yang di inginkan, skema /var/www/html dst
cth: saat ini posisi berada di /var dan kita ingin copy keseluruhan dari www/html dan seterusnya
 cp -Rf www/ /mnt/flashdisk/

5. setelah selesai copy di cek apakah space yang di copy di derektori flasdisk sama atau tidak dengan  direktori www
ls -lah atau du - lsh namadirektori

Selasa, 10 September 2013

Clear Cache Squid

1. Matikan Proses squid yang berjalan
  root#/etc/init.d/squid stop

2.Membersihkan semua swap directory cache squid
  root#rm -rf /cache/*
  jika ada banyak folder cache maka lanjutkan 
  root#rm -rf /cache1/*

3.Membuat/buil kembali directory swap cache squid 
  root#squid -z

4.Menjalankan kembali squid proxy server 
  root#/etc/init.d/squid start

Menghapus cache squid proxy secara otomatis
Jika anda ingin menghapus cache squid proxy secara otomatis berikut langkahnya:
1. Buat sebuat script yang akan digunakan untuk memeriksa dan menghapus cache     squid proxy secara otomatis 

  root#touch /root/clear-cache-squid.sh
  root#vim /root/clear-cache-squid.sh
2. Masukkan kode berikut, dimana dalam kode berikut pengaturan Hardisk squid proxy sebesar 80GB, direktory cache squid berada pada /cache dan script akan diletakkan pada /root 

#!/bin/bash
#!/bin/bash
 
# direktori cache proxy
CACHEDIR=/cache
 
# kapasitas direktori cache proxy (80GB)
CACHEDIRSIZE=85899345920
ONEMB=1048576
ONEGB=1073741824
COUNTMB=`expr $CACHEDIRSIZE / $ONEMB`
COUNTGB=`expr $CACHEDIRSIZE / $ONEGB`
 
COUNTALOC=`expr $CACHEDIRSIZE / $ONEMB`
 
# mendapatkan besaran direktori cache saat ini
SIZE=`du -bc $CACHEDIR | grep total | awk '{print $1}'`
SIZEM=`du -bch $CACHEDIR | grep total | awk '{print $1}'`
 
 
# jika besaran direktori cache saat ini sama atau lebih besar dari
# kapasitas direktori cache proxy maka hapus cache proxy
if [ $SIZE -ge $CACHEDIRSIZE ]
then
 
/usr/bin/clear
echo "=================================="
echo "=== Generate Clear Cache Squid ==="
echo "=================================="
 
echo "Cahce Squid Proxy      :" $CACHEDIR
echo "Jumlah cache tersimpan :" $SIZE Byte / $SIZEM
echo "Batas maximum cache    :" $CACHEDIRSIZE Byte / $COUNTALOC MB
echo " * Clear cache squid in proccess ..."
 
sleep 10
 
 /etc/init.d/squid stop        # stop service squid
 rm -fdR $CACHEDIR/*           # hapus cache proxy
 squid -z                      # membuat cache direktori
 /etc/init.d/squid start       # start service squid
 
/usr/bin/clear
 
echo "===================================="
echo "=== Clear Cache Squid Success !! ==="
echo "===   http://www.backlinux.com   ==="
echo "===================================="
 
else
 
/usr/bin/clear
echo "================================================"
echo "=== Status Directory Cache Squid Proxy  [OK] ==="
echo "===        http://www.backlinux.com          ==="
echo "================================================"
echo "Cahce directory squid :" $SIZE Byte / $SIZEM
echo "Alokasi cahce squid   :" $CACHEDIRSIZE Byte / $COUNTMB MB / $COUNTGB GB
 
fi
   
Beri hak akses agar script clear-cache-squid.sh dapat dijalankan 
   root#chmod ug+x /root/clear-cache-squid.sh
 
Setelah file sudah anda buat sekarang saatnya untuk meletakkannya pada cronjob system anda, agar script dapat dijalankan secara otomatis setiap hari tepat tengah malam.
Edit cronjob  
 
   root#crontab -e
 
Masukkan code cronjob berikut  
0 0 * * * /root/clear-cache-squid.sh
 
 
 
SUMBER:http://
 

Minggu, 25 Agustus 2013

Cek Port didalam pc

>start
>run
>cmd
ketik >netstat -ano
Active Connections

  Proto  Local Address          Foreign Address        State           PID
  TCP    192.168.22.22:139      192.168.22.62:1266     ESTABLISHED     4

Selasa, 30 Juli 2013

Manage the postfix mailqueue with postsuper, postqueue und mailq

Postfix provides with postsuper, postqueue and mailq some  shell utilitys to manage the mailqueue.
Here are some examples for common tasks:
List all messages that are in the mailqueue
postqueue -p
The output looks like this:
root@server:/# postqueue -p
-Queue ID- –Size– —-Arrival Time—- -Sender/Recipient——-
501CA23B43DB     2182 Thu Dec  3 14:24:39  test@yourdomain.com
(Host or domain name not found. Name service error for name=otherdomain.com type=MX: Host not found, try again)
info@otherdomain.com
– 8 Kbytes in 1 Requests.
Delete a message by message ID
postsuper -d MessageID
replace MessageID with the ID of the message, e.g. 501CA23B43DB
root@server:/# postsuper -d 501CA23B43DB
postsuper: 501CA23B43DB: removed
postsuper: Deleted: 1 message
Remove emails by sender
mailq | tail +2 | awk ‘BEGIN { RS = “” }
# $7=sender, $8=recipient1, $9=recipient2
{ if ($7 == “info@otherdomain.com” && $9 == “”)
print $1 }
‘ | tr -d ‘*!’ | postsuper -d -
replace “info@otherdomain.com” with the sender email address.
Remove emails by recipient
mailq | tail +2 | awk ‘BEGIN { RS = “” }
# $7=sender, $8=recipient1, $9=recipient2
{ if ($8 == “you@yourdomain.com” && $9 == “”)
print $1 }
‘ | tr -d ‘*!’ | postsuper -d -
replace you@yourdomain.com with the recipient email address.
Remove emails by sender hostname
mailq | grep senderhostname | awk ‘{ print $1′} | postsuper -d -
replace the word “senderhostname” with the hostname of the email sender.
If your server has very high load and you want to temporarily move all message from the incoming queue to the hold queue, use the command:
postsuper -h ALL
to move the messages back to the incoming queue, use the command:
postsuper -r ALL
Instead of the word “ALL” you can also provide a specific message ID to move only one message to or from the hold queue. Message in the hold queue will not processed by postfix until they were requeued with postsuper -r.
 or
 /opt/zimbra/postfix/sbin/postsuper [-parameter ALL or queue_id]
example remove all deferred :
[root@mail ~]#/opt/zimbra/postfix/sbin/postsuper -d ALL deffered
example move all from requeue to hold :
[root@mail ~]#/opt/zimbra/postfix/sbin/postsuper -r ALL hold
output
postsuper: Requeued: 63 messages

Synopsis

postsuper [-psv] [-c config_dir] [-d queue_id] [-h queue_id] [-H queue_id] [-r queue_id] [directory ...]

 By default, postsuper(1) performs the operations requested with the -s and -pcommand-line options on all Postfix queue directories - this includes the incoming,active and deferred directories with mail files and the bounce, defer, trace and flushdirectories with log files.
Options:
-c config_dir
The main.cf configuration file is in the named directory instead of the default configuration directory. See also the MAIL_CONFIG environment setting below.
-d queue_id
Delete one message with the named queue ID from the named mail queue(s) (default: hold, incoming, active and deferred).If a queue_id of - is specified, the program reads queue IDs from standard input. For example, to delete all mail with exactly one recipient user@example.com:
mailq | tail +2 | grep -v '^ *(' | awk  'BEGIN { RS = "" }
    # $7=sender, $8=recipient1, $9=recipient2
    { if ($8 == "user@example.com" && $9 == "")
          print $1 }
' | tr -d '*!' | postsuper -d -
Specify "-d ALL" to remove all messages; for example, specify "-d ALL deferred" to delete all mail in the deferred queue. As a safety measure, the word ALL must be specified in upper case.Warning: Postfix queue IDs are reused. There is a very small possibility that postsuper deletes the wrong message file when it is executed while the Postfix mail system is delivering mail.
The scenario is as follows:
1)The Postfix queue manager deletes the message that postsuper(1) is asked to delete, because Postfix is finished with the message (it is delivered, or it is returned to the sender).
2)
New mail arrives, and the new message is given the same queue ID as the message that postsuper(1) is supposed to delete. The probability for reusing a deleted queue ID is about 1 in 2**15 (the number of different microsecond values that the system clock can distinguish within a second).
3)
postsuper(1) deletes the new message, instead of the old message that it should have deleted.
-h queue_id
Put mail "on hold" so that no attempt is made to deliver it. Move one message with the named queue ID from the named mail queue(s) (default: incoming, active anddeferred) to the hold queue.If a queue_id of - is specified, the program reads queue IDs from standard input.
Specify "-h ALL" to hold all messages; for example, specify "-h ALL deferred" to hold all mail in the deferred queue. As a safety measure, the word ALL must be specified in upper case.
Note: while mail is "on hold" it will not expire when its time in the queue exceeds the maximal_queue_lifetime or bounce_queue_lifetime setting. It becomes subject to expiration after it is released from "hold".
This feature is available in Postfix 2.0 and later.
-H queue_id
Release mail that was put "on hold". Move one message with the named queue ID from the named mail queue(s) (default: hold) to the deferred queue.If a queue_id of - is specified, the program reads queue IDs from standard input.
Note: specify "postsuper -r" to release mail that was kept on hold for a significant fraction of $maximal_queue_lifetime or $bounce_queue_lifetime, or longer.
Specify "-H ALL" to release all mail that is "on hold". As a safety measure, the word ALL must be specified in upper case.
This feature is available in Postfix 2.0 and later.
-pPurge old temporary files that are left over after system or software crashes.
-r queue_id
Requeue the message with the named queue ID from the named mail queue(s) (default: hold, incoming, active and deferred). To requeue multiple messages, specify multiple -r command-line options.Alternatively, if a queue_id of - is specified, the program reads queue IDs from standard input.
Specify "-r ALL" to requeue all messages. As a safety measure, the word ALL must be specified in upper case.
A requeued message is moved to the maildrop queue, from where it is copied by the pickup(8) and cleanup(8) daemons to a new queue file. In many respects its handling differs from that of a new local submission.
• The message is not subjected to the smtpd_milters or non_smtpd_milters settings. When mail has passed through an external content filter, this would produce incorrect results with Milter applications that depend on original SMTP connection state information.• The message is subjected again to mail address rewriting and substitution. This is useful when rewriting rules or virtual mappings have changed.
The address rewriting context (local or remote) is the same as when the message was received.
• The message is subjected to the same content_filter settings (if any) as used for new local mail submissions. This is useful when content_filter settings have changed.
Warning: Postfix queue IDs are reused. There is a very small possibility that postsuper(1) requeues the wrong message file when it is executed while the Postfix mail system is running, but no harm should be done.This feature is available in Postfix 1.1 and later.
-s     Structure check and structure repair. This should be done once before Postfix startup.
 
• Rename files whose name does not match the message file inode number. This operation is necessary after restoring a mail queue from a different machine, or from backup media
• Move queue files that are in the wrong place in the file system hierarchy and remove subdirectories that are no longer needed. File position rearrangements are necessary after a change in the hash_queue_names and/or hash_queue_depth configuration parameters.

-v    Enable verbose logging for debugging purposes. Multiple -v
options make the software increasingly verbose.

source :