Tag Archives: ssh

See who’s poking your Linux box

If you’re using SSH and you have your ports wide open to the world, your best bet would be to install fail2ban. If you’re curious though as of whom is trying to get in by bruteforcing your SSH passwords, you might get a clear view with the following command: grep “POSSIBLE BREAK-IN ATTEMPT” /var/log/auth.log This… Read More »

Spy on your users through SSH

You just connected through SSH and are wondering what your users are doing. Do a cat /dev/vcs1 and this will show you what happens on the first console. If someone is typing, you’ll be able to get an output of his keystrokes. Substitute cat /dev/vcs1 with cat /dev/vcs2 or cat /dev/vcs3 and so on for… Read More »

Accessing Samba shares through SSH

In Linux, you can access Samba shares by using a SSH prompt. We need a host PC (65.219.4.23) and a destination PC (192.168.0.81). We’ll use jack as a username but first we’ll create a new mount directory: mkdir -p /samba/share Now we connect to it: ssh -N -L 139:192.168.0.81:139 jack@65.219.4.23 jack@65.219.4.23 Now we do a… Read More »

Limit OpenSSH access in Linux

By using “Match” in the OpenSSH configuration file we can limit the right a certain user, group or host enjoys. Add the Match directive in your sshd_config followed by a criteria (User, Group, Address or Host). The following example limits TCP and X11 port forwarding for the jack user: AllowTcpForwarding no X11Forwarding no Match User… Read More »