Cacti is a complete network graphing solution designed to harness the power of RRDTool's data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex networks with hundreds of devices.
Prakash Sawarkar: Kernel 3.8 Released, how to Compile in Redhat, CenOS and Fedora..
Kernel 3.8 Released, how to Compile in Redhat, CentOS and Fedora.
Friday, 9 May 2008
Wednesday, 6 February 2008
How to mount partition with ntfs file system and read write access
1. Introduction
Purpose of this article is to provide to reader step by step guide, how to mount partition with NTFS file system on the Linux operating system. This article consists of two parts:
mount NTFS file system read only access
mount NTFS file system with read write access
2. Mount NTFS file system with read only access
2.1. NTFS kernel support
Majority of current Linux distributions supports NTFS file system out of the box. To be more specific, support for NTFS file system is more feature of Linux kernel modules rather than Linux distributions. First verify if we have NTFS modules installed on our system.
# ls /lib/modules/2.6.18-53-686/kernel/fs/ | grep ntfs
check for NTFS kernel support
NTFS module is presented. Let's identify NTFS partition.
2.2. Identifying partition with NTFS file system
One simple way to identify NTFS partition is:
# fdisk -l | grep NTFS
Identifying partition with NTFS file system
There it is: /dev/sdb1
2.3. Mount NTFS partition
First create a mount point:
# mkdir /mnt/ntfs
Then simply use mount command to mount it:
# mount -t ntfs /dev/sdb1 /mnt/ntfs
Mount NTFS partition using linux
Now we can access NTFS partition and its files with read write access.
3. Mount NTFS file system with read write access
Mounting NTFS file system with read write access permissions is a bit more complicated. This involves installation of addition software such as fuse and ntfs-3g. In both cases you probably need to use your package management tool such as yum, apt-get, synaptic etc.. and install it from your standard distribution repository. Check for packages ntfs-3g and fuse. We take the other path which consists of manual compilation and installation fuse and ntfs-3g from source code.
3.1. Install addition software
3.1.1. Fuse Install
Download source code from: http://fuse.sourceforge.net/
# wget http://easynews.dl.sourceforge.net/sourceforge/fuse/fuse-2.7.1.tar.gz
Compile and install fuse source code:
Extract source file:
# tar xzf fuse-2.7.1.tar.gz
Compile and install
# cd fuse-2.7.1
# ./configure --exec-prefix=/; make; make install
Compile and install fuse source code
3.1.2. ntfs-3g install
Download source code from: http://www.ntfs-3g.org/index.html#download
wget http://www.ntfs-3g.org/ntfs-3g-1.1120.tgz
Extract source file:
# tar xzf ntfs-3g-1.1120.tgz
Compile and install ntfs-3g source code
NOTE: Make sure that you have pkg-config package installed, otherwise you get this error message:
checking for pkg-config... no
checking for FUSE_MODULE... configure: error: FUSE >= 2.6.0 was not found. Either it's not fully
installed (e.g. fuse, fuse-utils, libfuse, libfuse2, libfuse-dev, etc packages) or files from an old
version are still present. See FUSE at http://fuse.sf.net/
# cd ntfs-3g-1.1120
# ./configure; make; make install
Compile and install ntfs-3g source code
3.2. Mount ntfs partition with read write access
# mount -t ntfs-3g /dev/sdb1 /mnt/ntfs/
NOTE: ntfs-3g recommends to have at least kernel version 2.6.20 and higher.
l# mount -t ntfs-3g /dev/sdb1 /mnt/ntfs/
WARNING: Deficient Linux kernel detected. Some driver features are
not available (swap file on NTFS, boot from NTFS by LILO), and
unmount is not safe unless it's made sure the ntfs-3g process
naturally terminates after calling 'umount'. If you wish this
message to disappear then you should upgrade to at least kernel
version 2.6.20, or request help from your distribution to fix
the kernel problem. The below web page has more information:
http://ntfs-3g.org/support.html#fuse26
Purpose of this article is to provide to reader step by step guide, how to mount partition with NTFS file system on the Linux operating system. This article consists of two parts:
mount NTFS file system read only access
mount NTFS file system with read write access
2. Mount NTFS file system with read only access
2.1. NTFS kernel support
Majority of current Linux distributions supports NTFS file system out of the box. To be more specific, support for NTFS file system is more feature of Linux kernel modules rather than Linux distributions. First verify if we have NTFS modules installed on our system.
# ls /lib/modules/2.6.18-53-686/kernel/fs/ | grep ntfs
check for NTFS kernel support
NTFS module is presented. Let's identify NTFS partition.
2.2. Identifying partition with NTFS file system
One simple way to identify NTFS partition is:
# fdisk -l | grep NTFS
Identifying partition with NTFS file system
There it is: /dev/sdb1
2.3. Mount NTFS partition
First create a mount point:
# mkdir /mnt/ntfs
Then simply use mount command to mount it:
# mount -t ntfs /dev/sdb1 /mnt/ntfs
Mount NTFS partition using linux
Now we can access NTFS partition and its files with read write access.
3. Mount NTFS file system with read write access
Mounting NTFS file system with read write access permissions is a bit more complicated. This involves installation of addition software such as fuse and ntfs-3g. In both cases you probably need to use your package management tool such as yum, apt-get, synaptic etc.. and install it from your standard distribution repository. Check for packages ntfs-3g and fuse. We take the other path which consists of manual compilation and installation fuse and ntfs-3g from source code.
3.1. Install addition software
3.1.1. Fuse Install
Download source code from: http://fuse.sourceforge.net/
# wget http://easynews.dl.sourceforge.net/sourceforge/fuse/fuse-2.7.1.tar.gz
Compile and install fuse source code:
Extract source file:
# tar xzf fuse-2.7.1.tar.gz
Compile and install
# cd fuse-2.7.1
# ./configure --exec-prefix=/; make; make install
Compile and install fuse source code
3.1.2. ntfs-3g install
Download source code from: http://www.ntfs-3g.org/index.html#download
wget http://www.ntfs-3g.org/ntfs-3g-1.1120.tgz
Extract source file:
# tar xzf ntfs-3g-1.1120.tgz
Compile and install ntfs-3g source code
NOTE: Make sure that you have pkg-config package installed, otherwise you get this error message:
checking for pkg-config... no
checking for FUSE_MODULE... configure: error: FUSE >= 2.6.0 was not found. Either it's not fully
installed (e.g. fuse, fuse-utils, libfuse, libfuse2, libfuse-dev, etc packages) or files from an old
version are still present. See FUSE at http://fuse.sf.net/
# cd ntfs-3g-1.1120
# ./configure; make; make install
Compile and install ntfs-3g source code
3.2. Mount ntfs partition with read write access
# mount -t ntfs-3g /dev/sdb1 /mnt/ntfs/
NOTE: ntfs-3g recommends to have at least kernel version 2.6.20 and higher.
l# mount -t ntfs-3g /dev/sdb1 /mnt/ntfs/
WARNING: Deficient Linux kernel detected. Some driver features are
not available (swap file on NTFS, boot from NTFS by LILO), and
unmount is not safe unless it's made sure the ntfs-3g process
naturally terminates after calling 'umount'. If you wish this
message to disappear then you should upgrade to at least kernel
version 2.6.20, or request help from your distribution to fix
the kernel problem. The below web page has more information:
http://ntfs-3g.org/support.html#fuse26
Saturday, 29 December 2007
Configure Nagios On RHEL,CentOS 5.1
Nagios is a powerful monitoring system that enables organizations to identify and resolve IT infrastructure problems before they affect critical business processes.
Designed with scalability and flexibility in mind, Nagios gives you the peace of mind that comes from knowing your organization's business processes won't be affected by unknown outages.
Nagios is a powerful tool that provides you with instant awareness of your organization's mission-critical IT infrastructure. Nagios allows you to detect and repair problems and mitigate future issues before they affect end-users and customers.
Designed with scalability and flexibility in mind, Nagios gives you the peace of mind that comes from knowing your organization's business processes won't be affected by unknown outages.
Nagios is a powerful tool that provides you with instant awareness of your organization's mission-critical IT infrastructure. Nagios allows you to detect and repair problems and mitigate future issues before they affect end-users and customers.
Tuesday, 20 November 2007
How to Lock / UnLock (Enable / Disable) Linux User Account
Before you remove an account from a system, is a good idea lock it for one week to make sure that no one use it.
To lock, you can use the follow command:
# passwd -l username (where username is the login id).
This option is used to lock the specified account and it is available to root only. The locking is performed by rendering the encrypted password into an invalid string (by prefixing the encrypted string with an !).
After that, if someone try to loginusing this account, the system will return:
# su - username
This account is currently not available.
To Unlock the same account
Following command re-enables an account by changing the password back to its previous value i.e. to value before using -l option.
# passwd -u username
This removes the '!' in front of the encrypted password
To lock, you can use the follow command:
# passwd -l username (where username is the login id).
This option is used to lock the specified account and it is available to root only. The locking is performed by rendering the encrypted password into an invalid string (by prefixing the encrypted string with an !).
After that, if someone try to loginusing this account, the system will return:
# su - username
This account is currently not available.
To Unlock the same account
Following command re-enables an account by changing the password back to its previous value i.e. to value before using -l option.
# passwd -u username
This removes the '!' in front of the encrypted password
Sunday, 5 August 2007
Unix Linux Permissions
1 chmod - modify file access rights
2 chown - change file ownership
3 chgrp - change a file's group ownership
4 su - temporarily become the superuser
5 sudo - temporarily become the superuser
File Permissions
On a Linux system, each file and directory is assigned access rights for the owner of the file, the members of a group of related users, and everybody else. Rights can be assigned to read a file, to write a file, and to execute a file (i.e., run the file as a program).To see the permission settings for a file, we can use the ls command. As an example, we will look at the bash program which is located in the /bin directory:
[root@prakash]# ls -l /bin/bash
-rwxr-xr-x 1 root root 325213 Feb 23 2007 /bin/bash
Here we can see:
* The file "/bin/bash" is owned by user "root"
* The superuser has the right to read, write, and execute this file
* The file is owned by the group "root"
* Members of the group "root" can also read and execute this file
* Everybody else can read and execute this file
In the diagram below, we see how the first portion of the listing is interpreted. It
consists of a character indicating the file type, followed by three sets of three
characters that convey the reading, writing and execution permission for the owner, group, and everybody else.
1 chmod (modify file access rights)
The chmod command is used to change the permissions of a file or directory. To use it, you specify the desired permission settings and the file or files that you wish to modify.There are two ways to specify the permissions. In this lesson we will focus on one of these, called the octal notation method. It is easy to think of the permission settings as a series of bits (which is how the computer thinks about them). Here's how it works:
rwx rwx rwx = 111 111 111
rw- rw- rw- = 110 110 110
rwx --- --- = 111 000 000
and so on...
rwx = 111 in binary = 7
rw- = 110 in binary = 6
r-x = 101 in binary = 5
r-- = 100 in binary = 4
Now, if you represent each of the three sets of permissions (owner, group, and other) as a single digit, you have a pretty convenient way of expressing the possible permissions settings. For example, if we wanted to set some_file to have read and write permission for the owner, but wanted to keep the file private from others, we would:
[root@prakash]# chmod 600 some_file
Here is a table of numbers that covers all the common settings. The ones beginning with "7" are used with programs (since they enable execution) and the rest are for other kinds of files.
Value Meaning
The chmod command can also be used to control the access permissions for directories. Again, we can use the octal notation to set permissions, but the meaning of the r, w, and x attributes is different:
r - Allows the contents of the directory to be listed if the x attribute is also set.
w - Allows files within the directory to be created, deleted, or renamed if the x attribute is also set.
x - Allows a directory to be entered (i.e. cd dir).
Here are some useful settings for directories:
Value Meaning
777 (rwxrwxrwx) No restrictions on permissions. Anybody may list files, create new files in the directory and delete files in the directory. Generally not a good setting.
Value Meaning
755 (rwxr-xr-x) The directory owner has full access. All others may list the directory, but cannot create files nor delete them. This setting is common for directories that you wish to share with other users.
Value Meaning
700 (rwx------) The directory owner has full access. Nobody else has any rights. This setting is useful for directories that only the owner may use and must be kept private from others.
2 chown (Changing File Ownership)
You can change the owner of a file by using the chown command. Here's an example: Suppose I wanted to change the owner of some_file from "me" to "you". I could:
[root@prakash]$ su
Password:
[root@prakash]# chown you some_file
[root@prakash]# exit
[root@prakash]$
Notice that in order to change the owner of a file, you must be the superuser. To do this, our example employed the su command, then we executed chown, and finally we typed exit to return to our previous session chown works the same way on directories as it does on files.
3 chgrp (Changing Group Ownership)
The group ownership of a file or directory may be changed with chgrp. This command is used like this:
[root@prakash]# chgrp new_group some_file
In the example above, we changed the group ownership of some_file from its previous group to "new_group". You must be the owner of the file or directory to perform a chgrp.
Becoming The Superuser For A Short While
4 su (temporarily become the superuser)
It is often necessary to become the superuser to perform important system administration tasks, but as you have been warned, you should not stay logged in as the superuser. In most distributions, there is a program that can give you temporary access to the superuser's privileges. This program is called su (short for substitute user) and can be used in those cases when you need to be the superuser for a small number of tasks. To become the superuser, simply type the su command. You will be prompted for the superuser's password:
[root@prakash]$ su
Password:
[root@prakash]#
After executing the su command, you have a new shell session as the superuser. To exit the superuser session, type exit and you will return to your previous session.
5 sudo (temporarily become the superuser)
In some distributions, most notably Ubuntu, an alternate method is used. Rather than using su, these systems employ the sudo command instead. With sudo, one or more users are granted superuser privileges on an as needed basis. To execute a command as the superuser, the desired command is simply preceeded with the sudo command. After the command is entered, the user is prompted for the user's password rather than the superuser's:
[root@prakash]$ sudo some_command
Password:
[root@prakash]#
Here is a list of some common settings, numerical values and their
meanings:
2 chown - change file ownership
3 chgrp - change a file's group ownership
4 su - temporarily become the superuser
5 sudo - temporarily become the superuser
File Permissions
On a Linux system, each file and directory is assigned access rights for the owner of the file, the members of a group of related users, and everybody else. Rights can be assigned to read a file, to write a file, and to execute a file (i.e., run the file as a program).To see the permission settings for a file, we can use the ls command. As an example, we will look at the bash program which is located in the /bin directory:
[root@prakash]# ls -l /bin/bash
-rwxr-xr-x 1 root root 325213 Feb 23 2007 /bin/bash
Here we can see:
* The file "/bin/bash" is owned by user "root"
* The superuser has the right to read, write, and execute this file
* The file is owned by the group "root"
* Members of the group "root" can also read and execute this file
* Everybody else can read and execute this file
In the diagram below, we see how the first portion of the listing is interpreted. It
consists of a character indicating the file type, followed by three sets of three
characters that convey the reading, writing and execution permission for the owner, group, and everybody else.
1 chmod (modify file access rights)
The chmod command is used to change the permissions of a file or directory. To use it, you specify the desired permission settings and the file or files that you wish to modify.There are two ways to specify the permissions. In this lesson we will focus on one of these, called the octal notation method. It is easy to think of the permission settings as a series of bits (which is how the computer thinks about them). Here's how it works:
rwx rwx rwx = 111 111 111
rw- rw- rw- = 110 110 110
rwx --- --- = 111 000 000
and so on...
rwx = 111 in binary = 7
rw- = 110 in binary = 6
r-x = 101 in binary = 5
r-- = 100 in binary = 4
Now, if you represent each of the three sets of permissions (owner, group, and other) as a single digit, you have a pretty convenient way of expressing the possible permissions settings. For example, if we wanted to set some_file to have read and write permission for the owner, but wanted to keep the file private from others, we would:
[root@prakash]# chmod 600 some_file
Here is a table of numbers that covers all the common settings. The ones beginning with "7" are used with programs (since they enable execution) and the rest are for other kinds of files.
Value Meaning
777 (rwxrwxrwx) No restrictions on permissions. Anybody may do anything. Generally not a desirable setting.
Value Meaning
755 (rwxr-xr-x) The file's owner may read, write, and execute the file. All others may read and execute the file. This setting is common for programs that are used by all users
Value Meaning
Value Meaning
700 (rwx------) The file's owner may read, write, and execute the file. Nobody else has any rights. This setting is useful for programs that only the owner may use and must be kept private from others.
Value Meaning
666 (rw-rw-rw-) All users may read and write the file.
Value Meaning
644 (rw-r--r--) The owner may read and write a file, while all others may only read the file. A common setting for data files that everybody may read, but only the owner may change.
Value Meaning
600 (rw-------) The owner may read and write a file. All others have no rights. A common setting for data files that the owner wants to keep private.
Directory PermissionsThe chmod command can also be used to control the access permissions for directories. Again, we can use the octal notation to set permissions, but the meaning of the r, w, and x attributes is different:
r - Allows the contents of the directory to be listed if the x attribute is also set.
w - Allows files within the directory to be created, deleted, or renamed if the x attribute is also set.
x - Allows a directory to be entered (i.e. cd dir).
Here are some useful settings for directories:
Value Meaning
777 (rwxrwxrwx) No restrictions on permissions. Anybody may list files, create new files in the directory and delete files in the directory. Generally not a good setting.
Value Meaning
755 (rwxr-xr-x) The directory owner has full access. All others may list the directory, but cannot create files nor delete them. This setting is common for directories that you wish to share with other users.
Value Meaning
700 (rwx------) The directory owner has full access. Nobody else has any rights. This setting is useful for directories that only the owner may use and must be kept private from others.
2 chown (Changing File Ownership)
You can change the owner of a file by using the chown command. Here's an example: Suppose I wanted to change the owner of some_file from "me" to "you". I could:
[root@prakash]$ su
Password:
[root@prakash]# chown you some_file
[root@prakash]# exit
[root@prakash]$
Notice that in order to change the owner of a file, you must be the superuser. To do this, our example employed the su command, then we executed chown, and finally we typed exit to return to our previous session chown works the same way on directories as it does on files.
3 chgrp (Changing Group Ownership)
The group ownership of a file or directory may be changed with chgrp. This command is used like this:
[root@prakash]# chgrp new_group some_file
In the example above, we changed the group ownership of some_file from its previous group to "new_group". You must be the owner of the file or directory to perform a chgrp.
Becoming The Superuser For A Short While
4 su (temporarily become the superuser)
It is often necessary to become the superuser to perform important system administration tasks, but as you have been warned, you should not stay logged in as the superuser. In most distributions, there is a program that can give you temporary access to the superuser's privileges. This program is called su (short for substitute user) and can be used in those cases when you need to be the superuser for a small number of tasks. To become the superuser, simply type the su command. You will be prompted for the superuser's password:
[root@prakash]$ su
Password:
[root@prakash]#
After executing the su command, you have a new shell session as the superuser. To exit the superuser session, type exit and you will return to your previous session.
5 sudo (temporarily become the superuser)
In some distributions, most notably Ubuntu, an alternate method is used. Rather than using su, these systems employ the sudo command instead. With sudo, one or more users are granted superuser privileges on an as needed basis. To execute a command as the superuser, the desired command is simply preceeded with the sudo command. After the command is entered, the user is prompted for the user's password rather than the superuser's:
[root@prakash]$ sudo some_command
Password:
[root@prakash]#
Warning Beware 666 and 777 | |
---|---|
Setting permissions to 666 or 777 will allow everyone to read and write to a file or directory. These permissions could allow tampering with sensitive files, so in general, it is not a good idea to use these settings. |
- -rw------- (600) — Only the owner has read and write permissions.
- -rw-r--r-- (644) — Only the owner has read and write permissions; the group and others can read only.
- -rwx------ (700) — Only the owner has read, write and execute permissions.
- -rwxr-xr-x (755) — The owner has read, write and execute permissions; the group and others can only read and execute.
- -rwx--x--x (711) — The owner has read, write and execute permissions; the group and others can only execute.
- -rw-rw-rw- (666) — Everyone can read and write to the file. (Be careful with these permissions.)
- -rwxrwxrwx (777) — Everyone can read, write and execute. (Again, this permissions setting can be hazardous.)
- drwx------ (700) — Only the user can read, write in this directory.
- drwxr-xr-x (755) — Everyone can read the directory, but its contents can only be changed by the user.
Subscribe to:
Posts (Atom)