add group command linux, delete group command linux, add user to group in linux, delete user from goup linux, create group command in linux

Wednesday, July 29, 2009

How to add group in linux or how to create group in linux.

How to delete group in linux or how to remove group in linux

How to add user to group in linux and how to delete user from group in linux.


There are various Linux Commands
that Linux uses groups to define a set of related user accounts that can share access to a file or directory. You probably won't often find it necessary to configure group definitions, particularly if you use your system as a desktop system rather than a server. However, when you wish, you create and delete groups and modify their membership lists.

1. Create a group command in linux

To create a new group, use the groupadd command in linux:

#groupadd group

where group specifies the name of the group to be added. Groups are stored in the file /etc/group, which can be read by any user but modified only by root.

For example, to add a group named ajay, you would enter the following command:

#groupadd ajay

2. Delete a group command in linux

To delete a group, user the groupdel command in linux:

#groupdel group

where group specifies the name of the group to be deleted. For example, to delete the group named ajay, you would enter the following command:

#groupdel ajay

3. Adding a member to a group

To add a member to a group, you use a special form of the adduser command:

#adduser user group

where user specifies the member and group specifies the group to which the member is added. For example, to add the user ajay01 to the group ajay, you would enter the following command:

#adduser ajay01 ajay

4. Remove a member from a group in linux or delete user from group in linux

Unfortunately, no command removes a user from a specified group. The easiest way to remove a member from a group is by editing the /etc/group file. Here's an excerpt from a typical /etc/group file:

users:x:100:
nogroup:x:65534:
bmccarty:x:1000:
ajay:x:1002:ajay01,ajay02,ajay03

Each line in the file describes a single group and has the same form as other lines, consisting of a series of fields separated by colons (:). The fields are:

Group name

The name of the group.

Password

The encrypted password associated with the group. This field is not generally used, containing an x instead.

Group ID

The unique numeric ID associated with the group.

Member list

A list of user accounts, with a comma (,) separating each user account from the next.

To remove a member from a group, first create a backup copy of the /etc/group file:

cp /etc/group /etc/group.SAVE

The backup can prove helpful if you modify the file incorrectly. Next, open the /etc/group file in a text editor. Locate the line that describes the group and delete the user name and the following comma, if any. Save the file, exit the editor, and check your work.

Read more...

add user command linux, delete user command linux, add password in linux, create user password command in linux, change user password command linux

How to add user in linux or how to create user in linux.

How to delete user in linux or how to remove user in linux

How to create user account in linux and how to change user name.

How to create user password in linux.

How to change user password in linux.


Firstly in the linux, you must be log in as root user, unless directed otherwise.

1. Add User in linux or Create a User Account in linux

To create a user account, you use the adduser command in linux, which has the form:

#adduser userid(username)

where userid specifies the name of the user account that you want to create. The command prompts you for the information needed to create the account.

Here's a typical example of using the command, which creates a user account named ritvik:

ritvik:~# 

adduser ajay

Adding user ajay...
Adding new group ajay (1001).
Adding new user ajay (1001) with group ajay.
Creating home directory /home/ajay.
Copying files from /etc/skel
Changing password for ajay
Enter the new password (minimum of 5, maximum of 8 characters)
Please use a combination of upper and lower case letters and numbers.
Re-enter new password:
Password changed.
Changing the user information for ajay
Enter the new value, or press return for the default

Full Name []:

Ajay Sharma

Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [y/n]

y

ritvik:~#

Notice that the lines where the password was typed were overwritten by the subsequent lines. Moreover, for security, passwords are not echoed to the console as they are typed.

Notice also that several of the information fields were omitted - for example, Room Number. You can specify such information if you think it may be useful, but the system makes no use of the information and doesn't require you to provide it.

The similarly named useradd command also creates a user account, but does not prompt you for the password or other information.

