It is currently Sun Dec 22, 2024 10:39 am

News News of Linux specific

Site map of Linux specific » Forum : Linux specific

Linux specific questions/information are gathered here. The main thrust of topics are applied to Centos/RedHat(RH)/Debian/Ubuntu/Gentoo distributives
Forum rules
All information is given AS IS

Enable date-stamp in your .bash_history file

Enable date-stamp in your .bash_history file

While it’s easily cleared by a malicious person, this can easily extend the usefulness of your history file with the information of when you ran that command.

This works in bash v3 and up.

If you’d like to add the time-stamping to all users on the machine, the file you’d want to edit is probably /etc/profile. If not, add it to your .bash_profile in your home directory (~).

Add ...
Read more : Enable date-stamp in your .bash_history file | Views : 2690 | Replies : 0


Stracing a program

Suppose some program on your system refuses to work or it works, but much slower then you've expected. How can you investigate the reason of such undesirable behaviour? First of all, you can read and analyze logs that this program does (if it does). It's very useful to run unkindly program with --verbose argument or somehow else increase the log level, if the program allows that. But what can you do, if logs are poor ...
Read more : Stracing a program | Views : 2246 | Replies : 0


SSH login notification on email

Add following line to ~/.bash_profile:
Code: Select all
echo -e 'ALERT - Root Shell Access on:\n' `who -m` '\n' `date` | mail -s "Successfull Root Login" [email protected]
Read more : SSH login notification on email | Views : 2150 | Replies : 0


Disable SELinux on CentOS 5

Security-Enhanced Linux, also know as SELinux, implements various security policies on Linux and additional levels of access crontrol. It was originally developed by the U.S. National Security Agency to adhere to the "Orange Book" guidelines. On CentOS 5 it is enabled by default, but there may be circumstances where you don't need SELinux's additional security and may want to disable it.

The SELinux configuration file on CentOS is located at /etc/selinux/config and after a default ...
Read more : Disable SELinux on CentOS 5 | Views : 4043 | Replies : 0


Clear current session history

To clear current session history run the following command:
Code: Select all
history -r
Read more : Clear current session history | Views : 2906 | Replies : 0


Using the Webmin YUM repository

Using the Webmin YUM repository

If you like to install and update Webmin via RPM, create the /etc/yum.repos.d/webmin.repo file containing :
Code: Select all
[Webmin]
name=Webmin Distribution Neutral
baseurl=http://download.webmin.com/download/yum
enabled=1

You should also fetch and install my GPG key with which the packages are signed, with the command :
Code: Select all
rpm --import http://www.webmin.com/jcameron-key.asc

Then we FIRST install SSLeay, or secure connection to webmin server won't be possible
Code: Select all
yum install perl-Net-SSLeay

Finally we install webmin :
Code: Select all
yum install webmin
...
Read more : Using the Webmin YUM repository | Views : 6285 | Replies : 2


Compile a new kernel - CentOS way (make rpm)

This article is about compiling a kernel on CentOS systems. It describes how to build a custom kernel using the latest unmodified kernel sources from http://www.kernel.org/ (http://en.wikipedia.org/wiki/Vanilla_kernel#Versions) so that you are independent from the kernels supplied by your distribution.

One of the multiple ways of building a kernel for CentOS systems to get you a kernel rpm package that can be installed or shared with others.

Building a Kernel rpm Package

1. Download The Kernel ...
Read more : Compile a new kernel - CentOS way (make rpm) | Views : 8218 | Replies : 0


Tracing what a Linux process is doing

From time to time you will get hanged process or you are unsure of what a process is doing at that moment.

You can trace what a process is doing by running:
Code: Select all
strace -p PID

Where PID is the process ID. Whis will show you what that process is doing in real time.
This is usefull for detecting exploits or the source of a hang process.
To detach from that process simply press CTRL + ...
Read more : Tracing what a Linux process is doing | Views : 5737 | Replies : 2


Booting fallback systems with GRUB

GRUB supports a fallback mechanism of booting one or more other entries if a default boot entry fails. You can specify multiple fallback entries if you wish.

Suppose that you have three systems, `A', `B' and `C'. `A' is a system which you want to boot by default. `B' is a backup system which is supposed to boot safely. `C' is another backup system which is used in case where `B' is broken.

Then you ...
Read more : Booting fallback systems with GRUB | Views : 2327 | Replies : 0


Linux Software RAID (MDADM)

Managing Linux Software RAID

Marking a damaged disk as failed:
Code: Select all
mdadm --manage --set-faulty /dev/md1 /dev/sdd1

Removing the damaged disk from the array:
Code: Select all
mdadm /dev/md1 -r /dev/sdd1

Shutdown your system, bring it up into single user mode and partition and format your new disk. Set the partition type as Linux Software RAID autodetect. Of course you need to partition your new disk the same as the previous one. Bring the machine up into it's default runlevel, ...
Read more : Linux Software RAID (MDADM) | Views : 6817 | Replies : 2


 

Login


Statistics

Total posts 505 • Total topics 442 • Total members 22

cron