Author Archives: Ahmed Tawfik

Unknown's avatar

About Ahmed Tawfik

Cybersecurity Professional, Systems Engineer, OSS & Linux Geek

A nice way to show progress when copying files

The cp command is not really good with that, there are some ways to do it, but unnecessarily complicated. The best option is to use rsync instead: rsync –progress source destination It will show you something like this: 3885367296 0% … Continue reading

Posted in Linux, Uncategorized | Tagged , , | Leave a comment

Force PKI and Password authentication simultaneously on Ubuntu

I use AD authentication in my environment (for password-based authentication) Current Scenario A valid AD user logs in to the Ubuntu Linux server via SSH That user adds his public key to ~/.ssh/authorized_keys for passwordless login I disable/lock/delete the AD … Continue reading

Posted in Linux, Ubuntu, Uncategorized | Tagged , , , , | Leave a comment

Force expiry of a Linux Account

Just locking the linux account isn’t enough, since the user can use other methods to login, such as PKI. The best solution would be to force expire the account: sudo chage -M 0 username

Posted in Linux | Tagged , , , | Leave a comment

Search for an AD user using PBIS and userid

Let’s say I have a user id in Linux 234234234 and I need to check which user that represents in Active Directory. All I need is: pbis enum-users | grep -B 5 -A 5 234234234 where: enum-users: returns all users … Continue reading

Posted in Linux, Uncategorized | Tagged , , | Leave a comment

Create random passwords from command line in Ubuntu

There are two handy tools that generate random passwords from the command line in Ubuntu (and other distros of course). It’s more secure to use passwords from these tools instead of online password generators. First of which is apg and … Continue reading

Posted in Ubuntu, Uncategorized | Tagged , , , , | Leave a comment