I am here to share my knowledge in Linux with all.The opinions expressed and topics discussed on this blog are my own and don't necessarily reflect those of my employer.
Saturday, September 20, 2008
Secure Shell
Tuesday, September 16, 2008
VNC configuration in RHEL 4 and RHEL 5
#chkconfig vncserver on
Restart the service
#service vncserver start
#vncserver
New '
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/Server_Ip_Address:3.log
#vncpasswd
Password:
Verify:
# vim /root/.vnc/xstartup
The entry should look like as follows,
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
Now u can view through vnc viewer using Server_Ip_Address:1
Thursday, September 11, 2008
What is in /etc/fstab?
The first field, (fs_spec), describes the block special device or remote filesystem to be mounted.
A block special device node (like /dev/cdrom or /dev/sdb7. For procfs, use proc.
The second field, (fs_file), describes the mount point for the filesystem. For swap partitions, this field should be specified as none.
The third field, (fs_vfstype), describes the type of the filesystem. Linux supports lots of filesystem types, such as adfs, affs, autofs, coda, coher-ent, cramfs, devpts, efs, ext2, ext3, hfs, hpfs, iso9660, jfs, minix, msdos, ncpfs, nfs, ntfs, proc, qnx4, reiserfs, romfs, smbfs, sysv, tmpfs, udf,ufs, umsdos, vfat, xenix, xfs, and possibly others.
For the filesystems currently supported by the running kernel, see /proc/filesystems. An entry swap denotes a file or partition to be used for swapping, cf. swapon (8). An entry ignore causes the line to be ignored.This is useful to show disk partitions which are currently unused.
The fourth field describes the mount options associated with the filesystem. By Default, it will be defaults.
The fifth field is used for these filesystems by the dump command to determine which filesystems need to be dumped. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be dumped.
The sixth field is used by the fsck program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked.
Wednesday, September 10, 2008
What is Iptables ?
Tuesday, September 9, 2008
Some Basic Commands in Linux
Basics commands in Linux
The ls command
ls ----- Command is equivalent of the DOS dir command. It lists the files and subdirectories contained within the present directory.
Some possible flags which can be used with the ls command are:
ls -a List all files including hidden files which starts with.(Dot).these hidden files will not be displayed with simple ls command
ls | more Lists files and directories page after page on keystroke. The above command actually is a combination of two commands. It introduces a new concept called
ls –R It lists the files and subdirectories of a directory and further lists the contents of each subdirectory recursively. The ou
pwd The pwd or the present working directory command gives you the path to the directory in which you presently are. It is used without flags simply as
su Many times you might have logged in as a normal used and might need to be root to install a software or for some other small task. You could logout then login as root complete the work logout and login back as a normal user. Instead, you can just use the su command. The format is:
su username
e.g.: su root
When you
whoami It will tell you which user you are logged in as. Useful when you have used
cp This one copies files / directories from one place to another its syntax is
cp source_file_with_path destination_path
e.g.: cp /home/bala/secret.txt /f
This would make a copy of secrets.txt from /home/bala to /f
cp –i Interactive copying, prompts before overwriting files or directories
cp -l source_file_with_path destination_path
Makes a link (shortcut) to the source_file at the destination path instead of actually copying it there.
cp –p Preserve file attributes while copying if possible
cp –R Copy Recursively. Used when copying directories. This command also copies the contents of the subdirectories.
cp –u Update i.e. Copy only if the source file is newer than the destination file or the destination file does not exist.
rm The rm command is used to remove or delete files or directories. Its general format is:
rm -flag file_or_directory_with_path
Eg: rm /home/bala/recycle.txt
Some flags which can be used with the rm command are
rm -v test.txt
Remove verbosely, explain what is being done.
rm -r directory
Remove the directory and its contents recursively.
mkdir This command is used to create new a new directory. Its syntax is
mkdir -optional_flag directory_name
The possible flags are
mkdir -v directory_name
Tell what is going on.
mkdir -p directory_with_path
This is a cool command. Suppose you need a directory named data within another directory called report in /usr/local and the parent directory report itself does not exist, then you can use :
mkdir -p /usr/local/report/data
This command creates the report directory and the data subdirectory in one go.
man For someone new to linux, the man command is one of the most important commands. The syntax is:
man command_name
Suppose you have not understood fully one of the above commands or want to find out about a new command you have learnt, the man command provides a manual for that command
Ansible Playbook to collect uptime of servers
Hi, This is to explain how we can write a small playbook to collect uptime of all servers in our environment. We can use our own server l...
-
Hi, This is to explain how we can write a small playbook to collect uptime of all servers in our environment. We can use our own server l...
-
Operating system: RHEL 5 Problem: Network card driver is not getting installed in RHEL 5 Error: If the command # make install is gi...
-
First check whether telnet-server rpm in installed, # rpm -q telnet-s erver telnet-server-0.17-38.el5 If it is installed, then edit # vi ...