Hack 66. Format a partition using mke2fsk
After partitioning the disks, it is still not ready for usage, as we need to format the disk. At this stage, if you try to view the disk information, it will give the following error message indicating...
View ArticleHack 67. Mount the partition
After creating a partition and formatting, you can mount it to a mount point. Create a directory to mount First create a directory where the partition should be mounted. # mkdir /home/database Mount...
View ArticleHack 68. Fine tune the partition using tune2fs
Use the tune2fs –l /dev/sda1 to view the filesystem information as shown below. # tune2fs -l /dev/sda1 tune2fs 1.35 (28-Feb-2004) Filesystem volume name: /home/database Last mounted on: Filesystem...
View ArticleHack 69. Create a swap file system.
Create a file for swap usage as shown below. # dd if=/dev/zero of=/home/swap-fs bs=1M count=512 512+0 records in 512+0 records out # ls -l /home/swap-fs -rw-r--r-- 1 root root 536870912 Jan 2 23:13...
View ArticleHack 70. Create a new user
Add a new user – Basic method Specify only the user name. # useradd jsmith Add a new user with additional Parameter You can also specify the following parameter to the useradd -c : Description about...
View ArticleHack 71. Create a new group and assign to an user
Create a new developer group. # groupadd developers Validate that the group was created successfully. # grep developer /etc/group developers:x:511: Add an user to an existing group.
View ArticleHack 72. Setup SSH passwordless login in OpenSSH
You can login to a remote Linux server without entering password in 3 simple steps using ssky-keygen and ssh-copy-id as explained in this example. ssh-keygen creates the public and private keys....
View ArticleHack 73. Use ssh-copy-id along with ssh-agent
Using ssh-copy-id along with the ssh-add/ssh-agent When no value is passed for the option -i and If ~/.ssh/identity.pub is not available, ssh-copy-id will display the following error message....
View ArticleHack 74. Crontab Basic Guide
Using cron you can execute a shell-script or Linux commands at a specific time and date. For example a sysadmin can schedule a backup job that can run every day. How to add a job to the cron? # crontab...
View ArticleHack 75. Safe Reboot Of Linux Using Magic SysRq Key
The magic SysRq key is a key combination in the Linux kernel which allows the user to perform various low level commands regardless of the system’s state. It is often used to recover from freezes, or...
View Article