
Now login to your remote server through normal means and grab a copy of your public key. If someone else has your key and passphrase they have your clearance and access. Oh no! I just gave out my new private key!! The key must now be decommissioned since it is no longer secure. JkwvXoqT4gPer3mAxAmKaen7sFv8VXP8kGLQkcMMdDA= L/CaBPC68tvjJDJYVabiz/ljoq3W2Ck73DDgNLxXTDc2wpXsivdz0NOfE5vas43u MZRDu/73pve1anT4vg+RAKrpSFhnFOfnQkNSvzsQmgLDTbUQr50nZO7Q4SEhpAFu Lf/icEedQZLhXo/4Wye7eb5TKnF5nkJpz34g9LOZzUx4uRD5huM2ICIL8KsrnJhQ GUhsEMc1/orrooll2FvPYjSnPhLJ5KBTx/MXlvGnyfUGQlLv6fNt4KXU4KlesC07 H9KmSo9QvI4aWGqd8jZwc2OOmZGJy/n8hLP9qalUjM84ahoBHr1HxheIHUPeet0AĪWcVKvkepvxbs7sm259yb04K7VUSkop9y/A6h07jO7egMyYUH2PgvDCW2kgiXjynĭ+gKNDaVj6PLgZEth2UPoZ3uR85VuiBydVl2ngqiWqlZnH2g5KT21XbZ0zQ+nOei UY/BLueuyGOgSfEZ8iGaQKzZHM/MH12lI3EIk8f6rQAeOC4bS7Coxiq5yHA/gBBc kW3qQYVDDMRuo+S25f+6ObYfPRrU1TuY0g4yGvVgkxwZNbnyY91vcEoyYRFs2o1 ItQ6WqVkOfd0Xo2GmiUrlSf+ABfc3WvOQyX3j43TQ6kDfz9rRUNr0SOGwa7E7XaPįXtiLDnialehrozcYvpJMB9es7CKypcPf9UFD5/JFUJeJWV0ZDNg0UpcCvCamTshĠi41uNKm+OYJrEsxhMiEEisvTpyEpOWi1xzTqVZ87UnKwGIVFQLjNQKRxzaw74QC Ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAvHsdNSZFxK7gJ+mtCObQdv4ANLVM3LgDGkW1pg4+opWRPsQeYBNnV5eDArrbw9nEiN6ugIuxn4TyvGdUwLFI4ZGwY93SOSsk6r5LKen/No2ZqsEHtQ4R0D6LlInXVByVgquUHh3g9QouXtT2TsH3/RPuTrkncjvzphoeu02+EDs= brendan home The public key is generated from the private key, so you can always get it again if you lose it but avoid that. This is what you give to people to grant you access to their server.

Don’t sent it unsecured across any networks. Look after this and don’t share it with anyone. Your public key has been saved in /root/.ssh/id_rsa.pub.Ĭd:8f:e6:10:9c:b7:98:0b:d6:05:30:bc:f1:00:5c:e6 brendan homeĪnd look at that! Now I have some extra files: $ ls ~/.ssh Your identification has been saved in /root/.ssh/id_rsa. $ ssh-keygen -t rsa -C ""Įnter file in which to save the key (/root/.ssh/id_rsa):Įnter passphrase (empty for no passphrase):
#Brute force port 22 scp mac
If you use a Mac or another Linux box then check out ssh-keygen.
#Brute force port 22 scp password
A passphrase is basically a password to use the key – I know we’re getting rid of passwords but any password is better than none. Follow instructions to make your key, making sure you name it properly and use a passphrase.
#Brute force port 22 scp windows
If you’re using a Windows machine and PuTTY, then look for PuTTYgen. It sits locally and you use it to connect to the remote server. The private key is just that, yours, never share it with anyone. The public key you give out to the public, it is installed on the remote server. There are two keys, a public and private key. Then don’t use them, use something better. Raise your hand if you hate remembering passwords. Adjust your firewall remove the old and add the new port, and try again. Holy shit its not working! Relax, you likely have a firewall setup. Open a new terminal window, put in your IP and change the port from 22 to the new port (1234) and login. $ service sshd restartĭo NOT just logout to test it works because if it doesn’t, you’re locked out of your server. You need to restart SSHD afterwards to come into effect.

So after entering your new port, write it down on paper and save your changes.

Your new setting won’t work unless you uncomment the line. The # comments it out and therefore disables that line (it will use the default). It may be set to something by default to #Port 22 or similar. If you’re a vim user then by all means use it, we know its better. Now I’m a vim fan these days but I’m going to use nano as the default editor around here for people who haven’t grasped vim yet. There are only two catches: 1) don’t forget what the new port is and 2) don’t use another port already taken or popularly used. Everyone knows this, so make it something they don’t know. Security through obscurity – remember it.

If an attacker can’t find it within 10 secs they might just well move onto the nexxt server on their list. This has to be one of the simplest and most effective way to restrict access to SSH. So lets go over a few really simple ways to secure SSH access to your Linux server. You may leave your front door unlocked when you leave, but the majority of servers have irreplaceable data on them and are much more prone to attack than your front door. The passwords at the top of a brute force dictionary attack include: Why not go Great Wall/Firewall of China scale when it’s so easy to do? Multi-layered security! Yea baby! Add that John might like cats so his password is kitty01 which is just a brute force happy moment there. Yeesss, we all know you need to login first, but metaphorically that’s a mighty thin paper wall we’re left with. When I think about it, in all my years of working with servers, I can’t count how many instances of improperly secured SSH access I’ve come across.
