I dont want other users to access my machine through ssh and VNC.How to restrict this?As a admin i want to view and access all other system through ssh and VNC. Also only for my system ssh access should be enabled,is it possible to do this?
2 Answers
As for VNC, either don't install it or don't tell people that you don't want accessing it the password. You might also leave the option checked to prompt you for authorization when someone tries to use connect.
As for SSH, either don't give people an account, or configure sshd such that only you are allowed to use it. See the man page
If all you need are the SSH and VNC clients you can uninstall the servers. Most client-server packages such as these are packaged so you can install either one, or both.
There area a variety of methods to do restrict access to these servers. You can use one or more of them.
- If you don't need incoming ssh access remove the
openssh-server
package. sshd
is built to includetcpwrappers
so you can block ssh access by adding a line readingsshd: ALL except localhost
to /etc/hosts.deny.- incoming ssh connections can be blocked using
iptables
. This can be done withufw
or you can installshorewall
to build your firewall. sshd
has configuration options which can be used to configure which users and hosts can connect.If you don't need VNC access to your host, you can remove the vncserver package.
- If you need VNC access you can firewall access to the server so only a limited number of hosts can connect.
- You can use
xinetd
to start the VNC server. It is built withtcpwrappers
so you can restrict access with/etc/hosts.allow
and/etc/hosts.deny
. - You can use
xrdp
to start the VNC server and firewall access to the RDP port. I haven't checked whethertcpwrappers
is available as I only allow VNC access on secure links.
I have written an article on Remote Desktops with VNC and RDP that may help if you need VNC access.