Interacting with Screen
Screen is a terminal multiplexer that allows you to manage many processes through one physical terminal. Each process gets its own virtual window, and you can bounce between virtual windows interacting with each process. The processes managed by screen continue to run when their window is not active.
Before actually running screen, it’s important to understand how to interact with it. Screen sends all entered text to the current window, with the exception of the command character. The default command character is Ctrl-A (press the Ctrl and the A key at the same time).
With screen, a simple Ctrl-A C will create a new screen window with a new shell process.
An example of this is Ctrl-A C and Ctrl-A Ctrl-C to create a window.
You can delete a window manually with the kill command (default Ctrl-A K). When you exit all of the screen windows, screen exits. You also can tell screen to exit and kill all of your windows by issuing the quit command (Ctrl-A \).
You can re-attach to the session in a few ways. You can give a session name explicitly with screen -r sessionname.
You can detach from your session using Ctrl-A D.
You can enter copy mode with Ctrl-A [
If you are using copy mode for scrollback only, it can be exited at any time with the Esc key.
To copy text, maneuver the cursor to the beginning of the desired text, and press the spacebar to mark it. Then position the cursor over the end of the text you'd like and press the spacebar again to mark it. When you mark the end, the text is copied into screen's internal copy buffer, and copy mode is exited. You can paste the text in your copy buffer into the active window with Ctrl-A ].
CentOS - Development Tools Install
CentOS has some handy meta-packages that include a set of pre-defined programs needed for a single purpose. yum is an interactive, automated update program which can be used for maintaining systems using rpm
So instead of installing a dozen different package names, you can install just one meta-package. One such package is called ‘Development Tools’. Issue the command.
sudo yum groupinstall ‘Development Tools’
Notice the programs that are to be installed include gcc, make, patch and so on. All these are needed for many other programs to install properly. A neat system indeed.
Other Yum Options:
groupinstall group1 [group2] [...]
groupupdate group1 [group2] [...]
grouplist [hidden]
groupremove group1 [group2] [...]
groupinfo group1 [...]
Advantages of PAM
Pluggable Authentication Modules (PAM) is a way of allowing the system administrator to set an authentication policy without having to recompile authentication programs. With PAM, you control how particular authentication modules are plugged into a program by editing that program’s PAM configuration file in /etc/pam.d
When used correctly, PAM provides many advantages for a system administrator, such as the following:
*A common authentication scheme that can be used with a wide variety of applications.
*PAM can be implemented with various applications without having to recompile the applications to specifically support PAM.
*Great flexibility and control over authentication for the administrator and application developer.
*Application developers do not need to develop their program to use a particular authentication scheme. Instead, they can focus purely on the details of their program.
Using sysctl
The sysctl command can make viewing, setting, and automating special kernel settings very easy.
sysctl - configure kernel parameters at runtime, sysctl is used to modify kernel parameters at runtime. The parameters available are those listed under /proc/sys/. Procfs is required for sysctl support in Linux. You can use sysctl to both read and write sysctl data.
To get a quick overview of all settings configurable in the /proc/sys directory, type the sysctl -a command as root. This will create a large, comprehensive list, a small portion of which looks something like this:
root@dell:~# sysctl -a
kernel.sched_min_granularity_ns = 4000000
kernel.sched_latency_ns = 20000000
kernel.sched_wakeup_granularity_ns = 5000000
kernel.sched_shares_ratelimit = 250000
kernel.sched_child_runs_first = 1
kernel.sched_features = 7935
You can manually assign values to writable files by echoing the value to the file.
The sysctl command is able to do the same thing by typing the sysctl -w [file]=”[new-value]“ command. For example, to activate the System Request Key, the following command is required:
root@dell# sysctl -w kernel.sysrq=”1″
kernel.sysrq = 1
To preserve the settings that you like to make permanently to your kernel, add them to the /etc/sysctl.conf file.
Any values added to /etc/sysctl.conf will take effect right after the system boots with no need to reconfigure and rebuild the kernel to incorporate the change.
Directories in /proc
Every /proc directory contains quite a few directories named with a number. A listing of them starts off like this
These directories are called process directories, as they refer to a process’s ID and contain information specific to that process. The owner and group of each process directory is set to the user running the process. When the process is terminated, its /proc process directory vanishes. However, while the process is running, a great deal of information specific to that process is contained in the process directory’s various files.
# ls -l /proc
total 0
dr-xr-xr-x 7 root root 0 2010-07-02 21:37 1
dr-xr-xr-x 7 root root 0 2010-07-02 21:37 10
dr-xr-xr-x 7 root root 0 2010-07-02 21:37 1066
dr-xr-xr-x 7 root root 0 2010-07-02 21:37 11
dr-xr-xr-x 7 root root 0 2010-07-02 21:37 12
dr-xr-xr-x 7 root root 0 2010-07-02 21:37 13
dr-xr-xr-x 7 root root 0 2010-07-02 21:37 14
dr-xr-xr-x 7 root root 0 2010-07-02 21:37 15
dr-xr-xr-x 7 root root 0 2010-07-02 21:37 16
Common groups of information concerning the kernel is grouped into directories and sub-directories within /proc.
Each of the process directories contains the following files:
cmdline — Contains the command line arguments that started the process.
cwd — A link to the current working directory for the process.
cpu — Provides specific information about the utilization of each of the system’s CPUs.
environ — Gives a list of the environment variables for the process.
exe — A link to the executable of this process.
fd — A directory containing all of the file descriptors for a particular process.
maps — Contains memory maps to the various executables and library files associated with this process.
mem — The memory held by the process.
root — A link to the root directory of the process.
stat — A status of the process.
statm — A status of the memory in use by the process.
status — Provides the status of the process in a form that is much more readable than stat or statm.