When the command establishes a user account, it creates a home directory for the user. In the previous example, the command would have created the directory /home/ajay. It also places several configuration files in the home directory, copying them from the directory /etc/skel. These files generally have names beginning with the dot (.) character, so they are hidden from an ordinary ls -a argument of ls to list the names of the files. The files are generally ordinary text files, which you can view with a text editor, such as ae. By modifying the contents of such files, you can control the operation of the associated application. For example, the .bashrc file controls the operation of the BASH shell. command. Use the

2. Change a User's Name in linux

You can change the name associated with a user account, by using the chfn command in linux:

#chfn -f name userid

where name specifies the new name and userid specifies the account to be modified. If the name contains spaces or other special characters, it should be enclosed in double quotes ("). For example, to change the name associated with the account ajay to sharma ajay, you would enter the following command:

#chfn -f "sharma ajay" ajay

3. Delete User command in linux or Delete User Account in linux

To delete a user account, use the userdel command in linux:

#userdel user

where user specifies the account to be deleted. If you want to delete the user's home directory, its files and subdirectories, use this form of the command:

#userdel -r user
NOTE:
Because deleted files can't generally be recovered, you should
backup potentially useful files before deleting a user account.

4. Create User Password and Change a User Account Password in linux

From time to time, you should change your password, making it more difficult for others to break into your system. As system administrator, you may sometimes need to change the password associated with a user's account. For instance, some users have a bad habit of forgetting their password. They'll come to you, the system administrator, seeking help in accessing their account.

To change a password, you use the passwd command in linux. To change your own password, enter a command like this one:

# passwd

This command changes the password associated with the current user account. You don't have to be logged in as root to change a password. Because of this, users can change their own passwords without the help of the system administrator. The root user, however, can change the password associated with any user account, as you'll see shortly. Of course, only root can do so - other users can change only their own password.

The passwd command initiates a simple dialog that resembles the following:


$ passwd

Changing password for ajay Old password: Enter the new password (minimum of 5, maximum of 8 characters) Please use a combination of upper and lower case letters and numbers. New password: Re-enter new password: Password changed.

Notice the restrictions governing the choice of password, which are designed to prohibit passwords that might be easily guessed. If you choose a password that violates these restrictions, the command will refuse the password, prompting you for another.

As the root user, you can change the password associated with any user account. The system doesn't ask you for the current password, it immediately prompts for the new password:

ritvik:~# passwd ajay
means
ritvik:~# passwd username

Changing password for ajay Enter the new password (minimum of 5, maximum of 8 characters) Please use a combination of upper and lower case letters and numbers.
New password: Re-enter
new password: Password changed.

Information on users is stored in the file /etc/passwd, which you can view using a text editor. Any user can read this file, though only the root user can modify it. If you selected shadow passwords, passwords are encrypted and stored in the file /etc/shadow, which can be read only by the root user.



Read more...

Make Tar Files or UnTar Files or Create Tar Files or Extract Tar Files in Linux, Ubuntu, Centos, Unix,

Sunday, May 17, 2009

How to Create Tar Files In Linux, Ubuntu, Centos, Unix
How to Make Tar Files In Linux, Ubuntu, Centos, Unix
How to Untar Files In Linux, Ubuntu, Centos, Unix
How to Extract Tar Files In Linux, Ubuntu, Centos, Unix

Create tape archives and add or extract files.


Tar or Untar Syntax in Linux :-


tar c [ bBeEfFhiklnopPqvwX [ 0-7 ] ] [ block ] [ tarfile ] [ exclude-file ] {-I include-file | -C directory | file | file }

tar r [ bBeEfFhiklnqvw [ 0-7 ] ] [ block ] {-I include-file | -C directory | file | file }

tar t [ BefFhiklnqvX [ 0-7 ] ] [ tarfile ] [ exclude-file ] {-I include-file | file } ...

tar u [ bBeEfFhiklnqvw [ 0-7 ] ] [ block ] [ tarfile ] file ...

tar x [ BefFhiklmnopqvwX [ 0-7 ] ] [ tarfile ] [ exclude-file ] [ file ... ]

c Create. Writing begins at the beginning of the tarfile, instead of at the end.
r Replace. The named file s are written at the end of the tarfile. A file created with extended headers must be updated with extended headers (see E flag under Function Modifiers). A file created without extended headers cannot be modified with extended headers.
t Table of Contents. The names of the specified files are listed each time they occur in the tar file. If no file argument is given, the names of all files in the tarfile are listed. With the v
function modifier, additional information for the specified files is displayed.
u Update. The named file s are written at the end of the tarfile if they are not already in the tar file, or if they have been modified since last written to that tarfile. An update can be rather slow. A tarfile created on a 5.x system cannot be updated on a 4.x system. A file created with extended headers must be updated with extended headers (see E flag under Function Modifiers). A file created without extended headers cannot be modified with extended headers.
x Extract or restore. The named file s are extracted from the tarfile and written to the directory specified in the tarfile, relative to the current directory. Use the relative path names of files and directories to be extracted. If a named file matches a directory whose contents has been writ ten to the tarfile, this directory is recursively extracted. The owner, modification time, and mode are restored (if possible); otherwise, to restore owner, you must be the super-user. Character special and block-special devices (created by mknod(1M)) can only be extracted by the super user. If no file argument is given, the entire content of the tarfile is extracted. If the tar- file contains several files with the same name, each file is written to the appropriate directory, overwriting the previous one. Filename substitu tion wildcards cannot be used for extracting files from the archive; rather, use a command of the form:

tar xvf... /dev/rmt/0 `tar tf... /dev/rmt/0 | grep 'pattern' `

When extracting tapes created with the r or u functions, directory modification times may not be set correctly. These same functions cannot be used with many tape drives due to tape drive limitations such as the absence of backspace or append capabilities.

When using the r, u, or x functions or the X function modifier, the named files must match exactly the corresponding files in the tarfile. For example, to extract ./thisfile, you must specify ./thisfile, and not thisfile. The t function displays how each file was archived.

Function Modifiers
The characters below may be used in conjunction with the letter that selects the desired function.

b Blocking Factor. Use when reading or writing to raw magnetic archives (see f below). The block argument specifies the number of 512-byte tape blocks to be included in each read or write operation performed on the tarfile. The minimum is 1, the default is 20. The maximum value is a function of the amount of memory available and the blocking requirements of the specific tape device involved (see mtio(7I) for details.) The maximum cannot exceed INT_MAX/512 (4194303).

When a tape archive is being read, its actual blocking factor will be automatically detected, provided that it is less than or equal to the nominal blocking factor (the value of the block argument, or the default value if the b modifier is not specified). If the actual blocking factor is greater than the nominal blocking factor, a read error will result. See Example 5 in Examples.

B Block. Force tar to perform multiple reads (if necessary) to read exactly enough bytes to fill a block. This function modifier enables tar to work across the Ethernet, since pipes and sockets return partial blocks even when more data is coming. When reading from standard input, '-', this function modifier is selected by default to ensure that tar can recover from short reads.
e Error. Exit immediately with a positive exit status if any unexpected errors occur. The SYSV3 environment variable overrides the default behavior. (See ENVIRONMENT section below.)
E Write a tarfile with extended headers. (Used with c, r, or u options; ignored with t or x options.) When a tarfile is written with extended headers, the modification time is maintained with a granularity of microseconds rather than seconds. In addition, filenames no longer than PATH_MAX characters that could not be archived without E, and file sizes greater than 8GB, are supported. The E flag is required whenever the larger files and/or files with longer names, or whose UID/GID exceed 2097151, are to be archived, or if time granularity of microseconds is desired.
f File. Use the tarfile argument as the name of the tarfile. If f is specified, /etc/default/tar is
not searched. If f is omitted, tar will use the device indicated by the TAPE environment variable, if set; otherwise, it will use the default values defined in /etc/default/tar. If the name of the tarfile is '-', tar writes to the standard output or reads from the standard input, whichever is appropriate. tar can be used as the head or tail of a pipeline. tar can also be used to move hierarchies with the command:

example% cd fromdir; tar cf - .| (cd todir; tar xfBp -)

F With one F argument, tar excludes all directories named SCCS and RCS from the tarfile. With two arguments, FF, tar excludes all directories named SCCS and RCS, all files with .o as their suffix, and all files named errs, core, and a.out. The SYSV3 environment variable overrides the default behavior. (See ENVIRONMENT section below.)
h Follow symbolic links as if they were normal files or directories. Normally, tar does not follow symbolic links.
i Ignore directory checksum errors.
-j, --bzip2 filter archive through bzip2, use to decompress .bz2 files. WARNING: some previous versions of tar used option -I to filter through bzip2. When writing scripts, use --bzip2 instead of -j so that both older and newer tar versions will work.
k size Requires tar to use the size argument as the size of an archive in kilobytes. This is useful when the archive is intended for a fixed size device such as floppy disks. Large files are then split across volumes if they do not fit in the specified size.
l Link. Output error message if unable to resolve all links to the files being archived. If l is not specified, no error messages are printed.
m Modify. The modification time of the file is the time of extraction. This function modifier is
valid only with the x function.
n The file being read is a non-tape device. Reading of the archive is faster since tar can randomly seek around the archive.
o Ownership. Assign to extracted files the user and group identifiers of the user running the program, rather than those on tarfile. This is the default behavior for users other than root. If the o function modifier is not set and the user is root, the extracted files will take on the group and user identifiers of the files on tarfile (see chown for more information). The o function modifier is only valid with the x function.
p Restore the named files to their original modes, and ACLs if applicable, ignoring the present umask. This is the default behavior if invoked as super-user with the x function letter specified. If super-user, SETUID and sticky information are also extracted, and files are restored with their original owners and permissions, rather than owned by root. When this function modifier is used with the c function, ACLs are created in the tarfile along with other information. Errors will occur when a tarfile with ACLs is extracted by
previous versions of tar .
P Suppress the addition of a trailing "/" on directory entries in the archive.
q Stop after extracting the first occurrence of the named file. tar will normally continue reading the archive after finding an occurrence of a file.
v Verbose. Output the name of each file preceded by the function letter. With the t function, v provides additional information about the tarfile entries. The listing is similar to the format produced by the -l option of the ls command.
w What. Output the action to be taken and the name of the file, then await the user's confirmation. If the response is affirmative, the action is performed; otherwise, the action is not performed. This function modifier cannot be used with the t function.
X Exclude. Use the exclude-file argument as a file containing a list of relative path names for files (or directories) to be excluded from the tarfile when using the functions c, x, or t. Be careful of trailing white spaces. Also beware of leading white spaces, since, for each line in the excluded file, the entire line (apart from the newline) will be used to match against the initial string of files to exclude. Multiple X arguments may be used, with one exclude-file per argument. In the case where included files (see -I include-file option) are also specified, the excluded files take precedence over all included files. If a file is specified in both the exclude-file and the include-file (or on the command line), it will be excluded.
[0-7] Select an alternative drive on which the tape is mounted. The default entries are specified in /etc/default/tar. If no digit or f function modifier is specified, the entry in /etc/default/tar with digit "0" is the default.
-I include-file Opens include-file containing a list of files, one per line, and treats it as if each file appeared separately on the command line. Be careful of trailing white spaces. Also beware of leading white spaces, since, for each line in the included file, the entire line (apart from the newline) will be used to match against the initial string of files to include. In the case where excluded files (see X function modifier) are also specified, they take precedence over all included files. If a file is specified in both the exclude-file and the include-file (or on the command line), it will be excluded.

Remainder Syntax

-C directory file Performs a chdir (see cd(1)) operation on directory and performs the c (create) or r (replace) operation on file . Use short relative path names for file . If file is `.', archive all files in directory. This option enables archiving files from multiple directories not related by a close common parent.
file A path name of a regular file or directory to be archived (when the c, r or u functions are specified), extracted (x) or listed (t). When file is the path name of a directory, the action applies to all of the files and (recursively) subdirectories of that directory.

When a file is archived, and the E flag (see Function Modifiers) is not specified, the filename cannot exceed 256 characters. In addition, it must be possible to split the name between parent directory names so that the prefix is no longer than 155 characters and the name is no longer than 100 characters. If E is specified, a name of up to PATH_MAX characters may be specified.

For example, a file whose basename is longer than 100 characters could not be archived without using the E flag. A file whose directory portion is 200 characters and whose basename is 50 characters could be archived (without using E) if a slash appears in the directory name somewhere in character positions 151-156.

Examples

Note: A ".tar" file is not a compressed files, it is actually a collection of files within a single file uncompressed. If the file is a .tar.gz ("tarball") or ".tgz" file it is a collection of files that is compressed. If you are looking to compress a file you would create the tar file then gzip the file.



Creating a tar file:



tar -cvvf file.tar myfile.txt



In the above example the system would create a tar named file.tar in the directory you currently are in. Wildcards could also be used in this command, for example: tar -cvvf file.tar *.txt would compress all txt files in the current directory.



tar -cvvf home.tar home/



In the above example command the system would create a tar file named home.tar in the directory you currently are in of the home directory.



Extracting the files from a tar file:



tar -xvvf myfile.tar


In the above example command the system would uncompress (untar) the myfile.tar file in the current directory.



tar -xvvzf myfile.tar.gz



In the above example command the system would uncompress (untar) the myfile.tar.gz file in the current directory.



Note: There is no "untar" linux / unix command.



Creating a tarred file that is compressed with bzip



tar -cjvf test.tbz home/



Adding the j option to the tar command enables tar to compress files and/or directories using bzip. In the above example the home directory and all its subdirectories are added to the compressed test.tbz file.

Read more...

Extract Rar Files or Open Rar Files or Unrar Files in Linux, Ubuntu, Unix

How to Unrar Files or Extract rar archive files in Ubuntu / Centos / Linux / UNIX operating systems?

A RAR files are in compressed archive format, if you have downloaded rar files from the Internet, you need to unpack or unrar them (extract rar files).

RAR is a proprietary file format for data compression and archiving.

Under Ubuntu , Linux and UNIX, use command called unrar. By default unrar is not being installed on Ubuntu or Linux, FreeBSD or UNIX oses. You can install unrar command with the help of apt-get or yum command.

(See below for Windows XP info)
Install unrar command

In Debian Linux, you need to type apt-get as follows to install unrar program:
# apt-get install unrar

If you are using Fedora core Linux or Centos Linux then use yum command as follows (see discussion below):
# yum install unrar

If you are using FreeBSD, use:
# pkg_add -v -r unrar

If any of above, methods is not working for you, download binary package from official rarlab site:
$ cd /tmp
$ wget http://www.rarlab.com/rar/rarlinux-3.6.0.tar.gz

Untar file
$ tar -zxvf rarlinux-3.6.0.tar.gz

Both unrar and rar commands are located in rar sub-directory. Just go to rar directory:
$ cd rar
$ ./unrar

Now copy rar and unrar to /bin directory:
# cp rar unrar /bin


How to use unrar :-

unrar command supports various options below are common options that you need to use everyday.
Task: To open rar (unpack) file in current directory type command:

$ unrar e file.rar
Please note that replace file.rar filename with your actual filename.

Task: List (l) file inside rar archive:

$ unrar l file.rar

Task: To extract (x) files with full path type command:

$ unrar x file.rar
(D) To test (t) integrity of archive, file type command:
$ unrar t file.rar

Read more...

Airtel Data Card Reader Driver install in Ubuntu, Linux

Saturday, May 16, 2009

*************************************************************

----Airtel Data Card Reader Driver install in Ubuntu----------

*************************************************************

Step 1:
Firstly Connect your Data card to usb port

Step 2:
plugin the datacard and type on command prompt : ls /dev/ttyUSB*
check if the following files are listed
/dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2 /dev/ttyUSB3
if not then

Step:3
Download the file : huaweiAktBbo.c
(http://www.kanoistika.sk/bobovsky/archiv/umts/huaweiAktBbo.c)
type lsusb and check the output ...

It should b something like this:

ritvik@ritvik-laptop:$ lsusb
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 005: ID 12d1:1001 Huawei Technologies Co., Ltd. E620 USB Modem
Bus 001 Device 001: ID 0000:0000

line number 5 shows the vendor ID is 0x12d1 and product ID is 0x1001

Step:4
now open the huaweiAktBbo.c file and search for

vendor = 0x12d1;
product = 0x1003;
and replace dem with your values...
vendor = 0x12d1;
product = 0x1001;
in my case

The libusb-dev package is required to compile the c file..

Step:5
to install it Ubuntu or Debian users Type:
sudo apt-get install libusb-dev

Compile:
gcc huaweiAktBbo.c -o huaweiAktBbo -lusb
Run:
sudo huaweiAktBbo
if this not run then follow this command
Run:
./huaweiAktBbo

step:6
Download the GUI from betavine:
https://forge.betavine.net/frs/?group_id=12&release_id=116

pick your choice from the list whichever is applicable for you and download the software..
After Download file
follow these two command on ubuntu
root@ritvik-laptop:~/home/xc/Desktop#chmod +x vodafone-mobile-connect-card-driver-for-linux-2.0.beta2-ubuntu-installer.run

root@ritvik-laptop:~/home/xc/Desktop#./vodafone-mobile-connect-card-driver-for-linux-2.0.beta2-ubuntu-installer.run


On running the setup it might get stuck for a while downloading dependencies ... so get a cup of coffee and get back...if it is still not done then wait ..if dere is a message Installation complete den everthing is fyn..


once the software is installed then run it from the applications--> internet --> vodafone ...
a windows will pop up listing the devices found ..press ok if your device is listed ....den make a new profile ...

give a profile name... username and password (if it is not to authenticate your account den give some random values)...choose your connection type and authentication mode and den give the APN... for example ,


step:7
for airtel india users it is

Set APNHost:airtelgprs.com

check it with your service provider...
its done.. now connect and enjoy....

*************************************************************

Read more...

Fcheck File System Security on Linux, Unix

Wednesday, April 15, 2009

Fcheck File System Security on Linux, Unix :-
Download fcheck (see resources) and unpack it. fcheck is a cross-platform Perl script which runs on UNIX and Windows systems (as long as they have Perl installed).

$mkdir /usr/local/fcheck
$cp fcheck /usr/local/fcheck
$cp fcheck.cfg /usr/local/fcheck

Edit /usr/local/fcheck/fcheck.cfg with your favorite editor and change the following values:
Directory, FileTyper, Database, Logger, TimeZone, and Signature.

# Directories that will be monitored
# if there is a trailing / it will be recursive

Directory = /etc/
Directory = /bin/
Directory = /sbin/
Directory = /lib/
Directory = /usr/bin/
Directory = /usr/sbin/
Directory = /usr/lib/
TimeZone = PST8PDT # For Pacific Standard

# Database of file signatures

DataBase = /usr/local/fcheck/sol.dbf

Logger = /usr/bin/logger -t fcheck

# Utility to determin file type

FileTyper = /bin/file

# What to use to create signatures Database of
# file signatures

$Signature = /usr/bin/md5sum#
DataBase = /usr/local/fcheck/sol.dbf
Logger = /usr/bin/logger -tfcheck

# Utility to determin file type

FileTyper = /bin/file

Also edit the fcheck script and change the path of the configuration file to /usr/local/fcheck/fcheck.cfg

Then run fcheck for the first time to create the baseline database.

# Options explained:
# c create the database
# a is for all
# d is to monitor directory creation
# s is to create signatures for all files
# x is for extended permissions monitoring

$ ./fcheck -cadsx

To test that everything has been setup correctly run the following commands and fcheck should alert you to the difference.

$ touch /etc/FOO
$ ./fcheck -adsx

fcheck should display some information about /etc/FOO. $rm /etc/FOO will prevent future messages.
Next, create a short shell script that will be run periodically by cron and check for changes. Open your favorite editor and create /usr/local/bin/fcheck_script.

When using the `cron` utility lookout for _symlink attacks_ :-

#!/bin/bash
# Use mktemp instead of $$ to prevent sym-link attacks
FCHECK_LOG=`mktemp`

# Grep for any changes
/usr/local/fcheck/fcheck -adsx \
| grep -Ev ^PROGRESS: |^STATUS:^$ > $FCHECK_LOG

# If there were any changes email the sys-admin
if [-s $FCHECK_LOG ] then
/usr/bin/mail -s fcheck \
`hostname` youremail@yourprovider.com < \
$FCHECK_LOG
/bin/rm $FCHECK_LOG
fi

The cron utility will be used to run periodic checks of the file-system and will compare it to the baseline database. The following command will edit root’s crontab:

$ crontab -e

# Add this line to run the script every 15 minutes
# using nice lower priority when the system load
# is high.
*/15 * * * * nice /usr/local/bin/fcheck_script > \
/dev/null

Symlink Attacks
:-

Side Note: Symlink Attacks running an IDS package usually involve running a script at a pre-configured time using the cron utility. This opens up systems to symlink attacks. Symlink Attacks rely on the attacker knowing that a certain file is going to be created at a certain time with a certain name. A common shell scripting technique that generates some randomness is the use of $$, which is the PID of the running script. However, this is vulnerable to Symlink Attacks because most PIDs are below 35K and most file systems can have 35K files. The correct technique is the use of mktemp, which is a truly random file name.

Read more...

File System Security on Linux, Unix

File system security on Linux, Unix :-

There is a File System Security on Linux like Red Hat, Ubuntu, Centos and Unix System.
The UNIX file system has several standard directories: /, /tmp, /var, /usr and /home. The two that present the weakest links for a variety of attacks are /tmp and /var. The two most common attacks are: “Denial of Service”, by causing the root partition to fill up with logs or other junk (assuming all these directories are mounted on one partition); and running rootkits from the /tmp directory.

One solution to file system Denial of Service attacks is to have these directories mounted on their own partitions, this will prevent the / file system from filling up and stop that avenue of attack.

Rootkits typically write to the /tmp directory and then attempt to run from /tmp. A crafty way to prevent this is to mount the /tmp directory on a separate partition with the noexec, nodev, and nosuid options enabled. This prevents binaries from being executed under /tmp, disables any binary to be suid root, and disables any block or character devices from being created under /tmp.

Edit /etc/fstab with your favorite editor, find the line corresponding to /tmp and change it to look like this one.
/dev/hda2 /tmp ext3 nodev,nosuid, noexec 0 0

Wikipedia [6] defines rootkits as a set of software tools frequently used by a third party (usually an intruder) after gaining access to a computer system. This translates to custom versions of ps that won’t list the irc server the attacker installed, or a custom version of ls that doesn’t show certain files. Tools like chkrootkit must be run in combination with IDS systems like fcheck to prevent the successful deployment of rootkits.

chkrootkit is very simple to run, and doesn’t require any installation or configuration.

It’s a good idea to run chkrootkit at regular intervals, see the script below used by fcheck for inspiration.

# Use the wget utility to download the latest
# version of chkrootkit

wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz
tar -xzvf chkrootkit.tar.gz
cd chkrootkit-version (whatever version is)
./chkrootkit

The next layer of file system security is maintaining and verifying the integrity of configuration files that are typically located under /etc. Intrusion Detection Systems (IDS) allow us to create cryptographic identifiers of important configuration files and store them in a database. They are then periodically re-created and verified against those stored in the database. If there is a mis-match, the file has been changed, you know your system integrity has been violated and which aspects of it are affected. Two well known IDS packages are tripwire and fcheck, which work equally well. However, fcheck has a much simpler configuration and installation process, which is why I favored it for this article.
see file system security by fcheck

Read more...

How To Install Ubuntu Linux, Ubuntu Installation Guide

Monday, March 23, 2009

Ubuntu Graphical Installation :-
Installation :-

There are many common ways to install and run Ubuntu. You can run Ubuntu:
• as your sole operating system (single booting).
• in addition to another operating system (dual booting).

• within your existing operating system (virtualization).
• from your CD disc drive, using the Live CD.
• in addition to Windows, using Window's Boot Manager, via the Wubi installation
NOTE: Prior to installing Ubuntu, it is recommended that you back up your computer files.
Downloading Ubuntu or Getting Ubuntu :-

There are many ways to get an Ubuntu installation disk, so download and burning your own

To download Ubuntu:
1. Using your web browser, navigate to http://www.ubuntu.com/getubuntu/download

2. Select Desktop Edition, and then click Ubuntu 8.10 or Ubuntu 7.04.
3. In the Choose a download location near you menu, select the location closest to you.

4. Click Begin Download. A pop up window opens, prompting you where to run or save the file.
5. In Internet Explorer, click Run to automatically open the installation file in a CD burning utility or
click Save to save the file to your disk. In Mozilla Firefox, select Open with to open the installation file in a CD burning utility or select Save File to save the file to your disk.
After downloading the Ubuntu installation CD image, you need to burn it to a CD or DVD.

To burn the installation disk to a CD or DVD:
1. Place a recordable CD or DVD into your CD/DVD drive.
2. Load an application that is capable of burning .ISO image files to CDs or DVDs.

3. Using your CD and DVD writing program, copy the disk image to your blank CD or DVD.
To Install Ubuntu :-

To Install Ubuntu First insert the Ubuntu CD into your CD/DVD-ROM drive.

Wait a few seconds and you will see a window on your screen called Ubuntu 8.0 or 7.04

If you click where it says "Boot from this CD to try Ubuntu without affecting your system.
" you will see a page with screenshots and information about Ubuntu Linux. From this page, you will learn that in order to boot from this CD you must close all your running applications and reboot the PC.
After the reboot, you will see a welcome screen with some options:

1. Start or install Ubuntu
2. Start Ubuntu in safe graphics mode
3. Install with driver update CD

4. Check CD for defects
5. Memory test
6. Boot from first hard disk

Ubuntu can be installed with the graphical CD. Make sure that your computer is set to boot from a
CD before a hard drive.
1. Insert the Ubuntu disc into your CD drive.
2. Start or restart your computer. The Language screen appears. If you reboot your computer and do not see the following screen, please refer to Boot From CD Install.


3. Select your desired language and press Enter. The startup window appears.


4. Select Install Ubuntu and press Enter. The Welcome window appears.



5. From the taskbar, choose your preferred language. Click Forward. The Where are you? window appears.


6. From the Selected city box, choose your closest location. Click Forward. The Keyboard layout window appears.


7. Select your keyboard layout. To test if you have chosen the correct layout, enter characters in the text box. Click Forward. The Prepare disk space window appears.
8. If you want to install Ubuntu over your entire hard drive, then Select Guided – use entire disk and select the hard drive that you want to install Ubuntu. Click Forward. The Who are you? window appears.


WARNING: Installing Ubuntu on your entire hard disk will erase all data that is currently on the drive.

OR
8. If you want to install Ubuntu on a single partion Dual Booting, Select Guided – resize. In the New partition size area, drag the area between the two partitions to create your desired partition sizes. Click 'Forward. The Who are you? window appears.



9. In the What is your name? field, enter your name.


10. In the What name do you want to use to log in? field, enter a login name.
11. In the Choose a password to keep your account safe field, enter a password in both text boxes.
12. In the What is the name of your computer? Field, enter a name to identify your computer.
13. If you are the only user and wish to avoid the login screen, check Log in automatically (optional).
14. Click Forward. The Ready to install window appears.


15. Verify that the language, layout, location, and personal information are correct and click Install. The installation wizard begins.
16. When the installation wizard finishes, the installation complete window appears.


17. Click Restart now to restart your computer. Ubuntu is now installed.

Read more...

About This Blog

Lorem Ipsum

  © Copyright 2009 Linux-HelpLine.Blogspot.com

Back to TOP