IT Hardwares

eg: UK or Brides UK or Classical Art or Buy Music or Spirituality
 
eg: UK or Brides UK or Classical Art or Buy Music or Spirituality
 
Business & Money
Technology
Women
Health
Education
Family
Travel
Cars
Entertainment
SD Editorials
Online Guide and article directory site.
Foodeditorials.com
Over 15,000 recipes & editorials on food.
Lyricadvisor.com
Get 100,000 Lyric & Albums.
  • Business & Money
    • A Guide to Business
    • Guide to Finance
    • Ideas for Marketing
    • Legal Guide
    • Guide to Insurance
    • Lettre De Motivation
    • Guide to the Stock Market
    • Human Resource Career
    • Sales Marketing
    • Forex & Trading
    • Advertising & Marketing
    • Startup Guide
  • Technology
    • Guide to Technology
    • Cell Phones
    • Computer Software
    • IT Hardwares
    • Internet
    • Online Security
    • Cameras
    • Search Engine Optimization
    • Science & Technology
  • Women
    • Guide to Women
    • Relationship Advice
    • Marriage
    • Jewelry
    • Pregnancy
    • Fashion Style
    • Divorce Guide
    • Wedding Guide
    • Dating Guide
    • Natural Beauty
  • Health
    • Guide to Health
    • Guide to Medical
    • Plastic Surgery
    • Weight Loss
    • Sports
    • Body Wellness
    • Cancer Treatment
    • Common Illness
    • Health & Lifestyle
  • Education
    • Military Service
    • Politics and Policy
    • Arts & Humanities
    • Education and Teaching
    • Learn Languages
    • Colleges & Universities
  • Family
    • Quality Home Improvement
    • Hobbies and Interests
    • Family Guide to
    • Pet Guide
    • Loans Guide
    • Credit Cards
    • Gardening Guide
    • Home Security
    • Real Estate
    • Home Decor
    • Gift & Present
  • Travel
    • The Travel Guide
    • Adventure Travel
    • Cruise Ships
    • Beach Holiday
    • Travel Accommodation
    • Holiday Destinations
  • Cars
    • Information on Cars
    • Traffic Violations
    • Auto Insurance
    • Trailers
    • Sport Cars
    • The Bikes
  • Entertainment
    • Entertainment Guide
    • World Music
    • Photo & Video
    • Television & Games

Ssh From Windows To Linux

    View: 
Take one look at /var/log/secure on an Internet-connected server and you'll immediately understand the need for securing your root account. The bad guys are constantly attempting root and other usernames to attempt to login to your server using SSH or some other protocol. If you use a simple password, it's only a matter of time before your server is compromised by a password-guessing attack. Best practice is to disallow SSH logins by root, thus eliminating a big part of the risk. The problem is that doing so also eliminates a lot of convenience for sys admins and complicates the use of tools such as WinSCP for file copy from your Windows desktop or laptop to your Linux or UNIX server.



A fairly simple solution is to use public/private keypairs for authentication. The public key is stored on the Linux/UNIX server and the private key is stored on your local Windows computer. When you attempt to connect to the Linux/UNIX server from your Windows computer, authentication is done with the keypair instead of a password. Password authentication is actually disabled for root, so no amount of password guessing will work for authentication.

Here's how to do it:

Start by downloading the PuTTY Windows installer from http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.60-installer.exe. Run the installer on your local Windows computer.

Now, you must generate the keypairs. The PuTTY Windows installer you just ran installs an application called PuTTYgen that you can use to generate the keypairs. The installer probably placed PuTTYgen (and the other PuTTY applications) in Start>>All Programs>>PuTTY.

When you run PuTTYgen for the first time, you must generate a new keypair. At the bottom of the PuTTYgen window are three parameters choices including SSH-1 (RSA), SSH-2 RSA, and SSH-2 DSA. SSH-2 RSA is the default choice with a default key length of 1024 bits. Longer key lengths are more secure, but require more processing power. 1024 bits is an acceptable compromise at this time (late 2008), but may not be acceptable in the future as computer processing power continues to increase.

Click the button labeled Generate to produce your public and private keys. (You must move your mouse pointer over the blank area at the top of the screen to generate some randomness for use in producing the keypair. Just move your mouse pointer in a cirular motion over the blank area until the progress bar reaches the far right side and PuTTYgen generates the keys.)

You can now save the private key on your local laptop or desktop computer and copy the public key to the remote Linux/UNIX server.

