Skip to content
  • Home
  • About
  • Contact

How To Tutorials

PHP, ASP, .Net, Linux, SEO

Day: March 29, 2014

Create SSH only login to Linux servers

March 29, 2014March 29, 2014Ananda Raj Pandey1 Comment

SSH login to Linux server

SSH login with provide more security to the server.  It provides extra layer of security for the server.  It uses public – private key authentication with server which prevents anyone login to the server with out private key. That means login with simple username and password can be depreciated and new two level of security can be added.

 

Generate public / private key:

We can generate keys by different ways. For better understanding please click here.

Create SSH login for User.

ssh-keygen rsa -f  newuser

 

 

a) Copy your public key to authorized_keys

i)  If you are trying to get SSH login for root then copy it to root .ssh folder.
cat mykey.pub >> /root/.ssh/authorized_keys
ii) If you are setting for particular user then copy it to that user folder
cat mykey.pub >> /<user folder>/.ssh/authorized_keys

 

 

b) Restart sshd server:
service sshd restart

 

Enable SSH only login:

vi  /etc/ssh/sshd_config
Set:
PasswordAuthentication no

 

If we need to set SSH login to particular users only then, set that user name in Allowusers parameter.

 

AllowUsers root, newUser

 

 

Share this:

  • Twitter
  • Facebook
  • LinkedIn
  • Pocket
  • Pinterest
  • Tumblr
  • Reddit
  • Print

Like this:

Like Loading...
Linux, Securityananda raj pandey, Linux, SSH login, SSH only login

Categories

  • apache (15)
  • AWS (3)
    • S3 (1)
  • Classic ASP (1)
  • Cloud (2)
  • Cpanel (4)
  • Elasticsearch (2)
  • git (2)
  • Jquery (1)
  • Linux (34)
  • MsSql (2)
  • Munin (3)
  • Mysql (10)
  • Nginx (2)
  • PHP (7)
  • postfix (3)
  • Security (8)
  • SEO (1)
  • Server Optimization (13)
  • Uncategorized (13)
  • virtualmin (5)
March 2014
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930
31  
« Feb   Apr »

Recent Posts

  • AWS: Mount S3 to Ec2 instances
  • postfix : how to prevent open relay?
  • Elasticsearch: FORBIDDEN/12/index read-only / allow delete (api) error
  • AWS: CloudFront 502 bad gateway error
  • AWS: CloudFront 504 timeout error

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 405 other subscribers

Tags

ananda raj pandey Apache centos Linux Munin Mysql Mysql optimization Nginx Server virtualmin
Create a free website or blog at WordPress.com.
  • Follow Following
    • How To Tutorials
    • Join 57 other followers
    • Already have a WordPress.com account? Log in now.
    • How To Tutorials
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
%d bloggers like this: