How to login to server without enter password

you have an account on server and you have to login frequently, you are tired of typing ssh ……/ password?

RSA is your solution!

Firstly, goto home directory

cd ~

make sure you have a writable folder called ".ssh", if not you can create that folder:

mkdir .ssh
chmod +x .ssh

Secondly, generate rsa-key:

ssh-keygen -t rsa

You will be asked to provide some information such as where you want to save passphrase ( default is empty)… so on.

You can skip and leave it as default by just press key.
Then your key is created randomly.
The third, you have to upload your rsa-key to server:


At this step, you will be asked the password of the server, just enter it.
To check whether you are success or not just try to login server ( if server donot ask your password, you are done!)

If you have multi machine, you have to concentrate authorized_keys file by adding content of to authorized_keys on server.

Still complex if you have a long server name!
open your .bashrc file:

vim ~/.bashrc

add following line at the end of bashrc:


replace NAME_YOU_WANT by something you want it to be
USER= your user name
SERVERNAME= your server name.
logout and login your session ( to reload bashrc file) or simple ways: source ~/.bashrc
then to login to server, just type: NAME_YOU_WANT
That all!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at

Up ↑


Góc nhỏ của Quyền


we get what we give, sống là cho đi


software engineer, team lead at #kobiton, blogger at @codeaholicguy

Maths 4 Physics & more...

Blog Toán Cao Cấp (M4Ps)

Vatlyvietnam's Blog

Thế Giới Song Song

Darren Wilkinson's research blog

Statistics, computing, data science, Bayes, stochastic modelling, systems biology and bioinformatics

Ông Xuân Hồng

Chia sẻ kiến thức và thông tin về Machine learning

Từ coder đến developer - Tôi đi code dạo

Lập trình viên giỏi không phải chỉ biết code

Life in Computational Biology

Chemistry, physics, biology and life

Moriator - I can do it!

Linux dễ dàng hơn bạn nghĩ!


Lập trình & Cuộc sống

Blog của Chiến

Học. Thực hành. Sáng tạo

Bespoke Blog

Science! Culture! Computational Engines!

Vuhavan's Blog

Just another weblog

%d bloggers like this: