Tips,Tricks and Tutorials

All useful Tips , Tricks and Troubleshooting Tips by various FOSS users and Experts
______________________________________________
****************************************************
* Login in fedora as root user
sudo vim /etc/pam.d/gdm
#auth required pam_succeed_if.so user != root quiet

vi gdm-password

sudo vim /etc/pam.d/gdm-password
#auth required pam_succeed_if.so user != root quiet

Find and Comment or remove this line into your gdm file
auth required pam_succeed_if.so user != root quiet

Ref: http://razibdeb.wordpress.com/2011/01/19/enable-root-login-in-fedora-14/

http://www.tejasbarot.com/2010/11/03/login-as-a-root-from-gui-fedora-14/#ixzz24L847mpx

Under Creative Commons License: Attribution Share Alike

********************************************************

Configure Digital Pen on Linux
By : Swapnil Bhartiya

There are many graphics designers, artists and game writers who would love to work on GNU/Linux but may find themselves helpless, because one of the most important devices that enables them to create artwork and illustrations—the digital pen—may or may not work on this operating system. Well, the problem arises because although vendors love to advertise the fact that their devices are compatible with Windows and Mac, they don’t mention anything about GNU/Linux even if it’s supported out of the box. So, the end-user in search of a digital pen has no clue.

I recently bought an iBall pen [WP8060]. I had checked the website and knew that it did not work on GNU/Linux. The only reason I went in for this pen was that iBall’s device was the only product available in Delhi at that point of time. Despite knowing that it did not work on GNU/Linux, I deliberately asked the shopkeeper if it did. He said, “No!” But he got the message that there are GNU/Linux users interested in using this pen. I replied, “Ah, it will work—everything works on GNU/Linux.”

So I got down to work and found that I might have some luck with this device after all. I must mention that the whole credit of this tutorial goes to the fine fellows who developed the drivers and other utility packages, and the bloggers who scribbled down the instructions to use these tools.

I work on Ubuntu 8.10, which will be the target platform for this tutorial. However, other distro users need not worry, as I’ll have to start off by compiling from source.

First off, download the latest Wizardpen driver source [wizardpen-0.7.0-alpha2.tar.gz—I have created a Tiny URL to make it easy for you. You can find the original location in the foot-note to this article.] Uncompress the package after you’re done with downloading:

$ tar -xzvf wizardpen-0.7.0-alpha2.tar.gz

The next step is to compile this source. However, to successfully do that, download and install the following additional packages:

* xutils
* libx11-dev
* libxext-dev
* build-essential
* xautomation
* xinput
* xserver-xorg-dev

Time to compile the driver now. Change the directory to where you extracted the wizardpen driver–for example, if you’ve extracted it on the ~/Desktop:

$ cd /home/dragon/Desktop/wizardpen-0.7.0-alpha2/

Now, run the following command to compile the driver:

$ ./configure –with-xorg-module-dir=/usr/lib/xorg/modules
$ make && sudo make install

After this, to check whether things have installed successfully or not:

$ ls /usr/lib/xorg/modules/input/wizardpen_drv.*

The above command should give you the following output:

wizardpen_drv.la
wizardpen_drv.so

If you see these two lines, congratulations! Your drivers are now installed! However, you’re only half way through.

In order to configure your tablet, you will have to create a new .fdi file in the /etc/hal/fdi/policy directory. But before that we need to know the name of your Tablet pen as recognised by HAL. Plug your Tablet to your machine and then run:

$ grep -i name /proc/bus/input/devices

This should give you an output like this:

N: Name=”Macintosh mouse button emulation”
N: Name=”AT Translated Set 2 keyboard”
N: Name=”Power Button (FF)”
N: Name=”Power Button (CM)”
N: Name=”PC Speaker”
N: Name=”ImPS/2 Generic Wheel Mouse”
N: Name=”Tablet PF8060″

Note the last line—this is the name of your Tablet as recognised by the system.

You will now have to create a policy directory for this. Create a file called /etc/hal/fdi/policy/99-x11-wizardpen.fdi with the following content:

wizardpen
true
5619
6554
29405
29671
29405
29671

Make sure you replace “Tablet PF8060″ in line numbers 4 and 5 above with the name of your own tablet.

Time to reboot your system. When you’re back, your GNU/Linux will recognise your Tablet and you should be able to use it with The GIMP to create illustrations—or just use it as a mouse.

I used to sketch a lot in the old days, and the combination of GNU/Linux and GIMP, along with this brand-new Tablet, has brought back the memories and the passion to draw. So, excuse me, as I’ve got to sketch some stuff.

Warning: Things do break down at times.
Resources

* This article is attributed to digitalbluewave.blogspot.com
* Wizardpen driver

********************************************************

ns2 installation (on rhel5/CentOS5):
Courtesy: Vipin Gupta
step 1: download the latest version of ns2 simulator. one possible download link is
step 2: copy the “ns-allinone-2.35.tar.gz” into “/usr/src/” dir.
step 3: install the “dependencies” packages using “yum” command as shown.
# yum install tk* *tcl* autoconf automake gcc* libX* *c++* libXmu*
step 4: go to “/usr/src/” dir & “extract” contents from “ns-allinone-2.35.tar.gz” file with “tar” command.
# cd /usr/src/
# tar xvfz ns-allinone-2.35.tar.gz
step 5: on extraction, one dir “ns-allinone-2.35” will get created under “/usr/src/”. go to this dir & run
“./install” command. it may take 5-10 minutes for installation depending upon your system configuration.
step 6: create one file “ns2.sh” in “/etc/profile.d/” dir with contents as shown. or download it from
following site “http://linuxexpert.in”. the contents of file can be viewed by using “tail” or “cat” command.
if you have downloaded the “ns2.sh” file from above site. copy that file into “/etc/profile.d/” dir as shown.
in our case we downloaded the file into “usb” device. & then copied it to “/etc/profile.d/” dir by first
mounting “usb” device & then copying the file.
“umount” device & run the command
# source /etc/profile.d/ns2.sh

