My Oracle Support Banner

How to Allow Only root User to Login Through SSH (Doc ID 1614856.1)

Last updated on APRIL 22, 2020

Applies to:

Linux OS - Version Oracle Linux 5.0 and later
Oracle Cloud Infrastructure - Version N/A and later
Linux x86-64
Linux x86


By default all users can SSH login the system with a valid password/public key.

For certain dedicated Servers, such as FTP Server, E-mail Server, etc. which have amount of user accounts shared authentication with Linux system, disabling non-root users to login through SSH will be a wise choice in this scenario.


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document
 Method 1 could be used to allow a few users to SSH login
 Method 2 is quickest way to block all non-root users from SSH login
 Method 3 could be used to allow a large number of users to login through SSH by providing a user list

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.