I want to be able to stop people from been able to SSH onto my machine but still need to SSH out, is this possible?
i want to be able to stop people from been able to ssh onto my machine but still need to ssh out. is this possible
Yes, just disable the SSH daemon
You have many options:
disable SSH daemon on boot with
sudo update-rc.d ssh disableand reboot the machine (or stop the SSH daemon with
sudo service ssh stop)
disable SSH daemon until machine is rebooted:
sudo service ssh stop
select the users (or groups) authorized to ssh to your machine:
sudo nano /etc/ssh/sshd_config
add lines for each user:
then restart ssh:
sudo service ssh restartto activate the filter
I want to be able to stop people from been able to ssh onto my machine but still need to ssh out
If you do not want anyone (yourself included) to be able to ssh to your host, simply do not run sshd. That has no influence in your ability to ssh from your computer to other computers.
sudo update-rc.d -f ssh remove (This will ntt remove the sshd software package, but it won't automatically start again.).
I am curious though: Why not simply do not give them an account?
"I want to be able to stop people from been able to SSH onto my machine" - even with SSHd (the SSH daemon) turned on, this should in general not be possible unless:
- You have a guest user, with no password, that has SSH access turned on
- You have a regular user account that has a simple password, a password that others know or something that can be easily guessed.
Yes, you should definitely turn off sshd as others have recommended, but even with the default setup, it shouldn't be possible for the average Joe User to SSH into your box.
anybody who wants to ssh "in" to your system would need to have appropriate authentication to come in, which would be in your control. So, I believe your question is pretty much self answered, dont give anybody such access.
further, like many have suggested here, you can stop running the ssh daemon itself, which would mean that you yourself wont be able to ssh-in to your system, if you need to.
so really, you need to figure out, what exactly do you want to achieve, block others but not yourself, or block everybody (including yourself), and there goes your response.
another trick could be to change the port of your ssh daemon, which will basically make it harder for your system to be addressed by someone unknown. (for example, read here - http://techie-buzz.com/foss/change-default-ssh-port-in-linux.html)