Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Tip: Anatomy of "SELinux" or Security-Enhanced Linux

Linux ® has been described as one of the most secure operating systems available, but the National Security Agency (NSA) took Linux to the next level with the introduction of Security-Enhanced Linux (SELinux). SELinux takes the GNU / Linux operating system and extends it with a kernel and user space, changes to make bullet-proof. If you use a 2.6 kernel today, you might be surprised to know that you are using SELinux now! This article explores the ideas behind SELinux and how it is implemented.

The public networks like the Internet are dangerous places. Anyone who has a computer connected to the Internet (even temporarily) understands these dangers. Hackers can exploit the insecurity to access a system, to obtain unauthorized access to information, repurpose or a computer to send spam or participate in attacks on other high-profile systems ( using the SYN flood, as part of a Distributed Denial of Service attacks).

Read more at IBM.com


Read more...

Screen for Power Session

Screen is a full-screen window manager of the console, which comes with every flavor of UNIX and Linux. He is best known for multiplexing a physical terminal between several processes. By using it, you can run any number of console-based applications within a single hotel.
For example, suppose I want to launch the 'top' to keep track of the system load, change my programming code and check my mail at the same time ... Usually, I must open at least 3 terminals to do that. But using the screen utility, I can run all these programs at the same time and physical terminal. Another feature of this wonderful utility is its ability to separate the terminal emulator program running, which ensures your work is in progress, even if you inadvertently close your window, or where you disconnect. After detaching, you can once again over the same session and resume control of the management jobs.
Here how to use this utility.

1) First open a terminal and type :
$ screen
2) Screen starts and creates a new single window with a shell, pretty much like what you had before. The path name of the shell is taken from the $SHELL variable. New windows can be created within the same physical terminal using the screen commands.
3) Now that you have started screen in a terminal, suppose you want to run the 'top' program to check the System load and at the same time you want to compile a program too - Also you would like to switch between the two to see the progress made by both.
For that, first execute the first program to be run (say 'top'). now 'top' will start in the terminal.
Now open a new window in screen by pressing the '[Ctrl + a] c' - which I will state as 'C-a c' . This will create a new window in the same terminal. Here, you can give commands to compile your program.
In screen, each window is given a unique identifier. The first window is numbered 0, the next window is 1 and so on. Now to switch between your 'top' and the compiling program, you can use the key 'C-a 0' and 'C-a 1' respectively.
You can also associate names with each running window - use 'C-a A' to give a name to the current window.
Here are a few other commands that might come in handy while toggling between various running windows :
  • 'C-a p' and 'C-a n' can be used to switch to the next or previous window respectively.
  • 'C-a N' - where N is the number from 0 to 9, that can be used to jump to the corresponding window.
  • 'C-a w' displays a list of all windows. The unique ID of each window with its name and running process is displayed, for each window. The current window is marked with an asterisk(*).
  • 'C-a k' - can be used to kill the current window. You can also type 'exit' to kill the current window. If no more windows are open, then screen exits. 'C-a \' also does the same thing.
  • 'C-a d' - detaches the present screen session. You can also detach by closing the terminal running your screen utility. Though, this appears to close your terminal session, in reality this does not happen. It only unbinds your session from the current terminal. All the programs started under screen will still keep running.
You can also log out from the machine and re-login. Then start any terminal session and type 'screen -r' to once again be connected from where you left.
In case, there were more than one screen sessions running on the machine, Screen prompts for a host.tty.pid.
For example, say I have two screen sessions. So when I type 'screen -r' command, it gives the following message:
$ screen -r
There are several suitable screens on:
2999.pts-6.localhost (Detached)
1920.PTS-6.localhost (Detached)
Type
"screen [-d] -r [pid].tty.host" to resume one of them.
Choose the right tty.host to connect and you control your program. You can also share your screen session with others as the use of VNC. Imagine that you are having a problem with your code and you want to share with your boss which is located in another office. You can use the screen to share your session with your boss, and he can see what you are referring. The first user launches the screen in normal mode and executes the following ...
User1:
[Ctrl-A]:multiuser on [RET]
[Ctrl-A]:acladd
The second user starts a new screen session and connects it to the first session using ...
User2:
screen -x
Screen website at Official Screen Home Page


Read more...

Guide to add a new drive partition to an existing system

Suppose that you are obliged to create a partition of 10 GB on your server running Linux, you have two options:

  • Create a partition of unpartitioned space on your machine or
  • Add a new disc drive.

If you opt for the latter, it is a simple matter of connecting the new disc, allowing the system to detect, through a partitioning tool to create the necessary partitions, formatting the newly created partition and finally mounting. But if it is the former namely, the creation of a partition of the non-partitioned space, the task becomes a little more difficult.

Joey Prestia explains the steps necessary to add a new partition to an existing system. The task can be broken down into the following steps:

  1. Determine what partitions must be created and where.
  2. Create partitions (I use fdisk here, but Linux partitioning tool should work)
  3. Re-read the partition table with either "partprobe" or by a reboot
  4. Make a file system on the partition, label and create mount points
  5. Add the entries in "/etc/fstab" so that the partitions are mounted on restarting

See Joey notes to know exactly the commands used to accomplish the above tasks.


Read more...

Play encrypted DVD in Ubuntu

I am sure that all users of Ubuntu swear by the fact that this is a piece of cake to get multimedia work in Ubuntu. In fact Ubuntu walks a fine line to ensure that users who are passionate about freedom and those who are willing features are planned.

But reading encrypted DVD is a little tricky. Tech-recipes.com provides a simple way to enable DVD playback in Ubuntu.

In fact, there are just two simple steps namely,

$ sudo apt-get install totem-xine libxine1-ffmpeg libdvdread3
and
$ sudo /usr/share/doc/libdvdread3/install-css.sh


Read more...