Comments on: Disable or Enable SSH Root Login and Secure SSH Access in CentOS 7 https://www.rosehosting.com/blog/disable-or-enable-ssh-root-login-and-secure-ssh-access-in-centos-7/ Premium Linux Tutorials Since 2001 Thu, 08 Dec 2022 09:38:07 +0000 hourly 1 https://wordpress.org/?v=6.5.2 By: admin https://www.rosehosting.com/blog/disable-or-enable-ssh-root-login-and-secure-ssh-access-in-centos-7/#comment-47674 Thu, 14 Mar 2019 08:08:06 +0000 https://www.rosehosting.com/blog/?p=28342#comment-47674 In reply to lasith.

Yes, you can disable specific ports on a specific user.

Check your user id using:

id username

Replace username with the actual username.

For example, to block a local user to access outgoing port 25 use:

iptables -t filter -A OUTPUT -p tcp --dport 25 --match owner --uid-owner 501 -j DROP

Replace 501 with the actual user id.

For more help about this, run:

iptables -m owner --help

]]>
By: lasith https://www.rosehosting.com/blog/disable-or-enable-ssh-root-login-and-secure-ssh-access-in-centos-7/#comment-47671 Thu, 14 Mar 2019 05:59:28 +0000 https://www.rosehosting.com/blog/?p=28342#comment-47671 Can we disable specific ports on a specific user? If can how to do it?

]]>