before running the above command, change the permissions of the file “ns2.sh”.
# chmod 755 /etc/profile.d/ns2.sh
(just remember, we are performing all actions as user “root”)
now you can test the “ns2” simulator as shown. you should be in “GUI” mode to test the simulator.
as can be seen, it is running perfectly

______________

Installation of ns2 on Ubuntu/Debian

Download NS-2.35
Place this file ns-allinone-2.35.tar.gz in any folder you like (/home/loginname)
$ tar zxvf ns-allinone-2.35.tar.gz

$ sudo apt-get update
$ sudo apt-get install build-essential autoconf automake libxmu-dev

$ cd ns-allinone-2.35
$ ./install

$ sudo apt-get install xgraph
$ sudo apt-get install gnuplot

************************************************

Multi-wan Script – Failover Linuxbox
Courtesy :- http://linuxmasters.wordpress.com/

Created this small script that checks the given ip address for connectivity by pinging the same. if the ping response is RTO the default gateway is automatically changed to the next given supplied route/gateway and incase failover goes down it automatically again switches it back to the primary gateway/route.

Tweak the script as per your requirement and make it load at Linuxbox Startup.

while true
do
for ipaddress in `cat /etc/gateway1.txt`

#enter ISP Default gateway in the file above to check.
do
echo “Pinging Main Gateway”
ping -c 10 $ipaddress
if [ $? != 0 ]
then
echo “$ipaddress is down – MainLINK”
route del default
route add default gw IPADDRESS eth1
fi
sleep 30
echo “Pinging FailOVER Gateway”

ping -c 2 $ipaddress
if [ $? != 0 ]
then
echo “$ipaddress is down – FAILOVER”
route del default
route add default gw IPADDRESS eth1
fi

done
echo “Waiting 60 Seconds to recheck”
sleep 60

#change the sleep time as per requirement
done

*********************************************************************

Installing (New) Indian Rupee Font (Symbol) in Linux ( Fedora | RHEL|CentOS | Ubuntu )

Steps to Install :

Step-1 : First of all Download ttf fonts for Indian Rupee Symbol. Link to Download :- http://hiteshjoshi.com/downloads/Fonts.zip

Step-2: Extract Fonts.zip. Using GUI or from Command. If You want to unzip file using command in Linux then unzip is the command (i.e. unzil Fonts.zip)

Step-3: In Fedora and Ubuntu Double Click on .ttf File. You will get a Option in Right Down Side “Install Font.” Click on Install Font for all three .ttf Files one by one and That’s It. You are done.Below is the screen shot for the same.

Step-4: Right now Indian Rupee Symbol can only be written in Three Fonts Which You have installed from Fonts.zip You can use Verdana, Times New Roman and Arial to Type Indian Rupee Symbol On Linux. Below is the screen shot.

Step-5: To Test that Fonts for Indian Rupee Symbol is installed or not We will use Open Office. Lets Use OpenOffice Writer to test it. Click on Application -> Click on Office -> Click on OpenOffice.org Writer.

Step-6: Now Press a (~) key exact above TAB key without bracket. You dont’t have to combine ~ key with any key combination like CTRL ALT SHIFT. Nothing Just Press the ~ key and you will able to see a Indian Rupee Symbol into OpenOffice Writer. Below is the image for ~ key on Keyboard.

