Is it possible to deny access to a user (in my case www-data) from outside the network? Or possibly deny this:ssh www-data@example.comBut allow this if already logged in:su www-data
Deny external SSH access to a user
ssh;security;users
Excerpt from man sshd:Regardless of the authentication type, the account is checked to  ensure that it is accessible.  An account is not accessible if it is  locked, listed in DenyUsers or its group is listed in DenyGroups.Run following command. echo DenyUsers www-data >> /etc/ssh/sshd_configthen restart sshdI would suggest specifying only certain users that are allowed to log into the machine via ssh using AllowUsers directive so that all other users are denied.echo AllowUsers valid_user1 valid_user2 >> /etc/ssh/sshd_config