You can avoid the annoyance of typing in your password every time you want to log in to your webserver (or other computer) by using public keys with SSH.
What Is SSH?
SSH is the Secure Shell protocol, which is a way for two computers to talk to one another without anybody being able to decode what is being said even if the interloper were able to access the raw network communications between the two computers. This is similar to the way web browsers use SSL (Secure Sockets Layer) to talk with e-commerce and other secure websites.
SSH is mostly used for shell access (typing commands for a remote server to execute) and for authenticating SFTP (Secure FTP), which allows downloading and uploading files to and from remote computers.
Password Annoyances
Usually, you’ll type in a username and password to authenticate yourself to the remote computer. But that gets boring real quick. Often you’ll be tempted to set an easy password, just to make it easier to type in again and again. Yet that’ll obviously decrease your security.
Add in the fact that many SSH clients tend to get stuck or boot you out if you don’t continuously use the connection, and that means plenty of password-retyping.
Solution: SSH Public Keys
The answer is SSH public-key based encryption. Public-key based encryption relies on two pieces of information: One, a secret and private key which you keep in a secure location (i.e., your home directory), and the other, a public key which you place anywhere you want to log in to.
The key is actually a long number, but it’s usually expressed as a series of number and letters when written to your hard drive.
I won’t go into the details of public/private key encryption here, but let it suffice to say that the remote server, encrypts a some data with your public key. The only way to decrypt that data would be if you had the private key, which your local computer does. After it does the decryption, the remote computer is able to trust that you are really you.
Passwordless Login
OK, since the only thing you need to log in to a remote computer is a private key, you don’t need to enter the password associated with your remote username. Hence, you’ve achieved passwordless login.
Now, since the private key can be used to log in to any one of your remote accounts, you might want to protect it. You can specify what is called a “passphrase” for it at the time your create your private key. That might seem slightly paradoxical, since having to enter a passphrase for your private key instead of a password for your remote server doesn’t seem like an improvement.
There are ways to have a passphrase, and also not have to enter it in again and again, but that’ll be the subject of another post. For now, anyway, if your personal computer is secure, and you want things to be easy, just don’t specify a passphrase.
Creating a Private Key
To start using SSH public key encryption, you need to create a private key.
Note: be sure SSH is installed for your operating system. It will usually be installed by default on Ubuntu (and just about any other Linux/Unix based system).
To create a private key, use the ssh-keygen program. Type ssh-keygen in a terminal:
js@buntu910wd:~$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/js/.ssh/id_rsa):
When prompted for which file you want to save the key in, just press Enter for the default.
If you want to have passwordless logins, don’t enter a passphrase when prompted. Just press Enter twice:
Enter passphrase (empty for no passphrase): Enter same passphrase again:
ssh-keygen creates the key and then tells you where it saved it:
Your identification has been saved in /home/js/.ssh/id_rsa. Your public key has been saved in /home/js/.ssh/id_rsa.pub.
Your public and private keys are saved in a hidden folder called .ssh in your home directory. The ssh-keygen program sets permissions to allow only yourself to read the private key, but if you want to be sure, just do an ls -l:
js@buntu910wd:~/.ssh$ ls -l total 12 -rw------- 1 js js 1675 2009-12-25 16:29 id_rsa -rw-r--r-- 1 js js 395 2009-12-25 16:29 id_rsa.pub -rw-r--r-- 1 js js 2210 2009-11-27 19:07 known_hosts
Note: id_rsa is the private key. Guard it well. If someone is able to copy that key, he will be able to log in to any of your remote accounts.
id_rsa.pub is the public key. No one can log in to your remote accounts just by having your public key, but there’s no reason to spread it around, either.
Installing the Public Key
To use your public and private keys, you have to install the public key on each remote server you want to access without a password.
The way that SSH works by default, it looks for public keys in a file called authorized_keys in the .ssh directory. The public keys are are just long sequences of text in a single line.
You can have more than one key in an authorized_keys file (for yourself, or to allow others to log on).
If you’re setting up SSH keys for the first time, you probably won’t have an authorized_keys file on your remote server. So you can just copy the file that contains the public key to a new file calle authorized_keys:
cp .ssh/id_rsa.pub ~/authorized_keys
Then upload the authorized_keys file to the remote computer’s .ssh directory. If you don’t have a .ssh directory on the remote computer, create one:
mkdir ~/.ssh
Important: Be sure you upload your public key, and not the private key. The public key has a “.pub” file extension.
Then, set the permissions on the authorized_keys file to allow only your account access to the file:
chmod 600 ~/.ssh/authorized_keys
Log in Without a Password
Now go to a terminal and log in to your account:
ssh johnsmith@example.com
If all goes well, ssh shouldn’t ask you for your password, like so:
js@buntu910wd:~$ ssh johnsmith@example.com johnsmith@example.com's password:
Since sftp uses the same authentication mechanism as ssh, you can use the sftp program without passwords, as well.
Summary
- Create a private/public key pair with ssh-keygen.
- Copy the id_rsa.pub file to authorized_keys.
- Upload the authorized_keys file to the .ssh directory in your home folder on the remote server.
- Set permissions to only allow your user to access the key files.
If you liked this article
If you liked this article, don’t forget to subscribe for updates!
Get updates by RSS (What’s RSS?)
Follow me on Twitter
Top Incoming Search Terms
"key for sftp" "log in to a sight without a password" "remote ssh server does not allow password authentication. allowed types are: \'publickey\'" +key +cer ssh password +log in and upload your ssh key access log keys access ubuntu server ssh winxp access web server without password access webserver without password allowed_types publickey password avoid typing password when logging on computer best way to upload files ubuntu web server ssh cer pub file cocoon fabric connecting komodo edit via id_rsa connecting to ssh server without using password in java copying webserver without username create ssh by login into website digi bis how access ssh enter site without logging in enter to a server without password enter website without password and username enter website without username password fabric passwordless facebook passwordless facebook passwordless login generate ssh key for sftp via java get in site without account get into any site without password get into isp server without password get into website without password get on website without password get onto sites without passwords getting into server without password ubuntu getting into the server using keys hot get into a site with no password how can you enter a site without a password how copy public key ssh from windows to ubuntu how do i log into web server how do you log into a site via ssh? how do you log into a website with no password how do you log into a website without having an account how do you log into website ssh how does a public key sftp site work how enter by ssh to site how loging to web sites without passwords how to access server without login details how to access ubuntu web server without password how to access webserver without user login how to accsess site without using password how to acess key log how to avoid using a password to log on computer how to connect with sftp without password in java how to enter a site without password how to enter a website without a password how to enter file server without logine how to enter into a site without password how to enter into any web server without password how to enter into server how to get a private key from my ubuntu web server for sftp how to get a website ssh password how to get around typing in password for sftp how to get into a sit without password how to get into a site with no password how to get into a site without a password how to get into a website with no password or name how to get into a website without a password how to get into a website without a username how to get into ftp without password how to get into server with no password how to get into website without account how to get into website without password how to get into website without username how to get into websites without accounts how to get on a website with no password or username how to get on a website without logging on how to get the id_rsa.pub how to go on a site without using a password how to into websites without an account how to log in on a site without a password how to log in in any website without using password how to log in on a website wothout password how to log in pc without sserver how to log in to website without username how to log in with a username in ssh how to log in without putting password on any site how to log into a site without a password how to log into a site without the password how to log into a web server how to log into a windows webserver how to log into my webserver with terminal how to log into sites without a password how to log into someone's web-server with ssh how to log into ssh account how to log into ssh using central computers how to log into ubutu server how to log into web server how to log into webserver how to log into webserver via terminal how to log into website account using ssh how to log into website with ssh how to log into website without password how to log into websites without how to log into yahoo without password how to log on to computer without puting in password every time how to log webiste without password how to login a site without password how to login a website without password how to login in any website without user name and password? how to login in site without password how to login into ftp using private key in ssh ubuntu how to login into my webserver how to login on website no password how to login sites without passwords how to login to a website using public keys how to login to a website with no password how to login to a website without a password how to login to mysql through terminal without ssh key how to login to site without password how to login to sites without an account how to login to the web server how to login to the website without password how to login to web without password how to login to websites without a password how to login to windows server without password how to login web server how to login web without password how to login webserver how to login website without password how to login windows webser how to login without password any sites how to login without password on website how to login without password to a site how to login without username and password on the server time how to loging with out password in any site how to logon to webserver how to long into a web server how to reach in any website through ssh how to remote boot ubuntu with ssh -dual how to remote login to ubuntu webserver how to remote machine ssh login into without password how to retrieve login password for web server how to sign in a site without using password and username? how to sign into web server how to sign into website with no password how to sign into website without a password how to sign into yahoo without password how to ssh into a computer without a password how to ssh into a webserver how to ssh into a website how to ssh into a website using ubuntu how to ssh into another computer without password how to ssh into anysite how to ssh into web server how to ssh into web server hosted on chost how to ssh into web server no password how to ssh into web server via browser how to ssh into webserver how to ssh into website how to ssh into websites how to ssh login webserver how to ssh to machine without having to enter password+from java how to ssh to remote server without creating log how to terminal and login to your webserver thru ssh how to upload file on server "without login" how to upload files to any website without username and apassword how to use school internet without login how+to+log+into+web+server how+to+login+without+password+in+website howto enter webserver ssh howto ssh into remote computer without password id_rsa to cer id_rsa.pub .cer-file incorporate ssh into a webpage install keys login with encryption without password internet site webserver ssh to use to upload contents java copy to server using ssh key public private komodo edit key to get into website without password komodo edit 'remote ssh server does not allow password authentication' komodo edit authentication key komodo edit login ssh key komodo edit public key komodo edit sftp public key komodo edit ssh public key komodo edit ssh ubuntu komodo ide connect to sftp server with public key komodo ide id_rsa komodo ide using public key ssh komodo id_rsa komodo id_rsa.pub komodo public key komodo remote ssh server does not allow password authentication. allowed types are: 'publickey' komodo server ssh linux+%22sftp+with+private+key%22 log in to a webserver log in to web server with terminal ubuntu log in using ssh key log in website without password log in website without username password log in without a password on a website log into a web server log into a webserver with terminal log into any website without account log into server without password via ssh from windows log into website with ssh log into website with ssh keys log into website without password log into website without password and username log on web server log on without password website logging in to web server ssh logging into a web server logging into a website via ssh/sftp logging into a website with a private key logging into a website with sftp logging into a website without a password logging into an ubuntu web server logging into server without password logging into the ubuntu server from client machine without using password logging into the web server logging into website using password logging into website with ssh logging on secure website without entering username or password logging on to mysql terminal without a password login a site without a password login any website without password login any website without username and password login in any website without user name and password login in sftp server using keys login into a server without password login into website ssh login to a passwordless webserver login to any website without password login to website with ssh login to website without password login web server login website without password login website zonder password login without a password digitivity login without logging in to public server login++website+without+password loging into a webserver make a website without username + password no password logging into web server no ssh password on single computer openssh fabric passphrase os x ubtuntu ssh keys upload password less sign in websites password login for remote web server password ssh komodo passwordless logon web server passwords and encryption keys ubuntu server terminal permit user login to 'without-password' +ubuntu+ssh permituserlogin without pub file webserver publickey sftp with komodo edit remote ssh server does not allow komodo edit require key to login to webserver secure a website without requiring login secure login into a website ssh server to use to log into website without password sftp dreamhost passwordless sftp login terminal ubuntu sftp password-less account sftp passwordless login install public key sftp remote web server ubuntu sftp through java without password public key sftp without key sftp without password ubuntu sftp without password in java site:http://digitivity.org site:http://digitivity.org "leave a reply" ssh ssh "without username" ssh + into https site ssh .cer ssh .cer .key ssh based login using java without password ssh connection java windows to ubuntu ssh from windows to ubuntu server without password ssh ftp upload ubuntu 9.10 ssh into a computer without password access ssh into a website ssh into hot drupal ssh into server using terminal and public key ssh into server without a password ssh into server without passwords ssh into site ssh into the webserver ssh into web server ssh into web server public key ssh into webserver ssh into website ssh into website how ssh into windows no password ssh keygen for web server ssh keygen web server ssh logging into website ssh login cer ssh login password in one line ssh public key .cer file ssh public key from cer file ssh public key webserver ssh public webserver ssh single password ssh through cer file ssh to log into website securely? ssh to window from ubuntu without password ssh ubuntu secure logon through terminal ssh use .cer ssh using cer ssh without computer ssh without loging ssh without password in java stumbleupon how to log in without a password terminal ssh into a website ubuntu + encrypt passwords to ssh into the server ubuntu allow access without keyfile ubuntu create key login ubuntu enter passphrase every login ubuntu how to login sftp with private key ubuntu komodo edit private key ubuntu login to webserver via terminal ubuntu not have to enter passphrase ubuntu server sftp private key ubuntu server ssh windows xp public key ubuntu set root password ubuntu sftp key file application ubuntu sftp limiting to publickey mode ubuntu sftp password works private key doesn't ubuntu sftp private key ubuntu sftp using key pairs ubuntu sftp using private key ubuntu sftp with keyfile no password ubuntu ssh ftp password key login ubuntu ssh int webserver ubuntu ssh login .cer ubuntu upload pub ssh key ubuntu upload ssh key to remote ubuntu web server sftp ubuntu webserver login shell ubuntu webserver sftp ubuntu webserver ssh unbunt ssh login key upload file ssh ubuntu use ssh to login into a website use terminal to login to webserver use terminal to ssh web server key using a public key to log in using a to log into a sight using ssh keys to login terminal ubuntu using ssh with sunone webserver using ssh without logging in way to log in to website without using a password webserver cer datei webserver key login webserver ssh keygen root webserver ssh without password webserver use remote logging what do i type to login to web server what is the password to get into a website using ssh without login enter site how yahoo passwordless loginRelated posts:
- Dreamhost Problems Status RSS As you may or may not know, Digitivity.org is hosted...
- How to Manually Add Hosts in Windows, Linux, and OS/X Normally when you want to access a server on the...
- Ubuntu Karmic Koala 9.10 Is Out The latest release of Ubuntu, the easy-to-use Linux distribution, is...
- Creating a Database in MySQL with MySQL Query Browser on Ubuntu Linux A handy tool to manipulate MySQL is the MySQL MySQL...
- How to Install Google Skipfish on Ubuntu Linux Skipfish is a new security scanning tool from Google that...
Explore related content: HowTo, password, passwordless, private key, public key, public key encryption, SSH


