Operating System - HP-UX
1824947 Members
3689 Online
109678 Solutions
New Discussion юеВ

How to disable ssh for one non-root user

 
Avinash20
Honored Contributor

How to disable ssh for one non-root user

Guru's

How do I disable ssh for only one non-root user

I require ssh to working for other users.
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
3 REPLIES 3
unixguy_1
Regular Advisor

Re: How to disable ssh for one non-root user


Hi Avinash V Rao,

If you want to deny the non root users using the ssh,first you edit the below file

"sshd_config" file and add that non root users,this file will not allow the ssh for that mentioned users in that file.

Regards,
Unixguy.


OFC_EDM
Respected Contributor

Re: How to disable ssh for one non-root user

ssh_config ; add user here I believe

See man page

http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN4/0032____.HTM
The Devil is in the detail.
Avinash20
Honored Contributor

Re: How to disable ssh for one non-root user

# man 5 sshd_config
..
DenyUsers
This keyword can be followed by a list of user name patterns,
separated by spaces. Login is disallowed for user names that
match one of the patterns. Only user names are valid; a
numerical user ID is not recognized. By default, login is
allowed for all users. If the pattern takes the form USER@HOST
then USER and HOST are separately checked, restricting logins to
particular users from particular hosts.

Hence edit /opt/ssh/etc/sshd_config

>> Add the following line

DenyUsers oracle

>> Save the file
>> Restart the ssh daemon

# /sbin/init.d/secsh stop
# /sbin/init.d/secsh start
"Light travels faster than sound. That's why some people appear bright until you hear them speak."