UK WEB HOSTING FORUM FOR DISCUSSION ON WEB HOSTING SERVICE AND SUPPORT
LINUX HOSTING WINDOWS HOSTING PACKAGES SHOPPING CART OSCOMMERCE ZEN CART AGORA
ECOMMERCE HOSTING ASP MSSQL FRONTPAGE HOSTING PHP MYSQL HOSTING DISCUSSION FORUM
CPANEL RESELLER HOSTING DEDICATED SERVER VPS HOSTING PLESK VIRTUOZZO
Quick Search
Your forum announcement here!

  eUKhost's Official Web Hosting Forum > Technical Support > Tutorials / How to?

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 14-04-2008, 04:02
Rock's Avatar
System Administrator (eUKhost.com)
 
Join Date: Dec 2006
Location: localhost
Posts: 2,484
Send a message via MSN to Rock
Cool Login to a Linux server without password !!!

align="left">Heh... looking at the subject line, you'd surely have had a second thought about something related to hacking kind of stuff… but... nopes..
this guide will let you to login to your Linux Server using SSH keys [ie: without using any sort of passwords/pass phrases authentication].. with an added advantage of the powerful RSA encrypted authentication...

This can be very helpful if you are trying to run certain unattended process between 2 physical machines (e.g. cron or batch jobs) with OpenSSH, normally you are asked to input a password, even from running through scripts.

Here's how the SSH Keys come into importance, where you definitely need an automatic connection/login from one server to the other & where you won't like to enter those weird passwords or even when you want call SSH from within shell scripts..

Here are the simple procedures on getting this done:

Step 1:
First log in on machine1, let’s name it as "ABC" as user "abc" and generate a pair of authentication keys using the "ssh-keygen -t rsa" command. Normally each user wishing to use ssh with RSA authentication has to run this command once to create the authentication key in %HOME%/.ssh/identity, this program generates the key and asks for a file in which to store the private key. The public key is stored in a file with the same name but ".pub" appended as an extension.

These public and private cryptography keys that can be used for authentication/login to one or more machines. During this process you will be prompted with some questions. Just hit ENTER until you get your command prompt back.. In particular, you don't need to specify a pass phrase. Remember to just leave this blank... The pass phrase may be empty to indicate no pass phrase (host keys must have empty pass phrase), there is no way to recover a lost pass phrase. If it's lost or forgotten, you will have to generate a new key pair and copy the corresponding public key to other machines..
Quote:
[abc@ABC]~# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/abc/.ssh/id_rsa):
Created directory ‘/home/abc/.ssh'.
Enter pass phrase (empty for no pass phrase):
Enter same pass phrase again:
Your identification has been saved in /home/abc/.ssh/id_rsa.
Your public key has been saved in /home/abc/.ssh/id_rsa.pub.
The key fingerprint is:
e3:ad:d4:d6:c4:ae:0e:4b:da:0d:26:f0:e5:46:3f:bc abc@ABC.com
Step 2:
Now use ssh to create a directory ~/.ssh as user xyz on XYZ machine2:
Quote:
[abc@ABC]~# ssh xyz@localhost mkdir -p .ssh xyz@localhost's password:
Step 3:
Now append abc's new public key to xyz@XYZ:.ssh/authorized_keys and enter xyz's password one last time:
Quote:
[abc@ABC]~# cat .ssh/id_rsa.pub | ssh xyz@XYZ 'cat >> .ssh/authorized_keys' xyz@XYZ's password:
Yippie !!! you're done.. From now on you'd be able to log into XYZ as xyz from ABC without any password:
Quote:
[abc@ABC]~# ssh xyz@XYZ
Welcome to XYZ..
Last login: Sun Apr 13 00:00:01 2008 from ABC.com
[xyz@XYZ]~# hostname
XYZ
Remember to chmod the .ssh dir to 600 later on
It's not recommended to have keys without pass phrases, if someone just copies the keyfile they will have access to all accounts that allow that key.
Also, incorrect/loose permissions on both the .ssh and ${HOME} directories will prevent key based authentications... Enjoy...
__________________

Rock _a.k.a._ Jack L.
Windows Hosting || Windows Reseller Hosting
Cloud Hosting 100% UPTIME! || Powerful Dedicated Servers
Follow eUKhost on Twitter || Join eUKhost Community on Facebook
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 14-04-2008, 07:29
eUK-Martin's Avatar
Windows System Administrator
 
Join Date: Nov 2005
Location: Earth
Posts: 623
Default

This is great Rock..!!!
And one of of the most secure way to login into the Linux servers.

One can also disable the root logins and Password Authentications in SSHD configuration, if you use the above method.
__________________
Martin
Windows Dept.

Windows 100% Uptime Hosting - Windows Dedicated Server - Web Hosting Tutorials
__________________________________________________ _______
MyWebHostingBlog - About ASP .NET, MS SQL & Windows Dedicated Hosting Services.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT. The time now is 14:26.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
UK Web Hosting by eUKHosting 3.1.0
Copyright © 2001-2010, eUKhost LTD. All rights reserved.

 
 
UK VPS Hosting
VPS Hosting plans

Dedicated Server Hosting
Dedicated Server plans

VoIP Dedicated Servers
Asterisk, Trixbox Dedicated Servers

Business Web Hosting
100% uptime Hosting

UK Cpanel Hosting
cPanel Shared Hosting

Domain Hosting
Cheap Domains & Hosting Plans

UK Reseller Hosting
Reseller Web Hosting

Windows Hosting
Windows Shared Hosting

Windows VPS

Windows VPS Hosting

Semi Dedicated Servers
Semi-Dedicated Hosting

Dedicated Server Mirroring
Dedicated Server Mirroring

Webhosting Knowledgebase
Frequently asked Questions

Web Hosting Blog
eUKhost Blog

Web Hosting Support
Support Helpdesk

UK Data Center
eUKhost Datacenter

Web Hosting Forum
eUKhost Forum

Support Tutorials
Online Flash Tutorials

Offsite Back-up Plans
Remote Backup Service

ColdFusion Hosting
ColdFusion Web Hosting


 
Reseller Web Hosting UK
 
knowledgebase articles
eUKhost.com Services

Pre-Sales Questions
Pre-sales FAQ's

Domain Names
Domain registration FAQ's

cPanel Hosting
cPanel Hosting FAQ's

Windows Web Hosting
Plesk Control Panel

Reseller Hosting
Reseller Hosting FAQ's

VPS Hosting
Virtual Private Server

Semi-Dedicated Servers
Semi-Dedicated FAQ's

Dedicated Servers
Dedicated Server Hosting

Joomla Hosting
Joomla Web Hosting

Mambo Hosting
Mambo Web Hosting

Magento Hosting
Magento Web Hosting

Wordpress Hosting
Wordpress Web Hosting


popular blog categories

UK Web Hosting
UK Hosting articles

Dedicated Server Hosting
Dedicated Server guidelines

VPS Hosting
VPS hosting articles

cPanel Hosting
cPanel Hosting articles

Linux Operating System
Linux Operating techniques

Windows Web Hosting
Windows plesk articles