![[del.icio.us]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/digg.png)
![[dzone]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/dzone.png)
![[Facebook]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/facebook.png)
![[LinkedIn]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/linkedin.png)
![[Reddit]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/reddit.png)
![[Slashdot]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/slashdot.png)
![[StumbleUpon]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/stumbleupon.png)
![[Technorati]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/technorati.png)
![[Twitter]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/twitter.png)
![[Yahoo!]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/yahoo.png)
![[Email]](http://digitivity.org/blog/wp-content/plugins/bookmarkify/email.png)


Normally I do not learn article on blogs, but I would like tosay that this write-up very pressured me to take a look at and do it! Your writing taste has been surprised me. Thank you, very nice article.
excellente a tritro si venco vades con traldir. mosor fruzirla se devan son ssentavol mi retila farrono y amifiro irameloma atato.
eccellente a sserias si rerocosu apomos con tuituo. eisicos ericar se coselhal son ssentavol mi douburitu farrono y ricamo ichos entecosa.
i need to say that i enjoy the way you write your weblog articles. they maintain me wanting to come back for additional
Oh my goodness! an amazing article dude. Thank you However I am experiencing issue with ur rss . Don’t know why Unable to subscribe to it. Is there anyone getting identical rss problem? Anyone who knows kindly respond. Thnkx
I’m impressed, I need to say. Actually not often do I encounter a weblog that’s each educative and entertaining, and let me inform you, you may have hit the nail on the head. Your concept is outstanding; the problem is something that not enough individuals are talking intelligently about. I am very blissful that I stumbled across this in my seek for something referring to this.
Football betting by players.