[Sources: http://blog.ask4itsolutions.com/2010/08/03/installing-new-indian-rupee-symbol-in-linux-fedora-rhel-ubuntu/%5D

***************************************************************
Q. Problem with Diskless booting for Clutser or LTSP
Begin: Running /scripts/nfs-premount
,Connect: Connection timed out
/dev/nfs not exist

when u boot thin client after the documentation from
https://wiki.ubuntu.com/EasyUbuntuClustering/UbuntuKerrighedClusterGuide

*****************************************************

Steps to configure Yum Local Repository in RHEL/CentOS/Fedora

1. Login as a root user

2. Before starting the configuration of offline yum repository ,just check it out that whether SELinux is enabled or disabled by the command

#sestatus

3. If it is enabled than make it disabled by opening the file /etc/sysconfig/selinux

#vi /etc/sysconfig/selinux

In the file add the line SELINUX=disabled if SELINUX=enabled is there than put it in Comment i.e. # SELINUX=enabled

4. Run the command #setenforce 0

5. Mount the DVD using mount command [In my case as i am using the .iso file it is auto mounted in the /media file ]

6. Change the directory to /var/ftp/pub

#cd /var/ftp/pub

7. Copy the contents of DVD in the /var/ftp/pub directory

# cp –a /media/RHEL5.4/. . [Comments :- Don’t forget to give the . .(dots)]

8. Change the directory to /RHEL5.4/Server/

#cd Server

9. Now extract the createrepo rpm file

# rpm –ivh createrepo.rpm

10. Now change to the parent directory i.e. /var/ftp/pub

# cd ..

11. Now run the createrepo command

#createrepo –v . [Comments :- Don’t forget to give the . (dot)]

12. Now restart the vsftpd service and then checkconfig

#service vsftpd restart

#chkconfig vsftpd on

13. Now open the /etc/yum.conf file

# vi /etc/yum.conf

14. And then add the following lines in the /etc/yum.conf file

[yumserver]

Name=yumserver

Baseurl=ftp:///pub

enabled=1

gpgcheck=0

[Comments :- to know the ip address run the ifconfig command]

15. Rename direcory /etc/repso.d to /etc/yum.repos.d.copy.

16. If connect to internet then change in step 14 enabled=0 & rename /etc/yum.repos.d.copy to /etc/yum.repos.d.

********************************************************

Solution ( Coutesy;- http://ubuntuforums.org/showthread.php?t=1030849&page=16 Thread 155)

Hi. I got my server to boot (not yet with Kerrighed). The problem was in the initrd.

On the root server (not /nfsroot/kerrighed) try:

Backup your current initrd:

Code:
sudo cp /boot/initrd.img-$(uname -r) /boot/initrd.img-$(uname -r).bak

Backup your initrd config file

Code:

sudo cp /etc/initramfs-tools/initramfs.conf ~/initrdconfig

This command will replace your initramfs config with the one required to get nfs booting:

Code:

sudo echo -e “MODULES=netboot” “\nBUSYBOX=y” “\nCOMPCACHE_SIZE=\”\”” “\nBOOT=nfs” “\nDEVICE=eth0” “\nNFSROOT=auto” > /etc/initramfs-tools/initramfs.conf

Create the new initrd:

Code:

sudo update-initramfs -u

Restore the initramfs config:

Code:

sudo mv ~/initrdconfig /etc/initramfs-tools/initramfs.conf

copy the new initrd to the /srv/tftp folder: or your own tftp director /var/lib/tftp

Code:

sudo cp /boot/initrd.img-$(uname -r) /srv/tftp/

sudo cp /boot/vmlinuz-$(uname -r) /srv/tftp/

remove the nfs initrd:

Code:

sudo rm /boot/initrd.img-$(uname -r)

put the old initrd in place:

Code:

sudo mv /boot/initrd.img-$(uname -r).bak /boot/initrd.img-$(uname -r)

update the configuration. this whole block is a single command!

printf “LABEL linux

KERNEL vmlinuz-$(uname -r)

APPEND root=/dev/nfs initrd=initrd.img-$(uname -r) nfsroot=192.168.1.0:/nfsroot/kerrighed ip=dhcp rw” > /srv/tftp/pxelinux.cfg/default

After that, it booted and froze to “Starting NFS Common Utilities” I was able to remove it from the startup script with out any problems. it still boots and I am able to browse and write to the file system, but just in case, move it to your home folder:

Code:
sudo mv /nfsroot/kerrighed/etc/init.d/nfs-common ~/nfs-common

********
(Improved one and Implemented by Mr. Remaldeep Singh, Student of CCET Engg College , Chandigarh)
Whenever trying to boot a PC via NFS(as done while setting a terminal server) dont for get to update
the initrd image you pass into the terminal pc’s. By default the initrd image’s are not set up for nfs booting.
So you have to modify the initrd image for Nfs booting.Here is the procedure:-

initramfs-tools are the tools used to modify the initrd image.
$sudo apt-get install initramfs-tools

This folder is made to backup the files we will be modifying.
$mkdir /backup

$sudo cp /boot/initrd.img-$(uname -r) /backup/initrd.img-$(uname -r)

$sudo cp /etc/initramfs-tools/initramfs.conf /backup/initramfs.conf

$nano /etc/initramfs-tools/initramfs.conf
(now change the values specified below)

MODULES=netboot
BUSYBOX=y
COMPCACHE_SIZE=””
BOOT=nfs
DEVICE=eth0
NFSROOT=auto

This command will update the initrd image in /boot folder
$sudo update-initramfs -u

Here we are restoring the initramfs file to original one.
$sudo mv /backup/initramfs.conf /etc/initramfs-tools/initramfs.conf

$sudo cp /boot/initrd.img-$(uname -r) /var/lib/tftpboot/

Now we are removing the modified initrd image:
$sudo rm /boot/initrd.img-$(uname -r)

Putting the old initrd in place:
$sudo mv /backup/initrd.img-$(uname -r) /boot/initrd.img-$(uname -r)

Removing the backup folder
$sudo rm -r /backup

Voila now your nodes will be able to boot and mount the nfs filesystem.
But if some problem persists check the file /var/lib/tftpboot/pxelinux.cfg/default, see to it that correct initrd is exported.

Referrence:
http://ubuntuforums.org/showthread.php?t=1030849&page=16

*************************************************************
Steps to configure BSNL EV-DO AC8700 800M in Fedora11 / CentOS
Courtesy by Anupam Jamatia , NIT Agartala
(http://ajlinx.wordpress.com/)
17/06/2010

anupamjamatia Linux Leave a comment

I am using Fedora 11 , So to connfigure BSNL EV-DO AC8700 800M.It requires to follwo some steps.
Open the terminal as a root user
[anupam@anupamfedora11 ~]$ su
Password:
[root@anupamfedora11 anupam]#
Now after plug-in the EV-DO Write lsusb and press enter for acknowledgement of detecting the USB device.
[root@anupamfedora11 anupam]# lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 0483:2016 SGS Thomson Microelectronics Fingerprint Reader
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 002: ID 19d2:fffe ONDA Communication S.p.A.
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Now have to confugure the wvdial.conf file.

[root@anupamfedora11 anupam]# vi /etc/wvdial.conf
Write the following in this editor, then save and exit :

[Dialer Defaults]
modem=/dev/ttyUSB0
Baud=460800
Dial Command=ATDT
Baud=115220
Dial Command=ATDT
init1=ATZ
init2=AT+CRM=1
Flow Control=Hardware (CRTSCTS)
Username=165
Password=165
Phone=#777
Stupid Mode=1

Now have to confugure the /etc/ppp/options in the terminal and press enter.
[root@anupamfedora11 anupam]# vi /etc/ppp/options

Write the following then save and exit :
#lock

Write wvdial in the terminal and press enter.
[root@anupamfedora11 anupam]# wvdial
–> WvDial: Internet dialer version 1.60
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
ATZ
OK
–> Sending: AT+CRM=1
AT+CRM=1
OK
–> Modem initialized.
–> Sending: ATDT#777
–> Waiting for carrier.
ATDT#777
CONNECT
–> Carrier detected. Starting PPP immediately.
–> Starting pppd at Thu Jun 17 10:39:30 2010
–> Pid of pppd: 2609
–> pppd: ��[7f] ��[7f]
–> Using interface ppp0
–> pppd: ��[7f] ��[7f]
–> pppd: ��[7f] ��[7f]
–> pppd: ��[7f] ��[7f]
–> pppd: ��[7f] ��[7f]
–> local IP address 117.254.247.59
–> pppd: ��[7f] ��[7f]
–> remote IP address 192.168.52.12
–> pppd: ��[7f] ��[7f]
–> primary DNS address 218.248.240.208
–> pppd: ��[7f] ��[7f]
–> secondary DNS address 218.248.240.134
–> pppd: ��[7f] ��[7f]

Now Note the Primary and secondary DNS from the above.
Here the Primary DNS : 218.248.240.208
and Secondary DNS : 218.248.240.134
Now to disconnect Press CTRL+C two times. You are now disconnected.

Open the /etc/resolv.conf in the terminal and press enter.
[root@anupamfedora11 anupam]# vi /etc/resolv.conf

Write the following in this editor, then save and exit :
nameserver 218.248.240.208
nameserver 218.248.240.134

Now write wvdial in the terminal and press enter.
[root@anupamfedora11 anupam]# wvdial

–> WvDial: Internet dialer version 1.60
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
ATZ
OK
–> Sending: AT+CRM=1
AT+CRM=1
OK
–> Modem initialized.
–> Sending: ATDT#777
–> Waiting for carrier.
ATDT#777
CONNECT
–> Carrier detected. Starting PPP immediately.
–> Starting pppd at Thu Jun 17 10:39:30 2010
–> Pid of pppd: 2609
–> pppd: ��[7f] ��[7f]
–> Using interface ppp0
–> pppd: ��[7f] ��[7f]
–> pppd: ��[7f] ��[7f]
–> pppd: ��[7f] ��[7f]
–> pppd: ��[7f] ��[7f]
–> local IP address 117.254.247.59
–> pppd: ��[7f] ��[7f]
–> remote IP address 192.168.52.12
–> pppd: ��[7f] ��[7f]
–> primary DNS address 218.248.240.208
–> pppd: ��[7f] ��[7f]
–> secondary DNS address 218.248.240.134
–> pppd: ��[7f] ��[7f]

Now You are Connected with the EV-DO Dial-Up connection.

Click the Browser to surf.If the browser cannot connect with the Internet, the “work offline” option under “file” menu
is to be unchecked.Now again Press F5 from the keyboard or Refresh the page from the Browser.

Minimize the Terminal Window. Do not Exit this Window to prevent Disconnection.When you want to disconnect the dial-up internet connection, please maximize the terminal window that you have minimized.Press CTRL+C two times.
Caught signal 2: Attempting to exit gracefully…
–> Terminating on signal 15
–> pppd: ��[7f] ��[7f]
–> Connect time 26.7 minutes.
–> pppd: ��[7f] ��[7f]
–> pppd: ��[7f] ��[7f]
–> Disconnecting at Thu Jun 17 11:06:08 2010
^C
[root@anupamfedora11 anupam]#

And Last Thanks Tantuja
[Source http://fedoraforum.org/forum/showthread.php?s=2d5690e752a870b8d8a8cff618862f79&t=242405%5D

______________________________________________

http://malanchlinuxinterview.blogspot.com/ , http://hanumaansirji.blogspot.com/,

( Block pendrive in windows )http://malanchusbblock.blogspot.com/,

(Speedup Windows )http://malanchspeedupxp1.blogspot.com/

101 Tips for Widows 2003 Server Active Directory ( http://malanchwintips.blogspot.com/)

Monday, January 18, 2010
Linux Interview Questions

Que1. : How to call recursive grep function ?

Answer : grep -r “String”

Que2: Which command is used to see all the system configuration? like hardware, HDD, memory etc. ?
Ans :
#lspci

#lshal

#dmidecode

# cat /etc/sysconfig/hwconf

Que3 : how to see unallocated hard disk space on linux ?
Ans :

1.# cat /proc/partitions
2.# df -h /dev/devicename
device name could be hda,sda

Que4. :My machine is running half duplex mode how to change half duplex to full duplex?
Ans:

1. #ethtool -s eth0 speed 100 duplex full
2.# mii-tool -F 100baseTx-FD

Que5: how many limitations of under directories in ext2/3 linux file system?
Ext2 Limits
============
Max file size: 2-64 TiB
Max number of files: 10 raised 18
Max filename length: 255 characters
Max volume size: 16-32 TiB
Allowed characters in filenames: Any byte except NULL and ‘/’

Ext3 Limits
===========
Max file size: 2 TiB
Max number of files: Variable, allocated at creation time[1]
Max filename length: 255 bytes
Max volume size: 2 TiB – 16 TiB
Allowed characters in filenames: All bytes except NULL

Que6: what is the command to view gateway?

1.#route –n
2.#netstat –rn

Que7.How to see the system configuration in your linux system?

cat /proc/cpuinfo

Que8. How to FTP user access other directory except his own home directory ?

specify the user in /etc/vsftpd/user_list.
then in /etc/vsftpd/vsftpd.conf ,add userlist_deny=NO,,,,
then restart the service……… set the selinux for the
accessing home directory……….

Que9.what is a command to display top 10 users who are using Huge Space?

du -s /home/* | sort -nr |head -10

Que10.what is the UID and GID of root user? Can a normal user can
change the ownership of a file? what is the command to
change ownership of a file?

The UID and GID of root user is O . Yes , if he is the
owner of a file or he has the permission to change .To
change the ownership of a file is
chown

Collected by : Satish Malanch ,Kangra HP

________________________________________________________________

Configuring vsftp Server (FTP server) in Linux By …………Satish Malanch
File Transfer Protocol (FTP) is a standard network protocol used to exchange and manipulate files over a TCP/IP based network, such as the Internet. FTP is built on a client-server architecture and utilizes separate control and data connections between the client and server applications. Applications were originally interactive command-line tools with a standardized command syntax, but graphical user interfaces have been developed for all desktop operating systems in use today. FTP is also often used as an application component to automatically transfer files for program internal functions. FTP can be used with user-based password authentication or with anonymous user access.
Types of FTP

From a networking perspective, the two main types of FTP are active and passive. In active FTP, the FTP server initiates a data transfer connection back to the client. For passive FTP, the connection is initiated from the FTP client. These are illustrated in Figure 15-1.
Figure : Active And Passive FTP Illustrated

From a user management perspective there are also two types of FTP: regular FTP in which files are transferred using the username and password of a regular user FTP server, and anonymous FTP in which general access is provided to the FTP server using a well known universal login method.
Take a closer look at each type.

Active FTP
The sequence of events for active FTP is:

1. Your client connects to the FTP server by establishing an FTP control connection to port 21 of the server. Your commands such as ‘ls’ and ‘get’ are sent over this connection.
2. Whenever the client requests data over the control connection, the server initiates data transfer connections back to the client. The source port of these data transfer connections is always port 20 on the server, and the destination port is a high port (greater than 1024) on the client.
3. Thus the ls listing that you asked for comes back over the port 20 to high port connection, not the port 21 control connection.

FTP active mode therefore transfers data in a counter intuitive way to the TCP standard, as it selects port 20 as it’s source port (not a random high port that’s greater than 1024) and connects back to the client on a random high port that has been pre-negotiated on the port 21 control connection.
Active FTP may fail in cases where the client is protected from the Internet via many to one NAT (masquerading). This is because the firewall will not know which of the many servers behind it should receive the return connection.
Passive FTP
Passive FTP works differently:

1. Your client connects to the FTP server by establishing an FTP control connection to port 21 of the server. Your commands such as ls and get are sent over that connection.
2. Whenever the client requests data over the control connection, the client initiates the data transfer connections to the server. The source port of these data transfer connections is always a high port on the client with a destination port of a high port on the server.

Passive FTP should be viewed as the server never making an active attempt to connect to the client for FTP data transfers. Because client always initiates the required connections, passive FTP works better for clients protected by a firewall.
As Windows defaults to active FTP, and Linux defaults to passive, you’ll probably have to accommodate both forms when deciding upon a security policy for your FTP server.

Configuruing FTP Server in Fedora Core 11 :

Install rpm by yum or rpm command:

[root@satish.malanchlinux.com]#cd /satishdata/install/Packages
[root@satish.malanchlinux.com Packages]#rpm –ivh –adi vsftpd*
Or
[root@satish.malanchlinux.com Packages]#yum install *ftp*
Start/Restart vsftpd demon:

[root@satish.malanchlinux.com]#/etc/inid/vsftpd start
[root@satish.malanchlinux.com]#/etc/inid/vsftpd restart

With Redhat / Fedora you can configure VSFTPD to start at boot you can use the chkconfig command.

[root@satish.malanchlinux.com]# chkconfig vsftpd on

The vsftpd.conf File
VSFTPD only reads the contents of its vsftpd.conf configuration file only when it starts, so you’ll have to restart VSFTPD each time you edit the file in order for the changes to take effect. The file may be located in either the /etc or the /etc/vsftpd directories depending on your Linux distribution.
This file uses a number of default settings you need to know about.

* VSFTPD runs as an anonymous FTP server. Unless you want any remote user to log into to your default FTP directory using a username of anonymous and a password that’s the same as their email address, I would suggest turning this off. The configuration file’s anonymous_enable directive can be set to no to disable this feature. You’ll also need to simultaneously enable local users to be able to log in by removing the comment symbol (#) before the local_enable instruction.
* If you enable anonymous FTP with VSFTPD, remember to define the root directory that visitors will visit. This is done with the anon_root directive.

anon_root=/data/directory

* VSFTPD allows only anonymous FTP downloads to remote users, not uploads from them. This can be changed by modifying the anon_upload_enable directive shown later.
* VSFTPD doesn’t allow anonymous users to create directories on your FTP server. You can change this by modifying the anon_mkdir_write_enable directive.
* VSFTPD logs FTP access to the /var/log/vsftpd.log log file. You can change this by modifying the xferlog_file directive.
* By default VSFTPD expects files for anonymous FTP to be placed in the /var/ftp directory. You can change this by modifying the anon_root directive. There is always the risk with anonymous FTP that users will discover a way to write files to your anonymous FTP directory. You run the risk of filling up your /var partition if you use the default setting. It is best to make the anonymous FTP directory reside in its own dedicated partition.

The configuration file is fairly straight forward as you can see in the snippet below where we enable anonymous FTP and individual accounts simultaneously.

# Allow anonymous FTP?

anonymous_enable=YES

# The directory which vsftpd will try to change

# into after an anonymous login. (Default = /var/ftp)

anon_root=/data/directory

# Uncomment this to allow local users to log in.

local_enable=YES

# Uncomment this to enable any form of FTP write command.

# (Needed even if you want local users to be able to upload files)

write_enable=YES

# Uncomment to allow the anonymous FTP user to upload files. This only

# has an effect if global write enable is activated. Also, you will

# obviously need to create a directory writable by the FTP user.

#anon_upload_enable=YES

# Uncomment this if you want the anonymous FTP user to be able to create

# new directories.

#anon_mkdir_write_enable=YES

# Activate logging of uploads/downloads.

xferlog_enable=YES

# You may override where the log file goes if you like.

# The default is shown below.

xferlog_file=/var/log/vsftpd.log

To activate or deactivate a feature, remove or add the # at the beginning of the appropriate line.
Other vsftpd.conf Options
There are many other options you can add to this file:

* Limiting the maximum number of client connections (max_clients)
* Limiting the number of connections by source IP address (max_per_ip)
* The maximum rate of data transfer per anonymous login. (anon_max_rate)
* The maximum rate of data transfer per non-anonymous login. (local_max_rate)

Descriptions on this and more can be found in the vsftpd.conf man pages.
FTP Security Issues
FTP has a number of security drawbacks, but you can overcome them in some cases. You can restrict an individual Linux user’s access to non-anonymous FTP, and you can change the configuration to not display the FTP server’s software version information, but unfortunately, though very convenient, FTP logins and data transfers are not encrypted.
The /etc/vsftpd.ftpusers File
For added security, you may restrict FTP access to certain users by adding them to the list of users in the /etc/vsftpd.ftpusers file. The VSFTPD package creates this file with a number of entries for privileged users that normally shouldn’t have FTP access. As FTP doesn’t encrypt passwords, thereby increasing the risk of data or passwords being compromised, it is a good idea to let these entries remain and add new entries for additional security.
Anonymous Upload
If you want remote users to write data to your FTP server, then you should create a write-only directory within /var/ftp/pub. This will allow your users to upload but not access other files uploaded by other users. The commands you need are:

[root@satish.malanch.com tmp]# mkdir /var/ftp/pub/upload

[root@satish.malanch.com tmp]# chmod 722 /var/ftp/pub/upload

FTP Greeting Banner
Change the default greeting banner in the vsftpd.conf file to make it harder for malicious users to determine the type of system you have. The directive in this file is.

ftpd_banner= Welcome to Satish Malnch ftp services

Client Site access :
In Windows OS you can access the ftp services by typeing ftp server address in your webbrowser:
ie.
ftp://satish.malanch.com or ftp://192.168.5.20
it will prompt you for authonitaction then provide user name and password to login.

Posted by Satish Malanch at 10:11 AM 0 comments Links to this post
Thursday, January 7, 2010
Some New and Great Features in Fedora 11
Hi Friends,

In this artical i am going to mention some to the new cool and robust featue of Red Hat Fedora core 11.

1. Booting Time :
Boot time in this edition is minimum ever.With default software Packages in GNome session the booting time in between boot screen to login screen in less than 20 sec
( In init-5, in Init3 terminal is even fast ).

2.ABRT:
Automatic Bug Reporting Tool: Help non-power users with bug reporting, making it as easy as a few mouse clicks.

3. ext4 file System:

Make ext4 the default files system for anaconda-driven installs (replacing ext3). User should notice generally better performance, and benefit from things like persistent preallocation when using updated torrent clients, etc.Risk of data lose are very less in this file system. GRUB still does not offer Ext4 support under Fedora.
4. Better Surfing with Mozila Firefox 3.5:
Firefox has been upgraded to version 3.5 .
5. Gnome Version 2.26
6. KDE Desktop version KDE 4.2
7. Tiger VNC : Tiger VNC is new tool for Remote support
Posted by Satish Malanch at 4:00 PM 0 comments Links to this post
Wednesday, December 30, 2009
Unable to login on Fedora 11 with root user in GUI
I just install linux ( Fedora core -11) after interval of more than 6 months. Just installed Fedora core 11, surprisely there was one more option to create file sytem ext4 ,this file system was new for me.
Now as i finished installation ooooooooooooopsss
I was’nt able to login in GUI as super user. System refelect an error “unable to authoneticate”
Finaly after a littel bit R & D i got solution.Here it is:
Fedora 10 and above uses pam module called pam_succeed_if.so. This module is designed to succeed or fail authentication based on characteristics of the account belonging to the user being authenticated. One use is to select whether to load other modules based on this test. This module blocks root login using GUI.
to fix this problem

Login as a normal user and open terminal
now give command

[satish@malanch.com]$su

Type your root password. Next, make a backup of /etc/pam.d/gdm, enter:

[root@malanch.com]#cp /etc/pam.d/gdm /root

Now open /etc/pam.d/gdm using gedit or vi text editor, enter:

[root@malanch.com]#vim /etc/pam.d/gdm

Alternatively, you can do everything in a one command:

su -c ‘gedit /etc/pam.d/gdm

Find line that read as follows:

auth required pam_succeed_if.so user != root quiet
Remove or comment out line by prefixing #.

# auth required pam_succeed_if.so user != root quiet

Save and close the file. Logout from terminal and from GUI itself.
now restart ur machine by init 6.
Now you can login to your sytem in GUI with root user. (only in case of Fedora 10)

In case of Fedora 11 you need to edit one more file which is located in /etc/pam.d/gdm-password

[root@malanch.com]#vim /etc/pam.d/gdm-password

Find line that read as follows:

auth required pam_succeed_if.so user != root quiet

Remove or comment out line by prefixing #.

Now restart and enjoy login with root.
……………………… By Satish Kr Malanch ( http://malanchlinux.blogspot.com/)

______________________________________________________________

Configuring YUM server for LInux on Windows FTP server
Hi all,
In this artical i am going to setup YUM ( Yellowdog Update Modified) server on a Windows based FTP server.Here we go;
First of all copy Full DVD of your linux distribution on a windows ftp server.
In my case i have copied all the contented of Fedora core-11dvd on my windows ftp server (192.168.5.52\fedora11)
The exact link location is ftp://192.168.5.52/fedora11

Now on Linux system follow the following steps
1. Move all the repo file to a backup location in my case /backup/yum.repod

[root@satish.malanch.com tmp ]# mv /etc/yum.repod/* /backup/yum.repod/
[root@satish.malanch.com tmp ]# cp /backup/yum.repod/fedora.repo /etc/yum.repod/satishmalanch.repo

Now edit this file with vim edtior:
root@satish.malanch.com tmp ]# vim /etc/yum.repod/satishmalanch.repo

Edit the file as shown in above figure.
Now run following command:

[root@satish.malanch.com tmp ]# yum clean all
Now you have configured the yum repositry on a windows based ftp server on network.
You can now install the packages without any dependancy.

……………………… By Satish Kr Malanch ( http://malanchlinux.blogspot.com/)

_______________________________________________________________

You can also permantely mount your windows share on linux by making a credential file containing user name and password for windows share and then by adding a single line in /etc/fstab file:

# vim /etc/hosts

192.168.5.101 myfileserver

Now creat a password credential file:

#vi /etc/cifspw
username=satish
password=Geni0$neverbornYbirth

Secure this file now:

#Chmod 600 /etc/cifspw

Now enter following into your fstab file to make mount permanent:

//myfileserver/satishkrmalanch$ /winshare cifs exec,credentials=/etc/cifspw 0 0

Now make samba service active on startup by this command:
#chkconfig smb on

and now you are done. Make your firewall open for smb ,smb client demon on.

and enjoy to install software with yum command now.
courtesy :- Mr. : Satish Malanch ( http://malanchlinux.blogspot.com/)

_____________________________________________

For Ubuntu Operating System ( Debian Based) Dedicated Corner chk here
https://fosscommunity.wordpress.com/ubuntu-for-humanity/

Like – Recover root Password, run DataCards/Modems in Laptops, Driver info and more
Courtesy:- http://ubuntuforums.org
_____________________________________________________________–___
Query:- There is a need to find or grep particular range of number from particular column and to print desired column

experiments done

root@doegar-desktop:~/Desktop/experiments# cat out5
0.000000 1.570796 0.000000 -0.174533 0.000000
0.020008 1.568835 -0.196045 -0.174531 0.000385
0.040016 1.562953 -0.391895 -0.174502 0.003075
0.060024 1.553155 -0.587372 -0.174377 0.010370
0.080032 1.539452 -0.782338 -0.174041 0.024556
0.100040 1.521853 -0.976721 -0.173334 0.047901
0.120048 1.500371 -1.170538 -0.172048 0.082655
0.140056 1.475016 -1.363936 -0.169935 0.131052
0.160064 1.445793 -1.557235 -0.166698 0.195320
0.180072 1.412699 -1.750983 -0.161998 0.277708

root@doegar-desktop:~/Desktop/experiments# awk ‘ { if($2>=1.50 && $2<=1.55) print $0 }’  filename  — for full row output

0.080032 1.539452 -0.782338 -0.174041 0.024556
0.100040 1.521853 -0.976721 -0.173334 0.047901
0.120048 1.500371 -1.170538 -0.172048 0.082655

also this can help
awk ‘ { if($6==4.2)print $2,$3,$4,$5 }’ out4  — ,for desired column

awk ‘ { if($2>=1.50 && $2<=1.55) print $0 }’ out5
root@doegar-desktop:~/Desktop/experiments#
_________________________________________________________________________________________________

1) Setup LTSP – Remote Boot PXE Enabled Thin Clients or PXE enabled PC/Laptops
Courtesy :- http://linuxmasters.wordpress.com/
https://help.ubuntu.com/community/PXEInstallMultiDistro
http://myy.helia.fi/~karte/ubuntu_pxe.html

We would first install the Required applications step by step and then configure them later.

* 1.Install the Regular Ubuntu Desktop Distro, I am using ubuntu 9.04 for this howto.
* 2.Once Installed, update the distro and install all the necessary updates.
* 3.Once Done Install NFS kernel Server via this Command : sudo apt-get install nfs-kernel-server
* 4.Install the DHCP SERVER on the same machine,make sure there is only one dhcp server running on the network else.it will cause a conflict.
* 5.Set a static ip to the machine via /etc/network/interfaces file – i am using 192.168.0.1 as SERVER ip for this HOWTO.
* 6.Now install the server module for LTSP running this command on terminal : – sudo apt-get install ltsp-server-standalone openssh-server ( this would install the LTSP Server and the openssh on the desktop.
* 7.Now Create your Thin Client environment on the server with this command: sudo ltsp-build-client
* The First command installs the LTSP SERVER and the Second command installs the module that will provide/create the environment to run the remote disk less machines. ( Please be patient, the client module takes time to install as it fetches about 150 MB of files from the repos. )

Once the client installation is done run these 2 commands to create the ssh keys
sudo ltsp-update-sshkeys
sudo ltsp-update-image
Be sure to do it in that order.
We are now done with the installation. now comes the configuration part.

* Open the /etc/default/tftpd-hpa and edit first line Run_Daemon to “Yes” in place of NO.Save and Exit.
* Now Open the /etc/ltsp/dhcpd.conf and change some values to the file as below.uncomment value next-server and put the server ip infromt of it ( next-server 192.168.0.1; )
* add these two values below that :
* allow booting;
* allow bootp;
* now go to the last line of the dhcpd.conf and it has a default value : filename ( ”/ltsp/i386/nbi.img”; ) change that to ( filename “pxelinux.0″; )
* Once done save and exit and restart the dhcp server /etc/init.d/dhcp3-server restart
* Once done now u can just Boot the diskless workstations and it should aautomatically find the dhcp server get an IP address and load the Remote OS. and Login.

_____________________________________________________________________________________

2) Setup NIS – Server & Client
Courtesy :- http://linuxmasters.wordpress.com/

Recently got a project to teach students to setup NIS SERVER,there seems to be lotsa of information about setting up NIS Client and Server but no where do u find the exact step by step way to do it. Everyone Seems to be doing the Hit and Trial Methods,Below I have just mentioned the steps to setup an NIS SERVER and Client in less than 30 mins doing exactly as mentioned step by step. I had used debian Ubuntu for the SERVER setup and Centos 5.4 for the Client. Configurations Mentioned here work the same for any Distro.

NIS SERVER :

1. Install Portman Daemon.
2. Install NIS Server.
3. At the time of Installation Of NIS it will ask for the NISDOMAIN,enter ur hostname as the default NISDomain ( Eg.NISDOMAIN=HOMESERVER ).
4. Edit /etc/default/nis and set NISSERVER=TRUE & comment NISCLIENT=true.
5. Initialize the NIS files using the following command = /usr/lib/yp/ypinit -m.
6. Once this is complete you can run /etc/init.d/nis start with no errors.
7. Run this command every time new user is added or removed to add to NIS db “make -C /var/yp”.
8. Export the /home Dir of the NIS Server via NFS so it can be mapped on the client machines and they can use the same to login and store their data.

NIS CLIENT

1. On the client, you need the yp-tools package, which depends on the ypbind package.
2. First you must setup the NIS Domain Name,edit the /etc/yp.conf file, and point it to the appropriate server and domain name. Remember that the domain name must be the same that you set for the server. For example, add the following line: domain HOMESERVER server 192.168.1.100
3. Start the NIS client service by entering: /etc/init.d/ypbind start.
4. Map the Exported /home folder of the NIS SERVER to the local Client Machine into /home folder only.Rename the Existing /home folder on the client machines to /home.old,Remove all local Accounts from the client machines except root, so that only NIS Accounts work.
5. Once this process is done the accounts and personalized settings stored on the server are visible and available on any client machine and user can login by sitting on any of the clients retaining all his Files / Emails / Data / Bookmarks and Even Personalized UI settings…. .
6. Test the NIS SERVER by running ssh on the local workstation and login via telnet or ssh to the workstation using the user/password from the nis server password list..

Bingo that is all and u are ready to rock with NIS.

Remember the user/pass in NIS are sent in clear text format over the network and they are not encrypted…..

**********************************************************************

Installation of Arduino in Fedora 13

Install Arduino on Fedora 13 (x86_64)

Requirements:

* Sun Java SE runtime enviroment (JRE RPM.bin Package) from http://java.sun.com/javase/downloads/index.jsp

Install packages

$> su –
$> yum install uisp avr-libc avr-gcc-c++ rxtx avrdude

Install Arduino

Link the proper files

$> cd /lib
$> rm librxtxSerial.so RXTXcomm.jar
$> ln -s /usr/share/java/RXTXcomm.jar
$> ln -s /usr/lib64/rxtx/librxtxSerial.so
$> cd /hardware/tools/avrdude
$> ln -s /usr/bin/avrdude

Make login member of the proper groups

* go to (GUI) Administration \ Users and Groups
* Select User
* Select Properties
* Select tab Groups
* make account member of the following groups:uucp, lock and dialout
* login and logout

Select serial port

* In Arduino under Tools / Serial Port, select /dev/ttyUSB0

Open the GUI

Now ,

$> cd
$> ./arduino

**********************************************************************
Fedora RAR/UNRAR package

By default, Rar is not available in Fedora . If all you need to do is extract files from a Rar archive, unrar from RPM Fusion’s YUM repositories will work. If you need to create Rar archives, then you will have to download and install the complete Rar package from DAG. The instructions below show you how.

Only Need to Extract Files?

First, install RPM Fusion’s free and nonfree YUM repositories. For detailed information about installing RPM Fusion, see: http://rpmfusion.org/Configuration

su -c “rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm”

su -c “rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm”

Next, install the unrar packages from RPMFusion’s nonfree repository.

su -c “yum install unrar”

Done! You now have unrar in /usr/bin/unrar. This binary can only extract files from Rar archives. Use this command to see all available options:

/usr/bin/unrar -?

Need to Create Rar Archives?

First, download the source RPM from DAG: http://dag.wieers.com/rpm/packages/rar

wget -c http://dag.wieers.com/rpm/packages/rar/rar-3.5.1-1.rf.src.rpm

Now, install the source RPM. This will create a $HOME/rpmbuild tree. Please note that you do not need to be root.

rpm -iv rar-3.5.1-1.rf.src.rpm

Next, build a binary package in $HOME/rpmbuild. Again, no need to be root.

rpmbuild -bb ~/rpmbuild/SPECS/rar.spec

Finally, install the built RPM as root:

su -c “rpm -Uvh $HOME/rpmbuild/RPMS/$(arch)/rar-3.5.1-1.rf.x86_64.rpm”

Done! You now have rar in /usr/bin/rar. This binary can build and extract Rar files. Use this command to see all available options:

/usr/bin/rar -?

Courtsey : http://hacktux.com/fedora/rar/fedora/10

**********************************************************************
Desktop Session Recorder tool “RecordMyDEsktop”

RecordMyDesktop is a Desktop session recorder tool which can be downloaded from http://recordmydesktop.sourceforge.net/about.php or using terminal ” yum install gtk-recordmydesktop” recordMyDesktop record audio offers also the ability to through ALSA, OSS or the audio server jack audio server

********************************************************************

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: