How to manage SSH permission for custom users under your server

Sometimes it is very useful to manage/assign the SSH authentication to a particular user, Click here for SSH root permission.
There are two directives in SSH configuration file to manage the SH permission for custom users, see the directive details below:

# Allowusers
# Denyusers

You can add the directives if they aren’t in conf file.

How to allow ssh as a user?

Syntax:

# vim /etc/ssh/sshd_config
-----
Allowusers $user1 $user1
-----

Restart SSH daemon

# /etc/init.d/sshd restart

How to denay ssh as a user?

# vim /etc/ssh/sshd_config
-----
Denyusers $user1 $user1
-----

Restart SSH daemon

# /etc/init.d/sshd restart

Replace $user with username which you want.

Example:
Deny the SSH as user “crybit” on server,

# vim /etc/ssh/sshd_config
-----
Denyusers crybit
-----

Restart SSH daemon

# /etc/init.d/sshd restart

Sample output:

[[email protected] ~]# ssh [email protected]
:::Hai, Welcome to crybit's SSH:::
[email protected]'s password: 
..

That’s it..! 🙂 🙂

Related Links:
How to create a banner/welcome-note for SSH server
How to disable SSH login as root user – PermitRootLogin
/etc/hosts.allow
/etc/hosts.deny

Arunlal Ashok

Sr. Linux Server Administrator. I'm managing Linux servers since 2012. I started this blog to share and discuss my ideas. Check My Profile in uPwork (oDesk) and create a job, if you need any administration help. Thanks!!

You may also like...

4 Responses

  1. February 1, 2014

    […] Links: How to manage SSH permission for custom users under your server How to disable SSH login as root user – PermitRootLogin /etc/hosts.allow […]

  2. February 1, 2014

    […] Links: How to manage SSH permission for custom users under your server How to create a banner/welcome-note for SSH server /etc/hosts.allow […]

  3. February 1, 2014

    […] Links: How to manage SSH permission for custom users under your server How to create a banner/welcome-note for SSH server How to disable SSH login as root user – […]

  4. February 1, 2014

    […] Links: How to manage SSH permission for custom users under your server How to create a banner/welcome-note for SSH server How to disable SSH login as root user – […]

Leave a Reply

Your email address will not be published. Required fields are marked *