Pawan Sharma | June 10, 2011 | | Be the first to comment!

Group Administration

In the last post I described about the the user administration. After user administration another task is to manage groups. 
To see the present groups in your system you can type groups command. The /etc/group maintains the group membership information. You create groups and add users to a group using both GUI tool and Command line, but I will suggest you to use command line because it is fast and easy. Once you have been familiar with the command line you will enjoy using it the most.

To create new group you can edit /etc/group file or you can run the following command:
  • groupadd group_name : this will add a group named group_name in /etc/group.
  • groupdel group_name : this will delete a group named group_name in /etc/group.
  • groupmod : modifies group members.
  • chgrp : to change group permissions.
GROUP ADMINISTRATION
 To add users named donna to a group named sales you can run the following command:
  • usermod -G sales donna : this command will add user donna to the group sales.
OR
  • You can add user donna directly to the /etc/group 
    • sales:x:503:donna

To add a user to a group at the time of creation of user, you can type the following command:
  • useradd -G sales mike : this command will make a user mike and add it to the sales group.
You can also use Graphical User Interface for user and group administration.
To open the USER and GROUP GUI run system-config-users at the command line or
  • Go to System-->Administration-->Users and Groups.
You can do a lot with users and groups like provide special privileges to specific users or groups and also can do the group collaboration. We will discuss these topics in the next post.
..................................................................................................................................................................
Pawan Sharma | June 8, 2011 | | Be the first to comment!

Basic Linux Commands

To start-up with the Linux first someone needs to know about the basic Linux commands. These commands are common in all Linux distributions. If you know these basic Linux commands, it will be easy for you to get further in in your goal to achieve a RedHat Certification.

To be a system administrator you need to know how to manage the server using command line, because you will hardly allowed to use GUI. Because most of the system administration tasks are managed remotely using the secure shell also known as SSH. So use the command line as much as possible.

Basic Linux Commands and there explanation is given below:

  • uname :- this command returns the name of Operatng System.
  • uname -a :- using :- "a" option with uname command, you will get the following information:
    • Operating System : Linux.
    • Fully Qualified Domain Name.
    • Kernel Version.
    • Date and time that the kernel was compiled.
  • tty :- reveals the current terminal.
  • echo :- prints to the screen.
  • set :- prints and optionally sets shell variables.
  • clear :- clears the screen / terminal.
  • reset :- resets the screen buffer
  • pwd :- prints the path of working directory.
  • whoami :- reveals the current logged-in user.
  • which programe_name :- reveals the path of the program / command.
  • history :- reveals your command history.
  • cd :- changes directory to desired directory:
    • cd with no option will changes to the home directory.
    • cd ~ will also change to the home directory.
    • cd /  will change to the root (/) directory
    • COMMAND LINE
    • cd ..  will change one level up in the directory tree.
  • ls  :- lists files and directories.
    • ls / lists the contents of / (root) directory.
    • ls -l will lists in long format. This command shows properties of files and directories.
    • ls -a will list all files including hidden files which starts with a period (.).
    • ls -ld will show properties of the directory.
  • cat  :- catinates files. Create files and also show contents of files.
    • cat 123.txt dumps the contents of the file 123.txt.
    • cat > xyz creats new file xyz. You can write to the file and save using ctrl+d.

  • mkdir  :- creates a new directory.
  • cp :- copies files
  • mv :- moves and rename files.
  • rm :- remove files.
  • touch :- create a blank file.
  • stat :-  reveals the statistics of a file.
  • find :- finds files using search pattern.
    • find / -name filename will search the file named filename in the / directory/
  • alias :- return/set aliases for command.
  • more/less :- display one page at a time.
  • head :- display opening lines of a file.
  • tail :- display cloasing lines of a file.
  • wc :- counts words and optionally lines and characters in a file.
  • grep :- search for text in a file.
  • su :- to switch user.
  • man command_name  :- open manual for that command.
 These are the the basic Linux commands. But there are a lot more commands, you will learn command while using it, it will take time but more you work in linux more you learn.

NOTE : There are many options which can be used with these commands or other commands. Always view man pages of command to find different options. I think using man command is very good habit.

Please comment on the post. You can also write questions and I would love to answer your questions and help you.