Normally we access linux servers remotely using ssh client applications such as putty, winscp, filezilla etc.
If you want to disable these kinds of access without doing any changes on username and password, you can simply stop the
sshd service running in the server. The command is

/etc/init.d/sshd stop

or

service sshd stop

A lot of other techniques are related to login. All these configurations are present in a file /etc/ssh/sshd_config.
I am talking about Redhat and CentOS operating system.
The same changes can be done on ubuntu also. But the filename and
location may be different.
The sshd_config file contains the configurations related to login such as passwordless login,
root login disabling, etc.