How to:Linux Terminal Server Project (LTSP)

0 comments

Guest post by Sandeep Yadav(http://linuxarea.webs.com/). He is having 2+ years of experience in Linux administration and he is good at automating system admin task through shell scripting.. You can reach him at sandeeprhce5@gmail.com

Now I tell you how we can configure LTSP server for our lab with telnet, rdesktop, shell  and  startx ( for Linux log in).  I am making step for understand properly it.

Step 1:-
(i)    Make sure DHCP server is installed and running properly on your system.
(ii)   Now install tftp server also on your machine and you can find it’s rpm on your Redhat DVD (5.0)
(iii) Now install rdesktop rpm and it is also you can find on your redhat DVD (5.0)
(iv) Configure your windows xp system with full terminal snd remote desktop support  for distribute rdesktop also over the network so that client can be run windows xp.
(v)   Now download ltsp-4.1.0-1_2.iso image from it’s website (http://ltsp.mirrors.tds.net/pub/ltsp/isos/) and my package size is 100MB (apprx.).
(vi) Now I am making dir test in filesystem (/) and extract this package in test directory
(vii)                     Now open readme file from test folder and read instructions carefully on how to install this package.
(viii)                   After installation complete you need to configure ltsp server .

Step 2:-

Configure tftp for ltsp server
TFTP: TFTP is a simple file transfer protocol, used by ltsp to transfer the kernel to the workstations XINETD: Xinetd is a powerful replacement for inetd, with advanced features, used by ltsp to start tftp.
Open the file # vim  /etc/xinetd.d/tftp and make disable = no. Otherwise tftp not work.

service tftp
{
        Disable                 =  no
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /var/lib/tftpboot
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}

Now restart xined service
#service xinetd restart


Step 3:-


Configure nfs for ltsp server
Open the file  #vim  /etc/exports and enter following lines in it.
/opt/ltsp                 192.168.0.0/255.255.255.0(ro,no_root_squash,sync)
/var/opt/ltsp/swapfiles   192.168.0.0/255.255.255.0(rw,no_root_squash,async)


Now restart nfs service
#service nfs  restart
#chkconfig nfs on (for service start automatically on every bootup)


Step 4:-

Configure dhcpd.conf for ltsp server
Now you need to configure dhcpd.conf file and here is example of my file.
#vim /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;

subnet 192.168.0.0 netmask 255.255.255.0 {

# --- default gateway
#              option routers                                          192.168.0.1;
#              option subnet-mask                            255.255.255.0;

#              option nis-domain                                  "domain.org";
              option domain-name                            "san.com";
              option domain-name-servers              192.168.0.1;

              option time-offset                            -18000;              # Eastern Standard Time
#              option ntp-servers                            192.168.1.1;
#              option netbios-name-servers              192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
#              option netbios-node-type 2;


      option log-servers       192.168.0.1;

      option root-path             "192.168.0.1:/opt/ltsp/i386";



##If you use this line here then every system on your network can boot from #ltsp server but if you want more security then remove this line and then only #that system can boot that’s hardware address will declare in “host ws001” #section with static ip address.

      filename              "/lts/2.4.26-ltsp-2/pxelinux.0";


              range dynamic-bootp 192.168.0.128 192.168.0.254;
              default-lease-time 21600;
              max-lease-time 43200;

## If you want to use static IP address for your workstation the following ##section and modify to suit your network.
## Then, duplicate this section for each workstation that needs a static
## IP address.


host ws001 {                                      
       hardware ethernet    00:20:ED:75:9A:EC;          
       fixed-address        192.168.0.2;                
      filename              "/lts/2.4.26-ltsp-2/pxelinux.0";
 

}
  }


Step 5:-

Configure lts.conf for ltsp server
Now you need to configure #vim /opt/ltsp/i386/etc/lts.conf file for client.
Here is example of my lts.conf file
[Default]
       SERVER             = 192.168.0.1
       RDP_SERVER         = 192.168.0.50      
       XSERVER                              = auto
       X_MOUSE_PROTOCOL   = "PS/2"
       X_MOUSE_DEVICE     = "/dev/psaux"
       X_MOUSE_RESOLUTION = 400
       X_MOUSE_BUTTONS    = 3
       USE_XFS            = N
       X_COLOR_DEPTH      = 24          # it is for xp terminal server
       X_MODE_0           = 1024x768
       RUNLEVEL           = 5
       LDM_REMOTECMD    = /etc/X11/xinit/Xsession
       SCREEN_01                    = startx
       SCREEN_02                     = telnet
       SCREEN_3                              = shell
       SCREEN_4           = rdesktop

Notes:-Here I am explain some options of this file.

SERVER = Here you want to enter your ltsp server ip addr.

RDP_SERVER = If you want to run remote desktop connection of xp then you want enter ip addr. Of your xp terminal server. Otherwaise remove this option.

LDM_REMOTECMD = /etc/X11/xinit/Xsession
When I was trying to running startx on client machine it was showing white screen only for solving this problem I copied this
Option form internet and paste it here and my problem solved.

Source:- The LTSP client screen will still not display because LTSP expects a file /etc/X11/Xsession to exist on the server. In RHEL5 this corresponds to /etc/X11/xinit/Xsession .

This can be fixed by specifying the environment variable LDM_REMOTECMD in /opt/ltsp/i386/etc/lts.conf:

[192.168.250.20]
LDM_REMOTECMD = /etc/X11/xinit/Xsession

About SCREEN
The most interesting parameter here is SCREEN_01. The default is startx, which specifies that the workstation should boot up in a graphical X display, but there are a number of interesting possibilities. The other options are:
·        telnet: When the workstation boots up in this mode, it waits for you to press , then starts a TELNET session to the host. Obviously, your TELNET server must be running for this. (Many offices use SSH by default.). you want to enter your telnet server ip in /opt/ltsp/i386/etc/screen.d/telnet file
·        shell: This starts a local command shell, meaning local to the workstation, not to the server. From here, you could telnet or ssh to your server, or start a graphical login by typing startx. This mode is generally used for testing. It's also a great way to see the virtual Linux machine that gets created as part of the LTSP boot process.
·        rdesktop: Setting SCREEN_01 to this fires up rdesktop, a Linux-based Windows Terminal Server client, which means it uses RDP (remote desktop protocol) to communicate with and run remote Windows sessions from your Linux thin client.
How Many Screen's ?
Of course, the fact that this last variable is labeled SCREEN_01 leads up to the obvious question: What about SCREEN_02? Or SCREEN_03?
Earlier on in this chapter, I told you about running your main X session on virtual terminal session 7, while the second X session (started with an X -query) ran on virtual terminal 8. You can do something similar with thin-client workstations by modifying the lts.conf file to include more than one SCREEN definition. Here's the example from my own server:
SCREEN_01         = startx
# U want to enter your telnet server ip in /opt/ltsp/i386/etc/screen.d/telnet file
SCREEN_02         = telnet
SCREEN_03         = shell
SCREEN_04         = rdesktop
The first virtual terminal (accessible by pressing ) runs the graphical login served up via XDMCP. The second virtual terminal () runs a TELNET session with a prompt saying “Screen:2 – Press to establish a connection to the server…” Finally, the third screen () sits at a shell prompt.
In a default LTSP installation, all these screen definitions can be found in the /opt/ltsp/i386/etc/screen.d directory. Each is a shell script and easy to read and understand. You could, if you so wish, create your own screen definitions to better suit your own environment.
These types of screen modifications can be done globally or on a client-by-client basis. In the next chapter, you're going to look at just what sorts of things you can do with workstations. I'm also going to show you how you can run a not quite so thin, Linux thin client from a Windows desktop.





Step 6:-
Configure xdm-config file for ltsp server
Next, open the file /etc/X11/xdm/xdm-config and comment out the line:
DisplayManager.requestPort: 0
And
Edit This file also because sometime it makes problem
/opt/ltsp/i386/etc/xdm/xdm-config   and comment out the line:

DisplayManager.requestPort: 0

Step 7:-
Enable Remote Login in RedHat so that client able access login screen.
[root@racdb2 ~]# gdmsetup
After starting the gdmsetup utility, click the Remote tab. Under the Remote tab, change the Style pull-down menu selection from 'Remote login disabled' to 'Same as Local':
After configuring remote access to the GDM login manager, select the Security tab. Under the Security tab, I checked the options:
·        Allow local system administrator login
·        Allow remote system administrator login

Exit from the gdmsetup utility and restart the GDM service:
[root@racdb2 ~]# /usr/sbin/gdm-restart

OR                  enable remote login via configure files.

Use the following steps to enable the services and modify the files necessary to configure the XDMCP:
  1. To do this, edit the /etc/X11/xdm/Xaccess file and open the connection to hosts by un-commenting the line:
#*  #any host can get a login window
or enter individual IP addresses of selected hosts.
SuSE users can do the same by editing the file /usr/X11R6/lib/X11/xdm/Xaccess.
  1. Next, open the file /etc/X11/xdm/xdm-config and comment out the line:
DisplayManager.requestPort: 0
And
This file also because sometime it makes problem
/opt/ltsp/i386/etc/xdm/xdm-config
  1. Make sure to run the program xdm as the "root" user account.
  # xdm &
  1. If things still do not work, you may need to reboot the server or restart the xdm if it was already running.
C:\Documents and Settings\sandeep\Desktop\More on ltsp\LINUX_ConfiguringXDMCPRedHatLinux_files\popup_dialog_information_mark.gif 
The xdm command (X Display Manager) manages a collection of X displays, which may be on the local host or remote servers. The design of the xdm command was guided by the needs of X terminals as well as the X Consortium standard XDMCP (the X Display Manager Control Protocol).

GDM Login Manager
Users running Red Hat Enterprise Linux 5, CentOS 5, or Oracle Enterprise Linux Release 5 will need to use the GDM login manager as XDM is no longer supported.
First, edit the file /etc/gdm/custom.conf and add the following two entries:
[xdmcp]
Enable=true

[security]
DisallowTCP=false
AllowRemoteRoot=true

Next, restart X Windows:
[root@racdb2 ~]# init 3
[root@racdb2 ~]# init 5

Step 8:-
It is an optional step because some time client show syslog error after booting it means your server is not configure for accept remote logs so you want to configure some lines for that-
#vim  /etc/sysconfig/syslog
and add the  -r option as below:
SYSLOGD_OPTIONS=”-r –m 0”
Now restart syslog service
#service syslog restart
And now open file /opt/ltsp/i386/etc/lts.conf and add the following line:
SYSLOG_HOST        = 192.168.0.1   #your syslog server ip

More Examples of configure files in different way

>>>>> /etc/dhcpd.conf

  • Like the post? Please Subscribe to free RSS feed to get updates
  • How To Generate Randum Password

    0 comments

    Some times when creating bulk users, admins are forced to create complex passwords. But how to do it? How many you can set manually? Let me put it in this way. For one or two users we can think for a random password and assign to them. But if its 100 users? Naaa.. I cannot think for 100 passwds.

    So leave this job to Linux to create random passwords.
    you use below command to generate random passwords

    < /dev/urandom tr -dc A-Na-n1-9_ head -c8
    This will just generate random
    8 lenght password

    For example :
    See just typing the above command will generate a random password

    root@ps6061:~# < /dev/urandom tr -dc A-Na-n1-9_ head -c8 57fg67gKroot@ps6061:~# < /dev/urandom tr -dc A-Na-n1-9_ head -c8 FN8ahe8broot@ps6061:~# < /dev/urandom tr -dc A-Na-n1-9_ head -c8 eLhLLNCGroot@ps6061:~# < /dev/urandom tr -dc A-Na-n1-9_ head -c8 FK3CC9GNroot@ps6061:~# < /dev/urandom tr -dc A-Na-n1-9_ head -c8 cA8H24Mlroot@ps6061:~# < /dev/urandom tr -dc A-Na-n1-9_ head -c8
    9eDL39I_root@ps6061:~#

    Here is a script written by me to automate entire 20 user account creation.
    #!/bin/bash
    #Author:Surendra Kumar Anne
    #Purpose:To automate user creation
    #Date/Time:29-01-2010.19:10
    mkdir -p /home/admin/useraccounts
    for (( i=0; i<=20; i++ )) do useradd user$i < /dev/urandom tr -dc A-Na-n1-9_ head -c8 > /tmp/passwd.txt
    cat /tmp/passwd.txt passwd --stdin user$i
    echo -e "Username:user$i" > /home/admin/useraccounts/user$i
    echo -e "password:" >> /home/admin/useraccounts/user$i
    cat /tmp/passwd.txt >> /home/admin/useraccounts/user$i
    done
    rm -rf /tmp/passwd.txt

    Note :
    When password generating I have just created a password which will not contain o(small ooo), O(capital OO), 0(zero). This is to remove confusions for users. Some times user will get confusion when using these characters. If you want all the characters from a to z, A to Z, and 0-9 just use below code
    .

    < /dev/urandom tr -dc A-Za-z0-9_ head -c8

  • Like the post? Please Subscribe to free RSS feed to get updates
  • How To Change The Default Editor In Ubuntu.doc

    0 comments

    In most of the Linux distribution the defalut editor is set to “VI” and its very much popular editor too. But the strange in Ubuntu the default editor is “nano”. But most of the people are well in using vi editor. Here in this post I am going to show how to change the default editor in ubuntu(ie nano) to vi editor

    To do this we have to sudo or login as root. and execute the below command.
    $sudo update-alternatives --config editor

    When you execute above command it will show all the editors installed in your machine, and it ask you to set the default editor by specifying number.

    There are 4 choices for the alternative editor (providing /usr/bin/editor).
    Selection Path Priority Status
    ------------------------------------------------------------
    * 0 /bin/nano 40 auto mode
    1 /bin/ed -100 manual mode
    2 /bin/nano 40 manual mode
    3 /usr/bin/vim.basic 30 manual mode
    4 /usr/bin/vim.tiny 10 manual mode
    Press enter
    to keep the current choice[*], or type selection number:
    Here I want to change it to vi edioter so just enter 3 to set it as a default editor.
    Here is my clipped output how I did
    update-alternatives --config editor

    There are 4 choices for the alternative editor (providing /usr/bin/editor).
    Selection Path Priority Status
    ------------------------------------------------------------
    * 0 /bin/nano 40 auto mode
    1 /bin/ed -100 manual mode
    2 /bin/nano 40 manual mode
    3 /usr/bin/vim.basic 30 manual mode
    4 /usr/bin/vim.tiny 10 manual mode
    Press enter to keep the current choice[*], or type selection
    number: 3
    update-alternatives :
    using /usr/bin/vim.basic to provide /usr/bin/editor (editor) in manual mode.

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Followers

     

    The Linux Juggernaut | Copyright 2006-2009 Surendra Kumar Anne | Surendra's Home Page | Give us feedback how we are doing, Click here