Sunday 20 May 2012

Zimbra Command

1. How to check mail account List.

#zmprov -l gaa

l = for ldap
gaa =get all account

OUTPUT:
admin@example.com
spam.g1oxhlgg@example.com
ham.hp_pg_h5@example.com
virus-quarantine.cs29ig2sm@example.com
xxx.yyy@example.com
xxx.yyy@example.com
xxx.yyy@example.com
xxx.yyy@example.com

2. how to create user in zimbra by command.

#zmprov ca xxx.yyy@example.com test123 displayName xyz

Command Description: 
zmprov = command
ca = create account
xxx.yyy = user id
example.com = domain name
teat123 = password
displayname = switch for display name
xyz = display name 

3.How to create Alias of users ID.

#zmprov aaa xxx.yyy@example.com abc@example.com
Command Description:
zmprov = command
aaa = add account alias
xxx.yyy = user ID
example.com = Domain name
abc = Alias Name

4. How to check all configuration parameter by command.

#zmprov –l gaa -v example.com

Command Description:
Zmprov = command
l = for ldap
gaa = get all account
example.com = Domain Name

5. How to check configuration parameter of a particular User.

# zmprov ga xxx.yyy@example.com

Command Description:
Zmprov = Command
ga = Get Account
xxx.yyy = user ID
example.com = Domain Name 

6. How to list all admin account by command

#zmprov gaaa

Command Description:
 Zmprov = command
gaaa = Get all admin account 

7. How to remove User account Alias.

#zmprov raa xxx.yyy@example.com abc@example.com

Command Description:
Zmprov = command
raa = remove account alias
xxx.yyy = User ID
example.com = Domain Name
abc = Alias Name

8. How to set password on userID.

#zmprov sp xxx.yyy@example.com test@123

Command Description:
Zmprov = command
Sp = set password
xxx.yyy = user ID
example.com = Domain name
test@123 = password

Mailbox size of all accounts


How to check mailbox size of all accounts in Zimbra mail server.


 I would like to check a mailbox size of all users in my Zimbra mail server and I can check these sizes by create a shell script which has 2 commands for query.
     1.    zmprov gaa => I use this command for query all accounts in my Zimbra server.
     2. zmmailbox -z -m your-account gms => Get mailbox size of your-account account

For all user we can use use a bash script.

# su zimbra
#vim zmchkmailsize.sh


#!/bin/sh
WHO=`whoami`
if [ $WHO = "zimbra" ]
then
all_account=`zmprov -l gaa`;
for account in ${all_account}
do
    mb_size=`zmmailbox -z -m ${account} gms`;
        echo "Mailbox size of ${account} = ${mb_size}";
        done
else
echo "Execute this script as user zimbra (\"su - zimbra\")"
fi


:wq
# chmod 755
# ./zmchkmailsize.sh


OUTPUT:

Mailbox size of admin@example.com.com = 15.74 KB

Mailbox size of spam.g1oxhlgg@example.com = 0 B

Mailbox size of ham.hp_pg_h5@iexample.com = 0 B

Mailbox size of virus-quarantine.cs29ig2sm@example.com = 0 B

Mailbox size of xxx.yyy@example.com = 1.70 KB

Mailbox size of xxx.yyy@example.com = 1.29 KB

Mailbox size of xxx.yyy@example.com = 0 B

Mailbox size of xxx.yyy@example.com = 0 B


Saturday 19 May 2012

Zimbra Mail Server

 Introducing Zimbra
At the simplest level Zimbra is a complete mail and calendaring platform. The platform is capable of sending and receiving email via the standard email protocol that the Internet uses for email: SMTP. Zimbra can also support specific types of email – email about calendar events, tasks, and general documents. All of this functionality can be expanded by developers.Zimbra provide three type of login mode like Advanced, Standard and mobile.Zimbra support various type of OS and their Version like rhel, fedora, Centos, Suse, Ubuntu.

Wednesday 16 May 2012

Linux Directory structure

A simple description of the UNIX system, also applicable to Linux, is this:

"On a UNIX system, everything is a file; if something is not a file, it is a process."

This statement is true because there are special files that are more than just files (named pipes and sockets, for instance), but to keep things simple, saying that everything is a file is an acceptable generalization. A Linux system, just like UNIX, makes no difference between a file and a directory, since a directory is just a file containing names of other files. Programs, services, texts, images, and so forth, are all files. Input and output devices, and generally all devices, are considered to be files, according to the system.

Unix & Linux File System

 Linux File system

  /Root

  • Every single file and directory starts from the root directory.
  • Only root user has write privilege under this directory.
  • To Remember:  /root is root user’s home directory, which is not same as /.

  /bin – User Binaries

  • Contains binary executables.
  • Commands used by all the users of the system are located here.