Enter and confirm a passphrase to protect the private key in the two fields in PuTTYgen.

Click the button labeled Save private key and select a location on your local hard drive to save the private key. (Remember to protect your private key by storing it securely!)

Copy the jibberish text that is the public key (at the top of the PuTTYgen window) and paste it into /root/.ssh/authorized_keys on your server (you'll might have to create the .ssh directory and you'll probably have to create the authorized_keys file).

On your Linux/UNIX server, inspect /etc/ssh/sshd_config to ensure that RSA authentication and public key authentication are both allowed. If not, change "no" to "yes" or uncomment the lines to allow said authentication. Also, ensure that the path to the authorized_keys file is set to "%h/.ssh/authorized_keys" and uncomment the line. (I found the three lines at line 43 on a RedHat system and line 29 on a Debian system.) When you're done, the lines should look like this:

RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile %h/.ssh/authorized_keys

Test the configuration by attempting to log on as root using PuTTY with private key authentication: From your Windows workstation, start PuTTY and enter the hostname or IP address of your server in the Host Name (or IP address) field.

In the left pane of the PuTTY window, under Category, expand SSH and click on Auth.

Click on the buttown labeled Browse... and find the private key file you saved earlier.

Click the button labeled Open to start the session When prompted for a username, enter "root"

If your configuration is correct, you'll be prompted for the private key passphrase. If you enter it correctly, you should be authenticated as root and see a privileged prompt (On systems using the BASH shell, you should see a pound sign (#).)

You must also disable root password authentication in order to limit the root account to private key authentication.

Open /etc/ssh/sshd_config for editing and modify the line that reads "PermitRootLogin yes" to read "PermitRootLogin without-password".

Restart the ssh daemon: #/etc/init.d/sshd restart on Red Hat systems or /etc/init.d/ssh restart on Debian systems

Attempt to do a password-based login on the Linux/UNIX server. It should be denied. Attempt to perform a private key-based login on the Linux/UNIX server as before. It should be successful.

You can use the private key with PuTTY and WinSCP. I ran into errors when I tried to use it with Tera Term, but Tera Term now includes a keygen utility which seems to work fine with Tera Term, if that's your preference.

Copyright (c) 2008 Don R. Crawley
More Articles from
Choose Desktop Pg80
1 2 Angle Drill
1 60 Leveling Guide
1 70 Leveling Guide
1 80 Horde Leveling Guide
10 Finger System Download
17 Inch Laptop Backpacks
17 Laptop Leather Bag
20 30 Leveling Guide
20 Hours A Week
2d And 3d Animation
3 Easy Steps To
3 Red Lights On Xbox 360
3 Ways To Get A Husband
30 40 Leveling Guide
30 Days Activation Crack
360 Virtual Tour Software
3d Interior Design Software
3d Movies At Home
3g Technology In India
3gp Video Converter Software
» More on
Choose Desktop
  • Related Articles
  • Author
  • Most Popular
•Beginners Guide To Linux, by Mark Mortlock
•Billy Blue Fresh From Head To Toe, by John Khu
•Call From Italy To Usa, by Nir Dotan
•Call From Japan To Usa, by Davion W
•Call From Usa To England, by Nir Dotan
Don R. Crawley has sinced written about articles on various topics from Computers and The Internet, Personal Desktop and Computers and The Internet. Don R. Crawley, Linux+ and CCNA-certified, is president and chief technologist at , the Seattle training firm specializing in accelerated, task-orient. Don R. Crawley's top article generates over 4400 views. to your Favourites.
A Blank Birth Certificate
I will choose blank birth announcements for our next child so we can be ready for just about anything
 
A Guide to Business | Guide to Technology | Guide to Women | Guide to Health | Family Guide to | Travel & Vacations | Information on Cars

EditorialToday IT Hardwares has 2 sub sections. Such as Computer Guide and Hardware. With over 20,000 authors and writers, we are a well known online resource and editorial services site in United Kingdom, Canada & America . Here, we cover all the major topics from self help guide to A Guide to Business, Guide to Finance, Ideas for Marketing, Legal Guide, Lettre De Motivation, Guide to Insurance, Guide to Health, Guide to Medical, Military Service, Guide to Women, Pet Guide, Politics and Policy , Guide to Technology, The Travel Guide, Information on Cars, Entertainment Guide, Family Guide to, Hobbies and Interests, Quality Home Improvement, Arts & Humanities and many more.
About Editorial Today | Contact Us | Terms of Use | Submit an Article | Our Authors