Logo Background RSS

» Linux

  • SSH slow login Problem
    By on January 31st, 2009 | 1 Comment1 Comment Comments

    SSH slow  login? Disable reverse DNS lookup

    when you log into the SSH server, it will do a reverse DNS lookup of the client for security reasons. Thats why it takes a time to login.

    vi /etc/ssh/sshd_config (and add the below line:)

    UseDNS no

    
    

    So enjoy SSH :D

  • All about httpd.conf
    By on January 24th, 2009 | No Comments Comments
    This  httpd.conf file to set itself up for this particular configuration setup with:
    ServerType standalone

    The option ServerType specifies how Apache should run on the system. You can run it from the super-server inetd, or as standalone daemon. It’s highly recommended to run Apache in standalone type for better performance and speed.

    ServerRoot “/etc/httpd”

    The option ServerRoot specifies the directory in which the configuration files of the Apache server lives. It allows Apache to know where it can find its configuration files when it starts.

    PidFile /var/run/httpd.pid

    The option PidFile specifies the location where the server will record the process id of the daemon when it starts. This option is only required when you configure Apache in standalone mode.

    ResourceConfig /dev/null

    The option ResourceConfig specifies the location of the old srm.conf file that Apache read after it finished reading the httpd.conf file. When you set the location to /dev/null, Apache allows you to include the content of this file in httpd.conf file, and in this manner, you have just one file that handles all your configuration parameters for simplicity.

    AccessConfig /dev/null

    The option AccessConfig specifies the location of the old access.conf file that Apache read after it finished reading the srm.conf file. When you set the location to /dev/null, Apache allows you to include the content of this file in httpd.conf file, and in this manner, you have just one file that handles all your configuration parameters for simplicity.

    Timeout 300

    The option Timeout specifies the amount of time Apache will wait for a GET, POST, PUT request and ACKs on transmissions. You can safely leave this option on its default values.

    KeepAlive On

    The option KeepAlive, if set to On, specifies enabling persistent connections on this web server. For better performance, it’s recommended to set this option to On, and allow more than one request per connection.

    MaxKeepAliveRequests 0

    The option MaxKeepAliveRequests specifies the number of requests allowed per connection when the KeepAlive option above is set to On. When the value of this option is set to 0 then unlimited requests are allowed on the server. For server performance, it’s recommended to allow unlimited requests.

    KeepAliveTimeout 15

    The option KeepAliveTimeout specifies how much time, in seconds, Apache will wait for a subsequent request before closing the connection. The value of 15 seconds is a good average for server performance.

    MinSpareServers 16

    The option MinSpareServers specifies the minimum number of idle child server processes for Apache, which is not handling a request. This is an important tuning parameter regarding the performance of the Apache web server. For high load operation, a value of 16 is recommended by various benchmarks on the Internet.

    MaxSpareServers 64

    The option MaxSpareServers specifies the maximum number of idle child server processes for Apache, which is not handling a request. This is also an important tuning parameter regarding the performance of the Apache web server. For high load operation, a value of 64 is recommended by various benchmarks on the Internet.

    StartServers 16

    The option StartServers specifies the number of child server processes that will be created by Apache on start-up. This is, again, an important tuning parameter regarding the performance of the Apache web server. For high load operation, a value of 16 is recommended by various benchmarks on the Internet.

    MaxClients 512

    The option MaxClients specifies the number of simultaneous requests that can be supported by Apache. This too is an important tuning parameter regarding the performance of the Apache web server. For high load operation, a value of 512 is recommended by various benchmarks on the Internet.

    MaxRequestsPerChild 100000

    The option MaxRequestsPerChild specifies the number of requests that an individual child server process will handle. This too is an important tuning parameter regarding the performance of the Apache web server.

    User www

    The option User specifies the UID that Apache server will run as. It’s important to create a new user that has minimal access to the system, and functions just for the purpose of running the web server daemon.

    Group www

    The option Group specifies the GID the Apache server will run as. It’s important to create a new group that has minimal access to the system and functions just for the purpose of running the web server daemon.

    DirectoryIndex index.htm index.html index.php index.php3 default.html index.cgi

    The option DirectoryIndex specifies the files to use by Apache as a pre-written HTML directory index. In other words, if Apache can’t find the default index page to display, it’ll try the next entry in this parameter, if available. To improve performance of your web server it’s recommended to list the most used default index pages of your web site first.

    Include conf/mmap.conf

    The option Include specifies the location of other files that you can include from within the server configuration files httpd.conf. In our case, we include the mmap.conf file located under /etc/httpd/conf directory. This file mmap.conf maps files into memory for faster serving.

    HostnameLookups Off

    The option HostnameLookups, if set to Off, specifies the disabling of DNS lookups. It’s recommended to set this option to Off in order to save the network traffic time, and to improve the performance of your Apache web server.

  • Using SSH by Putty
    By on December 12th, 2008 | 1 Comment1 Comment Comments

    Putty is a free software application for Windows 95,98, XP, & Vista which can be used to make a SSH Connection. You can find the application at Click here

    http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe

    1. Download it on your pc.
    2. Double-click on the putty.exe program to open.
    3. Next fill in the appropriate SSH settings for your service:
    Putty

    Putty

    Next fill in the appropriate SSH settings for your service:

    Host Name:

      • Host name

        Host name

        • (gs) Grid-Service – s#####.gridserver.com or mt-example.com
        • (dv) Dedicated-Virtual -mt-example.com or xxx.xxx.xxx.xxx
        • (ss) Shared-Server – mt-example.com or xxx.xxx.xxx.xxx
      • Port: 22
        port 22

        port 22

      • Connection Type: SSH

        Connection Type

        Connection Type

      • Next click Open to start the SSH Connection:

      putty open

      putty open

      Once the SSH Connection is open you should see a terminal prompt saying login as: Please provide your full username:

    Login

    Login Screen

      • (gs) Grid-Service – The default should be serveradmin@mt-example.com, however you may also login as username@mt-example.com.

        NOTE:

        Please make sure SSH is enabled for the user. SSH can be enabled from within the (ac) AccountCenter.

      • (dv) Dedicated-Virtual – You may login as the root user, or as a domain’s FTP user which has SSH access enabled
      • Next provide your password. Please note that you will not see any typing such as *** when providing your password. Once you hit enter you should now be connected to your service.

      Common SSH Command

  • How to use SSH Via HTTP Proxy using Corkscrew in Ubuntu
    By on October 30th, 2008 | 1 Comment1 Comment Comments

    If you want to ssh your vps server or your home computer from your work place (assuming you are using http proxy).You need to use Corkscrew.

    corkscrew is a simple tool to tunnel TCP connections through an HTTP proxy supporting the CONNECT method. It reads stdin and writes to stdout during the connection, just like netcat.

    It can be used for instance to connect to an SSH server running on a remote 443 port through a strict HTTPS proxy.

    Install corkscrew in ubuntu using the following command

    sudo aptitude install corkscrew

    This will complete the installation.

    Configue corkscrew

    If your HTTP proxy uses authentication, then you’ll need to tell it about the username and password to use This is where the concept of ‘auth-file’ comes into play. All you have to do is put your username & password, separated by a colon, into a textfile. Once you’ve done this, you just have to tell corkscrew where to find the auth-file. Create a file called .corkscrew-auth in your home directory

    $touch .corkscrew-auth

    $gedit .corkscrew-auth

    and place your username and password in the following format

    username:password

    Save and exit the file.

    Configure ssh For Tunneling

    Now we’ll tell ssh what to do when connecting to all or specific hosts. Open up ~/.ssh/config (that’s /home/yourusername/.ssh/config) in your favourite text editor (gedit,nano,vim etc)

    $gedit /home/yourusername/.ssh/config

    and add the following lines

    Host *

    ProxyCommand corkscrew proxyhostname proxyport %h %p /home/username/.corkscrew-auth

    Save and exit the file

    Note: replace proxyhostname and proxyport with the equivalents for your network.

    Note: you won’t need to add the last section, ‘/home/username/.corkscrew-auth’, if your HTTP proxy doesn’t use authentication.

    What we’ve just told ssh to do is for all hostnames (’Host *’), use the following proxy command to route the connection.If you want more secure connections you can also list of hosts.

    Corkscrew Syntax

    corkscrew proxy proxyport targethost targetport [ authfile ]

    proxy – This is the name of the host running the HTTP proxy.

    proxyport – This is the port on which to connect on the proxy.

    target – This is the host to reach through the proxy.

    targetport – This is the port to connect to on the target host.

    Test your SSH connection

    ssh serverip

  • HTTP download proxy for software packages
    By on October 30th, 2008 | 1 Comment1 Comment Comments

    Apt-Cacher-ng is a software package that keeps a cache, on the disk, of Debian/Ubuntu Packages and Release files.When an apt-get like client issues a request for a file, Apt-Cacher intercepts it and if the file is already cached it serves it to the client immediately, otherwise it fetches the file from the Internet, saves it on the cache, and then serves it to the client. This means that several Debian machines can be upgraded but each package need to be downloaded only once.

    Apt-Cacher-NG does not require neither an interpreter, nor a web server and not even a huge runtime library. It does never fork after server startup, it does not create flag files, flock() files or similar fun. Instead, it uses native system functions (mmap, sendfile) to operate with few overhead.

    Apt-cacher-ng caches the repo’s from the different versions of ubuntu quite nicely. It even nicely supports the different installs of intrepid in my home with different personal package archives (PPA, you know as in ppa.launchpad.net/*).

    Install Apt-Cacher-NG in Ubuntu Intrepid

    First you need to download the latest version of Apt-Cacher-NG from here or using the following command

    wget http://ftp.debian.org/debian/pool/main/a/apt-cacher-ng/apt-cacher-ng_0.3.3-1_i386.deb

    Install .deb package using the following command

    sudo dpkg -i apt-cacher-ng_0.3.3-1_i386.deb

    or you can use the following command to install

    sudo apt-get install apt-cacher-ng

    Now you need to Add a proxy entry to the apt system

    Configure the apt system (apt-get, aptitude, etc.) to use apt-cacher-ng

    $ echo ‘Acquire::http { Proxy “http://localhost:3142″; };’ | sudo tee /etc/apt/apt.conf.d/01proxy

    Run the following command if you need to disable it

    sudo rm /etc/apt/apt.conf.d/01proxy

    Add a proxy entry to the Synaptic system for this go to: Settings->Preferences->Network->Manual Proxy Configuration and enter

    HTTP Proxy: localhost 3142

    FTP Proxy: localhost 3142

    Click OK

    Click Reload

    Dashboard & manual

    For apt-cacher-ng dashboard use the following URL

    http://localhost:3142/acng-report.html

    For apt-cacher-ng manual: (right click &) open with your browser

    file:///usr/share/doc/apt-cacher-ng/html/index.html

    Import .deb files from the local apt cache

    apt-cacher-ng use the .deb files that are already in /var/cache/apt/archives/

    sudo mkdir -p /var/cache/apt-cacher-ng/_import

    sudo chown apt-cacher-ng /var/cache/apt-cacher-ng/_import

    Now open browser using the following URL

    http://localhost:3142/acng-report.html

    and click “Start Import”

    Configure Client Machines

    If you want to use apt-cache-ng in ubuntu or debian clients use the following command to use this proxy

    $ echo ‘Acquire::http { Proxy “http://serverip:3142″; };’ | sudo tee /etc/apt/apt.conf.d/01proxy

  • Hacking Windows Administrator Password (with good intentions) Using Linux
    By on October 29th, 2008 | 1 Comment1 Comment Comments

    In case you or a friend of yours has forgotten his/her Windows administrator password, there’s no need to panic as you can easily hack it by resetting the password provided you have the right tools. One way to do this is to use Linux as your knight in shining armor.

    I’m going to show you how you can smoothly hack a Windows Administrator password using Linux. You will only need a Live CD, and for this example, we will utilize Ubuntu. Also, I assume that you have the basic knowledge on using the Linux command line.

    Now let’s start hacking:

    The first thing you have to do is of course load your Ubuntu Live CD. You don’t have to install it, just boot straight into the desktop. Then, install a program called ‘chntpw’:

    $ sudo apt-get install chntpw

    After successfully installing ‘chntpw’, you have to access the Windows NTFS partition by mounting it and allowing read/write support. A good tutorial on how to do this can be found HERE.

    After that, use your command line skills by navigating to ‘WINDOWS/system32/config’.

    Once inside the ‘config’ directory, issue this command:

    $ sudo chntpw SAM

    A long display of information will follow. Just ignore them.

    Once you are prompted to reset the password, it is recommended to leave the password blank with an asterisk *. Reboot, and you can now login to freakin’ Windows.