/sbin – System Binaries

  • It also contains executables binary.
  • The linux commands located under this directory are used typically by system aministrator, for system maintenance purpose.

 /etc – Configuration Files

  • It contains configuration files required by all programs.
  • This also contains startup and shutdown shell scripts used to start/stop individual programs.
  • For example: /etc/resolv.conf, /etc/logrotate.conf

 /dev – Device Files

  • Contains device files.
  • These include terminal devices, usb, or any device attached to the system.
  • For example: /dev/tty1, /dev/usbmon0

/proc – Process Information

  • Contains information about system process.
  • This is a virtual filesystem with text information about system resources. For example: /proc/uptime

/var – Variable Files

  • This includes — system log files (/var/log); packages and database files (/var/lib); emails (/var/mail); print queues (/var/spool); lock files (/var/lock).

/tmp – Temporary Files

  • Directory that contains temporary files created by system and users.
  • To Remember: Files under this directory are deleted when system is rebooted.

/usr – User Programs

  • Contains binaries, libraries, documentation, and source-code for programs.
  • /usr/lib contains libraries for /usr/bin and /usr/sbin
  • /usr/local contains users programs that you install from source. For example, when you install apache from source, it goes under /usr/local/apache2

 /home – Home Directories

  • Home directories for all users to store their personal files.
  • For example: /home/jack, /home/shiv

/boot – Boot Loader Files

  • Contains boot loader related files.
  • Kernel initrd, vmlinux, grub files are located under /boot
  • For example: initrd.img-2.6.32-24-generic, vmlinuz-2.6.32-24-generic

/lib – System Libraries

  • Contains library files that supports the binaries located under /bin and /sbin

/opt – Optional for Applications

  • add-on applications should be installed under either /opt.

/mnt – Mount Directory

  • Temporary mount directory where sysadmins can mount filesystems.

 /media – Removable Media Devices

  • Temporary mount directory for removable devices.
  • For examples, /media/cdrom for CD-ROM; /media/floppy for floppy drives; /media/cdrecorder for CD writer.

Linux User

How to check all user in linux


Every user who has access to a Linux system needs a login and a password. Each user must belong to a primary group and for security or access purposes can belong to several secondary groups.
In order to create new logins, modify or delete users, you must already be logged in as root.  The root login is the highest level and only certain individuals should have access to the root account.

#useradd shiv

 Options:

  • -d home directory
  • -s starting program (shell)
  • -p password
  • -g (primary group assigned to the users)
  • -G (Other groups the user belongs to)
  • -m (Create the user's home directory

Example: To add a new user with

  • a primary group of users
  • a second group operation
  • starting shell /bin/bash
  • password of xxxx
  • home directory of shiv
  • create home directory
  • a login name of shiv
#useradd –g users –G operation –s /bin/shell –p xxxx –d /home/shiv -m shiv
 

usermod - Modifying existing user

Options:
  • -d home directory
  • -s starting program (shell)
  • -p password
  • -g (primary group assigned to the users)
  • -G (Other groups the user belongs to)

Example: To add the group 'others' to the user shiv

#usermod –G accounts shiv

Userdel : Deleting a user

Options:
  • -r (remove home directory)
Example: To remove the user 'shiv' and his home directory

#userdel -r shiv


passwd : User’s Password


Options:
  • user's name (Only required if you are root and want to change another user's password)
Example: To change the password for the account you are currently logged in as...
passwd
Enter existing password
Enter new password
Enter new password again (to validate)

Example: To change the password for the user 'shiv' (only you are logged in as root)...

#passwd shiv
Enter existing password (can be either roger's password or root's password)
Enter new password
Enter new password again (to validate)


Where user and group information stored

 

User names and primary groups are stored in /etc/passwd. This file can be directly edited using the 'vi' editor, although this is not recommended. Format of the file is...
  • User (name normally all lower case)
  • Password (encrypted - only contains the letter 'x')
  • User ID (a unique number of each user)
  • Primary Group ID
  • Comment (Normally the person's full name)
  • Home directory (normally /home/<user name>
  • Default shell (normally /bin/bash)
Each field is separated by a colon.
Passwords for each user are stored in /etc/shadow. This file should only be changed using the passwd command.
Group information is stored in /etc/group. This file can be directly edited using the 'vi' editor. Format of the file is...
  • Group name
  • Group password (hardly ever used)
  • Group ID
  • User names (separated by commas)
Each field is separated by a colon.
Default files
When a new user is created, the default files and directories that are created are stored in /etc/skel.
This directory can be modified to fit your needs. Modifications only effect new users and does not change anything for existing users.

Su : Switch User

To switch to another user, use the su command. This is most commonly used to switch to the root account.
Example: To switch to root account...
#su
Enter root's passwd
Example: To switch to the user 'roger'...
#su shiv
Enter shiv's or root's passwd
To return to original user, enter exit

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | coupon codes