Showing posts with label Linux. Show all posts
Top Ten Penetration Testing Linux Distributions

1. The mamma or best known of Linux pentesting distros. BackTrack has a very cool strapline: “The quieter you become, the more you are able to hear.” That just sounds cool….
BackTrack is based on the ever-popular Ubuntu. The pentesting distro used to be only available within a KDE environment but Gnome become was added as an option with the release of BackTrack v5. For those working in Information Security or intrusion detection, BackTrack is one of the most popular pentesting distros that can run on a live CD or flash drive. The distribution is ideal for wireless cracking, exploiting, web application assessment, learning, or social-engineering a client.
Here is a list of some of the awesome tools available in BackTrack 5r3 (the latest release).
To identify Live Hosts:
dnmap – Distributed NMap
address6 – (which acts as a IPV6 address conversion)
dnmap – Distributed NMap
address6 – (which acts as a IPV6 address conversion)
Information Gathering Analysis (Social Engineering)
Jigsaw – Grabs information about company employees
Uberharvest – Email harvester
sslcaudit – SSL Cert audit
VoIP honey – VoIP Honeypot
urlcrazy – Detects URL typos used in typo squatting, url hijacking, phishing
Jigsaw – Grabs information about company employees
Uberharvest – Email harvester
sslcaudit – SSL Cert audit
VoIP honey – VoIP Honeypot
urlcrazy – Detects URL typos used in typo squatting, url hijacking, phishing
Web Crawlers
Apache_users – Apache username enumerator
Deblaze – Performs enumeration and interrogation against Flash remote end points
Apache_users – Apache username enumerator
Deblaze – Performs enumeration and interrogation against Flash remote end points
Database Analysis
Tnscmd10g – Allows you to inject commands into Oracle
BBQSQL – Blind SQL injection toolkit
* If you are interested in Database Security see our Hacker Halted summary here.
Tnscmd10g – Allows you to inject commands into Oracle
BBQSQL – Blind SQL injection toolkit
* If you are interested in Database Security see our Hacker Halted summary here.
Bluetooth Analysis
Blueranger – Uses link quality to locate Bluetooth devices
Blueranger – Uses link quality to locate Bluetooth devices
Vulnerability Assessment
Lynis – Scans systems & software for security issues
DotDotPwn – Directory Traversal fuzzer
Lynis – Scans systems & software for security issues
DotDotPwn – Directory Traversal fuzzer
Exploitation Tools
Netgear-telnetable – Enables Telnet console on Netgear devices
Terminator – Smart Meter tester
Htexploit – Tool to bypass standard directory protection
Jboss-Autopwn – Deploys JSP shell on target JBoss servers
Websploit – Scans & analyses remote systems for vulnerabilities
Netgear-telnetable – Enables Telnet console on Netgear devices
Terminator – Smart Meter tester
Htexploit – Tool to bypass standard directory protection
Jboss-Autopwn – Deploys JSP shell on target JBoss servers
Websploit – Scans & analyses remote systems for vulnerabilities
Wireless Exploitation Tools
Bluepot – Bluetooth honeypot
Spooftooph – Spoofs or clones Bluetooth devices
Smartphone-Pentest-Framework
Fern-Wifi-cracker – Gui for testing Wireless encryption strength
Wi-fihoney – Creates fake APs using all encryption and monitors with Airodump
Wifite – Automated wireless auditor
Bluepot – Bluetooth honeypot
Spooftooph – Spoofs or clones Bluetooth devices
Smartphone-Pentest-Framework
Fern-Wifi-cracker – Gui for testing Wireless encryption strength
Wi-fihoney – Creates fake APs using all encryption and monitors with Airodump
Wifite – Automated wireless auditor
Password Tools
Creddump
Johnny
Manglefizz
Ophcrack
Phrasendresher
Rainbowcrack
Acccheck
smbexec
Creddump
Johnny
Manglefizz
Ophcrack
Phrasendresher
Rainbowcrack
Acccheck
smbexec
2. Like BackTrack, NodeZero is an Ubuntu based distro used for penetration testing using repositories so every time Ubuntu releases a patch for its bugs, you also are notified for system updates or upgrades. Node Zero used to be famous for its inclusion of THC IPV6 Attack Toolkit which includes tools like alive6, detect-new-ip6, dnsdict6, etc, but I think that these days BackTrack 5r3 also includes these tools.
Whereas BackTrack is touted as being a “run-everywhere” distro, i.e. running it live, NodeZero Linux (which can also be run live) state that the distros real strength comes from a hard install. NodeZero, in their own words, believe that a penetration tester “requires a strong and efficient system [achieved by using] a distribution that is a permanent installation, that benefits from a strong selection of tools, integrated with a stable Linux environment. Sounds cool. Ever tried it? Let us know in the comments below.
3. BackBox is getting more popular by the day. Like BackTrack and NodeZero, BackBox Linux is an Ubuntu-based distribution developed to perform penetration tests and security assessments. The developers state that the intention with BackBox is to create a pentesting distro that is fast and easy to use. BackBox does have a pretty concise looking desktop environment and seems to work very well. Like the other distros BackBox is always updated to the latest stable versions of the most often used and best-known ethical hacking tools through repositories.
BackBox has all the usual suspect for Forensic Analysis, Documentation & Reporting and Reverse Engineering with tools like ettercap, john, metasploit, nmap, Social Engineering Toolkit, sleuthkit, w3af, wireshark, etc.
4. Yes, as the name clearly suggests, this is yet another distro that is based on Ubuntu. Here is a list of Security and Penetration Testing tools – or rather categories available within the Blackbuntu package, (each category has many sub categories) but this gives you a general idea of what comes with this pentesting distro: Information Gathering, Network Mapping, Vulnerability Identification, Penetration, Privilege Escalation, Maintaining Access, Radio Network Analysis, VoIP Analysis, Digital Forensic, Reverse Engineering and a Miscellaneous section. This list is hardly revolutionary but the tools contained within might be different to the other distros.
5. This is a live Linux distro that has been pre-configured with some of the best of open source and free tools that focus on testing and attacking websites. (The difference with Samurai Web Testing Framework is that it focuses on attacking (and therefore being able to defend) websites. The developers outline four steps of a web pen-test. These steps are incorporated within the distro and contain the necessary tools to complete the task.
Step 1: Reconnaissance – Tools include Fierce domain scanner and Maltego.
Step 2: Mapping – Tools include WebScarab and ratproxy.
Step 3: Discovery – Tools include w3af and burp.
Step 4: Exploitation – Tools include BeEF, AJAXShell and much more.
Of interest as well, the Live CD also includes a pre-configured wiki, set up to be a central information store during your pen-test.
The Samurai Web Testing Framework is a live Linux distro that focuses on web application vulnerability research and web pentesting within a “safe environment” – i.e. so you can ethical hack without violating any laws. This is a pentesting distro recommended for penetration testers who wants to combine network and web app techniques.
6. This distro is based on Debian and originated in Germany. The architecture is i486 and runs from the following desktops: GNOME, KDE, LXDE and also Openbox. Knoppix has been around for a long time now – in fact I think it was one of the original live distros.
Knoppix is primarily designed to be used as a Live CD, it can also be installed on a hard disk. The STD in the Knoppix name stands for Security Tools Distribution. The Cryptography section is particularly well-known in Knoppix.
7. Pentoo is a security-focused live CD based on Gentoo. In their own words “Pentoo is Gentoo with the pentoo overlay.” So, if you are into Pentoo then this is the distro for you. Their homepage lists some of their customized tools and kernel, including: a Hardened Kernel with aufs patches, Backported Wifi stack from latest stable kernel release, Module loading support ala slax, XFCE4 wm and Cuda/OPENCL cracking support with development tools.
8. This penetration distribution is built from Debian Squeeze and uses Fluxbox for its’ desktop environment. This pentesting distro is particularly well adjusted for WiFi hacking since it contains many Wireless tools. Here is a quick summary of WEAKERTH4N’s tool categories: Wifi attacks, SQL Hacking, Cisco Exploitation, Password Cracking, Web Hacking, Bluetooth, VoIP Hacking, Social Engineering, Information Gathering, Fuzzing, Android Hacking, Networking and Shells.
9. This linux distro is, I believe, is the first security distribution based directly on Debian, (after WEAKERTH4N?) if I am wrong please comment below! There are 300 security tools to work, called “arsenals”. The arsenals allow for penetration testing, ethical hacking, system and network administration, security testing, vulnerability analysis, cyber forensics investigations, exploiting, cracking and data recovery. The last category, data recovery, doesn’t seem to be prevalent in the other distros.
10. The latest version is DEFT 7 which is based on the new Linux Kernel 3 and the DART (Digital Advanced Response Toolkit). This distro is more orientated towards Computer Forensics and uses LXDE as desktop environment and WINE for executing Windows tools under Linux. The developers, (based in Italy) hope that their distro will be used by the Military, Police, Investigators, IT Auditors and professional penetration testers. DEFT is an abbreviation for “Digital Evidence & Forensic Toolkit”
11. A reader to our blog suggested to add CAINE which we duly have. CAINE Stands for Computer Aided Investigative Environment, and like many information security products and tools – it is Italian GNU/Linux live distribution. CAINE offers a comprehensive forensic environment that is organized to integrate existing software tools that are composed as software modules, all displayed within a friendly graphical interface. CAINE states to have three objectives. These are, to ensure that the distro works in an interoperable environment that supports the digital investigator during the four phases of the digital investigation. Secondly that the distro has a user friendly graphical interface and finally that it provides a semi-automated compilation of the final forensic report. As you would likely expect, CAINE is fully open-source.
12. Bugtraq is another reader submitted pentesting distro. Based on the 26.6.38 kernel, this distro offers a really wide range of penetration and forensic tools. Like most of the others in this list, Bugtraq can hard-install of obviously run as a Live DVD or from a USB drive. Bugtraq claims to have recently configured and updated the kernel for better performance but also importantly so that it can recognize more hardware, including wireless injection patches pentesting. The team at Bugtraq seem solid because they are clearly making an effort to get the kernel to work with more hardware – something which the other distributions don’t always place enough importance.
Some of the special features included with Bugtraq include (as stated) an expanded range of recognition for injection wireless drivers, (i.e. not just the usual Alfa rtl8187), a patched 2.6.38 kernel and solid installation of the usual suspects: Nessus, OpenVAS, Greenbone, Nod32, Hashcat, Avira etc.
Unique to Bugtraq (as claimed on their site) is the ability to, or better said, ease, of deleting tracks and backdoors. Just by having read about Bugtraq I’m really glad that I can add this to the list because it just sounds like a job well done. If you are interested in any of the following pentesting and forensic categories, then do go and check out Buqtraq: Malware, Penetration Shield, Web audit, Brute force attack, Communication and Forensics Analytics, Sniffers, Virtualizations, Anonymity and Tracking, Mapping and Vulnerability detection.
Quick Summary: You can’t go wrong with any Ubuntu based distro. BackTrack does the job well but I guess, of course, it’s all personal – i.e. does the distro do the job for you? Every penetration tester needs a lean towards a particular tool or tool-set. Frankly they are all good, and it would be prudent to use several of these pentesting distros as live versions. For WiFi hacking then WEAKERTH4N is likely your better friend, whilst to stay within the law, use Samurai.
Bugtraq looks really good – the team behind it seems to have taken considerable time to tick all the boxes. Once we test it I’ll update the post.
Here is a list of other distros (which we think are still alive and kicking – please correct us if we are wrong).
Other Distro’s
Damn Vulnerable Linux (reader comment: more of an operating system for attacking purposes)
Hakin9 (an educational and training distro that you can use to play-along with when subscribing to the Hacking Magazine Hak9)
HelixnUbuntu
Network Security Toolkit (NST)
OWASP Labrat
Frenzy
grml
Ophcrack
FCCU
OSWA Assistant
Russix
Chaox-NG
GnackTrack
Katana
Securix-NSM
Auditor
And here is a list of distros that, regrettably, have passed on to Linux Heaven.
KCPentrix
Protech
FIRE
Arudius
INSERT
Local Area Security (LAS)
NavynOS
Operator
PHLAK
PLAC
SENTINIX
Talos
ThePacketMaster
Trinux
WarLinux
Whoppix
WHAX
HeX
Stagos FSE
SNARL
KCPentrix
Protech
FIRE
Arudius
INSERT
Local Area Security (LAS)
NavynOS
Operator
PHLAK
PLAC
SENTINIX
Talos
ThePacketMaster
Trinux
WarLinux
Whoppix
WHAX
HeX
Stagos FSE
SNARL
The Top 10 Linux Server Distributions
You know that Linux is a hot data center server. You know that it saves you money in licensing and maintenance costs. But, what are your options for Linux as a server operating system? Listed here are the top ten Linux server distributions -- some of which you may not be aware. The following chararistics, in no particular order, qualified a distribution for inclusion in this list: Ease-of-use, available commercial support and data center reliability.
Rated: The Top 10 Linux server distributions by ease of use, paid support, and data center reliability.
1. Ubuntu - At the top of almost every Linux-related list, Debian-based Ubuntu is in a class by itself. It surpasses all other distributions from its simple installation to its excellent hardware discovery to its world-class commercial support; Ubuntu leaves the others fumbling in the dusty distance.
2. Red Hat - Red Hat Enterprise Linux (RHEL) started out as the "little Linux company that could" and is now a major force in the quest for data center rackspace. The Linux darling of large companies throughout the world, Red Hat's innovations and non-stop support will have you coming back for more.
3. SUSE - Novell-owned SUSE Linux is stable, easy-to-maintain and offers Novell's 24x7 rapid-response support for those who don't have the time or patience for lengthy troubleshooting calls. And, Novell's consulting teams will have you meeting your SLAs and making your accountants happy to boot.
4. Mandriva - For U.S.-based executive or technical folks, Mandriva might be a bit foreign. This incredibly well-constructed Linux distibution hails from France and claims extreme acceptance in Europe and South America. It is, as its website claims, a worldwide Linux provider. Its name and its construction derive from the Mandrake Linux and Connectiva Linux distributions.
5. Xandros - If you prefer a Linux distribution with a Microsoft connection, Xandros is the one for you. Rumors aside, Xandros and Microsoft collaborate in what's known in technical circles as "cooperatition." This means that they compete cooperatively. To find out more about this unique perspective, check out the Xandros About page.
6. Slackware - While not generally associated with commercial distributions, Slackware maintains relationships with several companies that provide fee-based support. One of the earliest available distributions, Slackware has an extensive and faithful fan base. Its developers regularly release new versions.
7. Debian - If you're confused by Debian's inclusion here, don't be. Debian doesn't have formal commercial support but you can connect with Debian-savvy consultants around the world via theirConsultants page. Debian has spawned more child distributions than any other parent distribution including Ubuntu, Linux Mint and Vyatta.
8. Vyatta - Vyatta is more at home on routers and firewalls than PC-based systems but if you want a commercially-driven distribution for those applications, Vyatta works well for your secure communications needs. Check out the free version of Vyatta Linux.
9. CentOS - It's true that CentOS isn't strictly commercial but since it's based on Red Hat Enterprise Linux, you can leverage commercial support for it. CentOS has its own repositories and community support and is not the same as Fedora Linux.
10. Unbreakable Linux - Oracle's Unbreakable Linux is Red Hat Enterprise Linux with some Oracle logos and art. Oracle competes directly with Red Hat with their distribution and quite effectively, since purchased support through Oracle is half the price of Red Hat's equivalent model.
Top 10 Linux Virtualization Software
Top 10 Linux Virtualization Software
Virtualization is the latest buzz word.
You may wonder computers are getting cheaper every day, why should I
care and why should I use virtualization? Virtualization is a broad term
that refers to the abstraction of computer resources such as:
- Platform Virtualization
- Resource Virtualization
- Storage Virtualization
- Network Virtualization
- Desktop Virtualization
Why should I use virtualization?
- Consolidation - It means combining multiple software workloads on one computer system. You can run various virtual machines in order to save money and power (electricity).
- Testing - You can test various configuration. You can create less resource hungry and low priority virtual machines (VM). Often, I test new Linux distro inside VM. This is also good for students who wish to learn new operating systems and programming languages / database without making any changes to working environment. At my work place I give developers virtual test machines for testing and debugging their software.
- Security and Isolation - If mail server or any other app gets cracked, only that VM will be under control of the attacker. Also, isolation means misbehaving apps (e.g. memory leaks) cannot bring down whole server.
Open Source Linux Virtualization Software
- OpenVZ is an operating system-level virtualization technology based on the Linux kernel and operating system.
- Xen is a virtual machine monitor for 32 / 64 bit Intel / AMD (IA 64) and PowerPC 970 architectures. It allows several guest operating systems to be executed on the same computer hardware concurrently. XEN is included with most popular Linux distributions such as Debian, Ubuntu, CentOS, RHEL, Fedora and many others.
- Kernel-based Virtual Machine (KVM) is a Linux kernel virtualization infrastructure. KVM currently supports native virtualization using Intel VT or AMD-V. A wide variety of guest operating systems work with KVM, including many flavours of Linux, BSD, Solaris, and Windows etc. KVM is included with Debian, OpenSuse and other Linux distributions.
- Linux-VServer is a virtual private server implementation done by adding operating system-level virtualization capabilities to the Linux kernel.
- VirtualBox is an x86 virtualization software package, developed by Sun Microsystems as part of its Sun xVM virtualization platform. Supported host operating systems include Linux, Mac OS X, OS/2 Warp, Windows XP or Vista, and Solaris, while supported guest operating systems include FreeBSD, Linux, OpenBSD, OS/2 Warp, Windows and Solaris.
- Bochs is a portable x86 and AMD64 PC emulator and debugger. Many guest operating systems can be run using the emulator including DOS, several versions of Microsoft Windows, BSDs, Linux, AmigaOS, Rhapsody and MorphOS. Bochs can run on many host operating systems, like Windows, Windows Mobile, Linux and Mac OS X.
- User Mode Linux (UML) was the first virtualization technology for Linux. User-mode Linux is generally considered to have lower performance than some competing technologies, such as Xen and OpenVZ. Future work in adding support for x86 virtualization to UML may reduce this disadvantage.
Proprietary Linux Virtualization Software
- VMware ESX Server and VMWare Server - VMware Server (also known as GSX Server) is an entry-level server virtualization software. VMware ESX Server is an enterprise-level virtualization product providing data center virtualization. It can run various guest operating systems such as FreeBSD, Linux, Solaris, Windows and others.
- Commercial implementations of XEN available with various features and support.
- Citrix XenServer : XenServer is based on the open source Xen hypervisor, an exceptionally lean technology that delivers low overhead and near-native performance.
- Oracle VM : Oracle VM is based on the open-source Xen hypervisor technology, supports both Windows and Linux guests and includes an integrated Web browser based management console. Oracle VM features fully tested and certified Oracle Applications stack in an enterprise virtualization environment.
- Sun xVM : The xVM Server uses a bare-metal hypervisor based on the open source Xen under a Solaris environment on x86-64 systems. On SPARC systems, xVM is based on Sun's Logical Domains and Solaris. Sun plans to support Microsoft Windows (on x86-64 systems only), Linux, and Solaris as guest operating systems.
- Parallels Virtuozzo Containers - It is an operating system-level virtualization product designed for large-scale homegenous server environments and data centers. Parallels Virtuozzo Containers is compatible with x86, x86-64 and IA-64 platforms. You can run various Linux distributions inside Parallels Virtuozzo Containers.
Linux Text Editors: Vi and Nano
When working with text editors, you pretty much choose between Vi or Nano. Vi is old school with a blank layout and no visible controls, which can make it difficult to work with for beginners. However, it is very powerful and once you learn the keystrokes it can be used very quickly to edit config files and used for scripts, etc. Nano has a pseudo-graphical layout that makes it a little easier to jump right into. Both are viable options. Vi is a standard whereas Nano has to be available depending on the Linux OS you use. We will look at both and go over the important commands for both.
Let’s look at the difference.
To start Vi, you just have to type “vi” and then the name of the file, or type any name and the file will be created anew.
Example: “vi newfile”
Vi will automatically open in Command mode. On the bottom you will see some info such as the name of the document & info on whether it is a new file or an existing one. Let’s look at an existing file.
Quitting & Saving
There are three modes to Vi: Command mode, Text mode & Ex Mode. If you tried to start typing in command mode you wouldn’t be able to. You need to hit the “I” in order to get into text mode. You can then get back to command mode by the ESC key. Typng “:” will put you into Ex mode.In order to quit Vi, you have to hit the Esc key and then enter in “:” along with “q” for quit.
If you get stuck in a file that is Read-Only and you can’t quit, you can enter “:q!” with the exlamation point to force quit. If you want to save changes, hit the Esc key along with “:w”.
- :w – Saves
- :wq or
– Save & Quit
- :q – Quit
- :q! – Force quit, no save
Navigation in Vi
Navigating in Vi is a little more tricky, and this is what gives new users headaches. You just want to keep your fingers on your keyboard as if you are constantly typing (i.e. h, j, k, l). These keys are the substitute for the arrow keys.- j – down
- k – up
- l – right
- h – left
- gg – Takes you to the beginning of the file
- G(shift + g) – Will take you to the end of the file
- xxG – Brings you to a specific line in the file(xx is the line number)
- ( – Move up to the beginning of the sentence
- ) – Move to the end of the sentence
Insterting Text
- i – Insert before cursor position
- a – append after cursor position
- r – Replace letter
- o – Open line below cursor position automatically goes into insert mode
- O – Open line above cursor in insert mode
Deleting Text
- x – Deletes the character under cursor position
- X – Deletes the character before cursor
- dw – Deletes the word after cursor
- db – Deletes word before the cursor
- u – Will undo changes
Copy(yank) & Paste
- yw – Yanks the word after the cursor
- yb – Yanks the word before the cursor
- yy – Yanks the entire line
- p – Will paste
- P – Will paste before the cursor position
Search
- / – Is used to search(:/searchword)
Setting up Vi with numbers
It might benefit some to view the documents with numbers. What you want to do is go into Exec mode(ESC) and then type in “: set number”. Let’s look at the group file:Nano
Let’s take a look at workinig with Nano. You start out the same way as you do with Vi by just typing “nano newfile”.The look is a lot different.
How to Set Up Safe FTP in Linux
What is VSFTPD?
The vsftp daemon runs in the background and allows you or users you designate, to copy files to and from your Linux boxes, using username and password as login credentials. This ability is open to individuals or groups you may want to establish.VSFTPD features include:
- Virtual IP configurations
- Virtual users
- Standalone or inetd operation
- Powerful per-user configurability
- Bandwidth throttling
- Per-source-IP configurability
- Per-source-IP limits
- IPv6
- Encryption support through SSL integration
How To Install VSFTP
The daemon is included in most versions of Linux. If you are using a Debian based distribution like Mint or Ubuntu, open a terminal window and type: sudo apt-get install vsftpdIf you are using a Red Hat based disto, open a terminal window and type: sudo yum install vsftp
How To Configure VSFTP
To configure vsftp, open the vsftpd.conf file in the /etc directory. For instance, if you were using gedit as your text editor, you would type: sudo gedit /etc/vsftpd.confFirst, for a secure setup, you’ll want to disable anonymous access to your ftp server. Change this line: anonymous_enable=YES to anonymous_enable=NO
With anonymous access disabled, you’ll want to allow local users to log in, by uncommenting the following line: #local_enable=YES to local_enable=YES (simply remove the # sign).
Allow write access by uncommenting this line: #write_enable=YES to write_enable=YES
Save and close the file.
Setup an FTP user account:
sudo mkdir -p /home/ftp/ftpuser
sudo useradd ftpuser -d /home/ftp/ftpuser -s /bin/false
sudo passwd ftpuser
sudo useradd ftpuser -d /home/ftp/ftpuser -s /bin/false
sudo passwd ftpuser
Debian: sudo etc/init.d/vsftpd restart
Red Hat: sudo service vsftpd restart
net stat -a | grep ftp
ftp ip address or host name: ftp 100.00.00.00
Other VSFTP Configuration Options
There are many other options you can add to this file:- Limiting the maximum number of client connections (max_clients)
- Limiting the number of connections by source IP address (max_per_ip)
- Setting the maximum rate of data transfer per anonymous login (anon_max_rate)
- Setting the maximum rate of data transfer per non-anonymous login (local_max_rate)
VSFTP Considerations and Resources
Potential issues are often as simple as username and password entry errors. But because firewalls are designed to limit access to certain ports, this is a good area to investigate if you experience issues with your installationLinux File Permissions
What we’ll cover in this article is how to identify permissions for files & directories and how to change them, as well as changing ownerships, groups, etc. Depending on what you want to do, you’ll want to make sure you have the appropriate permissions (obviously), so let’s find out how to change them.
Let’s start by making a file we can use.
I issued the “touch” command to make a file creatively named testfile.
Touch will just create an empty file but has all the same attributes as an actual file. You can see this by using “ls –l.” Commands :
- touch test file
- mkdir workfolder
The permisions are broken into 4 sections
chmod – adds and removes permissions
If you wanted to add or remove permissions to the user, use the command “chmod” with a “+” or “–“, along with the r (read), w (write), x (execute) attribute followed by the name of the directory or file.
chmod +rwx “name of the file”
chmod –rwx “name of the directory”
chmod –wx testfile – this would take out write and executable permissions
You’ll notice that this only changes the permissions for the owner of the file, in this case roman
Changing Permissions for the Group Owners & Others
The command is similar to what we did before, but this time you add a “g” for group or “o” for users
chmod g+w testfile
chmod g-wx testfile
chmod o-rwx workfolder
chmod ugo+rwx workfolder – will give read, write, execute to everyone
chmod a=r workfolder – will give only read perission for everyone
chgrp – changing groups of files & directories
Another useful option is to change file permission to the group owning the file. Perhaps you create the files, but people on the db2 team can write/execute as well. We use chgrp for this purpose.
chgrp sales testfile
chgrp sales workfolder
This give sales control of the file & then I can take away permissions for everyone else
Note: The group must exit before you try to assign groups to files and directories
chown – changing ownership
Another helpful command is changing ownerships of files and directories. The command is “chwon” along with “name of new owner” & “name of file.”
chown tom testfile
chown tom workfolder
We can also combine the group and ownership command by
The above command gives tom the ownership of the directory tsfiles, and all files and subfolders. The -R stands for recursive which is why all sub folders and files belong to tom as well
As opposed to: chown tom workfolder
This command will give ownership to tom but all sub files and directories still belong to the original owner. The -R will transfer ownership of all sub directories to the new owner
As you can see, you have several options when it comes to permissions. You have the capability to dictate who can do what & the flexibility to limit usability among users. It may be easier to just give all permission to everyone but this may end up biting you in the end, so choose wisely
Permission in numeric mode
The above way of changing permissions will work fine but you may also need to know how to change permissions in numeric mode. chmod is used in much the same way, but instead of r, w, or x you will use numbers instead
What are the numbers?
0 = No Permission
1 = Execute
2 = Write
4 = Read
You basically add up the numbers depending on the level of permission you want to give
0 = —
1 = –x
2 = -w-
3 = -wx
4 = r—
5 = r-x
6 = rw-
7 = rwx
Either variation of changing permissions will work, just remember how to use the numeric values























