Linux Quick Reference Guide (6Th Ed.)

Total Page:16

File Type:pdf, Size:1020Kb

Linux Quick Reference Guide (6Th Ed.) Linux Quick Reference Guide 6th edition August 2018 Foreword This guide stems from the notes I have been taking both while working as a Linux sysadmin and while preparing the certification exams LPIC-1 (Linux Professional Institute Certification level 1), LPIC-2, RHCSA (Red Hat Certified System Administrator), and RHCE (Red Hat Certified Engineer). It contains a good amount of topics for these certification exams, with some subjects handled in more details than others, plus other useful information about standards and tools for Linux system administration. Unless otherwise specified, shell commands and operations refer to Bash. This is an independent publication and is not affiliated with, authorized by, sponsored by, or otherwise approved by LPI or Red Hat. You can freely use and share this whole guide or the single pages, both in electronic or in printed form, provided that you distribute them unmodified and not for profit. Happy Linux hacking, Daniele Raffo Version history 1st edition May 2013 2nd edition September 2014 3rd edition July 2015 4th edition June 2016 5th edition September 2017 6th edition August 2018 Bibliography and suggested readings ● Evi Nemeth et al., UNIX and Linux System Administration Handbook, O'Reilly ● Rebecca Thomas et al., Advanced Programmer's Guide to Unix System V, McGraw-Hill ● Mendel Cooper, Advanced Bash-Scripting Guide, http://tldp.org/LDP/abs/html ● Adam Haeder et al., LPI Linux Certification in a Nutshell, O'Reilly ● Heinrich W. Klöpping et al., The LPIC-2 Exam Prep, http://lpic2.unix.nl ● Michael Jang, RHCSA/RHCE Red Hat Linux Certification Study Guide, McGraw-Hill ● Asghar Ghori, RHCSA & RHCE RHEL 7: Training and Exam Preparation Guide, Lightning Source Inc. ● Colin Barschel, Unix Toolbox, http://cb.vu/unixtoolbox.xhtml ● Ellen Siever et al., Linux in a Nutshell, O'Reilly, http://archive.oreilly.com/linux/cmd ● Christoph Braun, Unix System Security Essentials, Addison-Wesley ● Bruce Barnett, The Grymoire, http://www.grymoire.com/Unix ● Brendan Gregg, Linux performance, http://www.brendangregg.com/linuxperf.html ● RHEL manuals, https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux ● A-Z index of Bash command line, http://ss64.com/bash ● GNU software manuals, http://www.gnu.org/manual ● Shell command line snippets, http://www.commandlinefu.com ● Bash command line snippets, http://www.bashoneliners.com ● RAM management in Linux, http://www.linuxatemyram.com ● Regular expressions tester, http://www.regextester.com ● Bash pitfalls, http://mywiki.wooledge.org/BashPitfalls ● Linux man pages, https://www.kernel.org/doc/man-pages ● CentOS 7 man pages, https://www.unix.com/man-page-centos-repository.php Index LVM................................................1 SQL SELECT..................................57 iptables rules...............................113 LVM commands................................2 SQL JOIN......................................58 iptables NAT routing......................114 System boot....................................3 MySQL..........................................59 firewalld......................................115 SysV startup sequence.....................4 MySQL tools..................................60 firewalld rules..............................116 Login..............................................5 MySQL syntax................................61 SSH............................................117 Runlevels........................................6 MySQL status................................62 SSH operations............................118 SysV vs Systemd.............................7 MySQL recipes...............................63 SSH configuration.........................119 /etc/inittab......................................8 MySQL operations..........................64 OpenSSL.....................................120 Filesystem Hierarchy Standard...........9 PostgreSQL...................................65 CA.pl..........................................121 Partitions......................................10 X..................................................66 GnuPG........................................122 mount..........................................11 X tools..........................................67 OpenVPN.....................................123 Filesystem types............................12 X keysim codes..............................68 Key bindings - terminal.................124 Swap............................................13 /etc/passwd...................................69 Key bindings - X...........................125 /etc/fstab......................................14 User management..........................70 udev...........................................126 Filesystem operations.....................15 UID and GID..................................71 Kernel.........................................127 Filesystem maintenance..................16 su and sudo...................................72 Kernel management......................128 XFS, ReiserFS, CD-ROM fs...............17 Terminals......................................73 Kernel compile and patching..........129 AutoFS..........................................18 Messaging.....................................74 Kernel modules............................130 RAID............................................19 cron.............................................75 /proc..........................................131 Bootloader....................................20 at.................................................76 System recovery..........................132 GRUB 2 configuration......................21 Utilities.........................................77 DNS............................................133 GRUB 2 usage................................22 Localization...................................78 DNS configuration.........................134 GRUB Legacy.................................23 System time..................................79 DNS zone file...............................135 Low-level package managers...........24 syslog...........................................80 Apache........................................136 High-level package managers..........25 E-mail...........................................81 Apache configuration....................137 Package management tools.............26 SMTP............................................82 Apache virtual hosts.....................138 Backup.........................................27 Sendmail.......................................83 Apache directory protection...........139 Archive formats..............................28 Exim.............................................84 Apache SSL/TLS...........................140 Documentation..............................29 Postfix..........................................85 Apache proxy...............................141 Shell basics...................................30 Postfix configuration.......................86 Tomcat........................................142 Text filters.....................................31 Procmail........................................87 Samba server..............................143 Advanced text filters.......................32 Courier POP configuration................88 Samba client................................144 Regular expressions........................33 Courier IMAP configuration..............89 Samba global configuration............145 File management...........................34 Dovecot........................................90 Samba share configuration............146 Directory management...................35 Dovecot mailbox configuration.........91 Samba access configuration...........147 I/O streams...................................36 Dovecot POP and IMAP configuration.92 Samba setup...............................148 read and echo................................37 Dovecot authentication...................93 NFS............................................149 Processes......................................38 FTP..............................................94 /etc/exports.................................150 Signals.........................................39 vsftpd...........................................95 NFS setup....................................151 Resource monitoring.......................40 CUPS............................................96 iSCSI..........................................152 vmstat and free.............................41 IP addressing.................................97 iSCSI setup.................................153 File permissions.............................42 Subnetting....................................98 DHCP..........................................154 File attributes................................43 Network services............................99 PAM............................................155 ACLs.............................................44 Network configuration commands...100 LDAP..........................................156 Links............................................45 Wireless networking......................101 OpenLDAP...................................157 Find system files............................46 Network tools...............................102 SELinux.......................................158 Shell variables...............................47 Network monitoring......................103 AVC............................................159 Shell operations.............................48 Packet sniffing..............................104 KVM............................................160 Shell scripting................................49
Recommended publications
  • Redbooks Paper Linux on IBM Zseries and S/390
    Redbooks Paper Simon Williams Linux on IBM zSeries and S/390: TCP/IP Broadcast on z/VM Guest LAN Preface This Redpaper provides information to help readers plan for and exploit Internet Protocol (IP) broadcast support that was made available to z/VM Guest LAN environments with the introduction of the z/VM 4.3 Operating System. Using IP broadcast support, Linux guests can for the first time use DHCP to lease an IP address dynamically from a DHCP server in a z/VM Guest LAN environment. This frees the administrator from the previous method of having to hardcode an IP address for every Linux guest in the system. This new feature enables easier deployment and administration of large-scale Linux environments. Objectives The objectives of this paper are to: Review the z/VM Guest LAN environment Explain IP broadcast Introduce the Dynamic Host Configuration Protocol (DHCP) Explain how DHCP works in a z/VM Guest LAN Describe how to implement DHCP in a z/VM Guest LAN environment © Copyright IBM Corp. 2003. All rights reserved. ibm.com/redbooks 1 z/VM Guest LAN Attention: While broadcast support for z/VM Guest LANs was announced with the base z/VM 4.3 operating system, the user must apply the PTF for APAR VM63172. This APAR resolves several issues which have been found to inhibit the use of DHCP by Linux-based applications running over the z/VM Guest LAN (in simulated QDIO mode). Introduction Prior to z/VM 4.2, virtual connectivity options for connecting one or more virtual machines (VM guests) was limited to virtual channel-to-channel adapters (CTCA) and the Inter-User Communications Vehicle (IUCV) facility.
    [Show full text]
  • Firewalld ↔ Iptables (Continued)
    firewalld ↔ iptables (continued) Or, better said as, Understanding Linux Firewall Changes and Tools A firewall evolution and system management process Presented to SLUUG By David Forrest August 9, 2017 Bio I am David Forrest, a businessman in the housing and construction materials industry. Always keen to use the open and supportable solution even if it means getting my hands dirty. I was there, I did that, I have the t-shirt. And, I'm retired so now I can work on the “bleeding edge” - so on to the testing kernel! Why tonight? Why should we switch to firewalld? I felt a continuation was in order to address the problems that are caused by the virtual world and the interaction of processes within today's machines. Our various distributions seem to be jumping to the systemd init setup as it appears to offer better administration control to Linux Kernel machines. Firewalld just one of many efforts to see the future. In recent years, operating system virtualization has taken the industry by storm. But I'm still on CentOS7 and it uses firewalld as its default firewall along with systemd https://wiki.debian.org/Debate/initsystem/systemd firewalld It's a daemon and a command line interface to all the backends! One can start it as a service with a default setup and change it dynamically with a command line or with the daemon using D-Bus or NetworkManager. And with the new nftables release, we'll be able to combine several rules in one rich rule. The firewalld Architecture Firewalld and nft Systems have also moved toward Software Defined Networking (SDN) and system density has increased.
    [Show full text]
  • Hardening Linux
    eBooks-IT.org 4444_FM_final.qxd 1/5/05 12:39 AM Page i eBooks-IT.org Hardening Linux JAMES TURNBULL 4444_FM_final.qxd 1/5/05 12:39 AM Page ii eBooks-IT.org Hardening Linux Copyright © 2005 by James Turnbull All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN (pbk): 1-59059-444-4 Printed and bound in the United States of America 987654321 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Lead Editor: Jim Sumser Technical Reviewer: Judith Myerson Editorial Board: Steve Anglin, Dan Appleman, Ewan Buckingham, Gary Cornell, Tony Davis, Jason Gilmore, Chris Mills, Dominic Shakeshaft, Jim Sumser Project Manager: Kylie Johnston Copy Edit Manager: Nicole LeClerc Copy Editor: Kim Wimpsett Production Manager: Kari Brooks-Copony Production Editor: Kelly Winquist Compositor: Linda Weidemann Proofreader: Lori Bring Indexer: Kevin Broccoli Artist: Kinetic Publishing Services, LLC Cover Designer: Kurt Krames Manufacturing Manager: Tom Debolski Distributed to the book trade in the United States by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013, and outside the United States by Springer-Verlag GmbH & Co. KG, Tiergartenstr. 17, 69112 Heidelberg, Germany. In the United States: phone 1-800-SPRINGER, fax 201-348-4505, e-mail [email protected], or visit http://www.springer-ny.com.
    [Show full text]
  • Demystifying Internet of Things Security Successful Iot Device/Edge and Platform Security Deployment — Sunil Cheruvu Anil Kumar Ned Smith David M
    Demystifying Internet of Things Security Successful IoT Device/Edge and Platform Security Deployment — Sunil Cheruvu Anil Kumar Ned Smith David M. Wheeler Demystifying Internet of Things Security Successful IoT Device/Edge and Platform Security Deployment Sunil Cheruvu Anil Kumar Ned Smith David M. Wheeler Demystifying Internet of Things Security: Successful IoT Device/Edge and Platform Security Deployment Sunil Cheruvu Anil Kumar Chandler, AZ, USA Chandler, AZ, USA Ned Smith David M. Wheeler Beaverton, OR, USA Gilbert, AZ, USA ISBN-13 (pbk): 978-1-4842-2895-1 ISBN-13 (electronic): 978-1-4842-2896-8 https://doi.org/10.1007/978-1-4842-2896-8 Copyright © 2020 by The Editor(s) (if applicable) and The Author(s) This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. Open Access This book is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made. The images or other third party material in this book are included in the book’s Creative Commons license, unless indicated otherwise in a credit line to the material.
    [Show full text]
  • Migrazione Da Iptables a Nftables
    UNIVERSITÀ DEGLI STUDI DI GENOVA MASTER IN CYBER SECURITY AND DATA PROTECTION Migrazione da iptables a nftables Autore: Tutor accademico: dott. Marco DE BENEDETTO prof. Mario MARCHESE Tutor aziendale: dott. Carlo BERUTTI BERGOTTO Project Work finale del Master di secondo livello in Cyber Security and Data Protection III edizione (a.a. 2016/17) 10 marzo 2019 iii Indice 1 Introduzione 1 2 Packet Filtering in Linux 3 2.1 Storia ...................................... 3 2.2 Netfilter .................................... 4 2.3 Nftables successore di iptables? ....................... 6 3 Firewall Linux nella rete Galliera 7 3.1 Cenni storici .................................. 7 3.2 Architettura attuale .............................. 7 3.3 Problemi dell’infrastruttura ......................... 9 3.4 Opportunità di migrazione a nftables ................... 9 4 Nftables 11 4.1 Caratteristiche di nftables .......................... 11 4.2 Packet flow in nftables ............................ 12 4.3 Strumenti di debug e tracing ......................... 15 5 Migrazione del Captive Portal 17 5.1 Captive Portal con iptables .......................... 17 5.2 Captive Portal nella versione nftables ................... 19 5.3 Autorizzazioni temporizzate ........................ 20 5.4 Aggiornamento del timeout ......................... 21 5.5 Limitazione della banda ........................... 22 6 Strumenti di sviluppo e test 25 6.1 Virtualizzazione ................................ 25 6.2 Debug ..................................... 26 7 Considerazioni finali
    [Show full text]
  • Porting Linux to the Powerpc MPC7451
    Freescale Semiconductor Document Number: AN2145 Application Note Rev. 2, 10/2006 Porting Linux to the PowerPC™ MPC7451 by Maurie Ommerman CPD Application Freescale Semiconductor, Inc. Austin, TX This document describes porting Montavista’s Hardhat™ Contents Linux from a sandpoint 2 platform with the MPC8240PMC, 1 Terminology . .1 2 Development Environment . .2 the MPC755PMC, or the MPC7400PMC to the 3 Installing Montavista CDK 1.2 . .3 MPC7450/MPC7451. It explains how to set up the 4 CDK RPMs . 3 development environment and how to compile, load, and run 5 Mandrake CD RPMs . 4 6 Building the Kernel . .5 the resultant Hardhat Linux on the sandpoint MPC7450 7 Dependencies . .10 platform. (If building Linux for sandpoint 3, refer to 8 Source Code Changes . .10 Appendix A, “Sandpoint 3 Platform.”) 9 Executable Images . .13 10 Installing an Updated Kernel Source . .13 The MPC7451 has the same functionality as the MPC7450, 11 Untar the Source . .14 and any differences in data regarding bus timing, signal 12 Additional Required Files . 14 behavior, and AC, DC, and thermal characteristics are 13 Sandpoint Setup . .15 14 Hard Drive for Linux OS . .15 detailed in the hardware specifications. Note that because the 15 fdisk Commands . .16 MPC7450 and MPC7451 have the same functionality, they 16 Partition Configuration . .16 are used interchangeably throughout the documentation and 17 Making a ramdisk Linux OS . .17 18 make menuconfig . .17 code. 19 genromfs . .17 20 Downloading the Executable . .19 21 Terminal Emulators . .20 1 Terminology 22 Minicom . .20 23 DINK32 Booting the MPC7450 Linux: Example . .22 The following terms are used in this document.
    [Show full text]
  • Linux IPCHAINS-HOWTO
    Linux IPCHAINS−HOWTO Linux IPCHAINS−HOWTO Table of Contents Linux IPCHAINS−HOWTO..............................................................................................................................1 Rusty Russell...........................................................................................................................................1 1.Introduction...........................................................................................................................................1 2.Packet Filtering Basics..........................................................................................................................1 3.I'm confused! Routing, masquerading, portforwarding, ipautofw.......................................................1 4.IP Firewalling Chains...........................................................................................................................1 5.Miscellaneous.......................................................................................................................................2 6.Common Problems...............................................................................................................................2 7.A Serious Example...............................................................................................................................2 8.Appendix: Differences between ipchains and ipfwadm.......................................................................2 9.Appendix: Using the ipfwadm−wrapper script.....................................................................................3
    [Show full text]
  • Linux® Firewalls: Enhancing Security with Nftables and Beyond
    Linux® Firewalls Fourth Edition This page intentionally left blank Linux® Firewalls Enhancing Security with nftables and Beyond Fourth Edition Steve Suehring Upper Saddle River, NJ • Boston • Indianapolis • San Francisco New York • Toronto • Montreal • London • Munich • Paris • Madrid Capetown • Sydney • Tokyo • Singapore • Mexico City Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. The author and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. For information about buying this title in bulk quantities, or for special sales opportunities (which may include electronic versions; custom cover designs; and content particular to your business, training goals, marketing focus, or branding interests), please contact our corporate sales department at [email protected] or (800) 382-3419. For government sales inquiries, please contact [email protected]. For questions about sales outside the U.S., please contact [email protected]. Visit us on the Web: informit.com/aw Library of Congress Cataloging-in-Publication Data Suehring, Steve. Linux firewalls : enhancing security with nftables and beyond.—Fourth edition / Steve Suehring. pages cm Earlier ed. authored by Robert L. Ziegler. Includes bibliographical references and index. ISBN 978-0-13-400002-2 (pbk.
    [Show full text]
  • Security Guide
    Fedora 11 Security Guide A Guide to Securing Fedora Linux Johnray Fuller John Ha David O'Brien Scott Radvan Eric Christensen Security Guide Fedora 11 Security Guide A Guide to Securing Fedora Linux Edition 1.0 Author Johnray Fuller [email protected] Author John Ha [email protected] Author David O'Brien [email protected] Author Scott Radvan [email protected] Author Eric Christensen [email protected] Copyright © 2008 Red Hat, Inc. The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. The original authors of this document, and Red Hat, designate the Fedora Project as the "Attribution Party" for purposes of CC-BY-SA. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version. Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law. Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, MetaMatrix, Fedora, the Infinity Logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries. For guidelines on the permitted uses of the Fedora trademarks, refer to https://fedoraproject.org/wiki/ Legal:Trademark_guidelines. Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
    [Show full text]
  • Building a Linux Firewall Matthew D. Rossmiller November 11, 2003 1
    ¢¡¤£¦¥¨§©£¦ © £¦ ¡£¨ ¥¦¥ "!#!%$'&)(+*,-/.1020#35476867&:9 ;<.>=?&:3@A&:9CB1B?DFE?G1G1H I JLKMONP/QCRTSUMV¨PWK XZY[]\_^)`bac`d^fe>gih#YkjmlnY^pophq`rlsdtps_urhqYv[)opYjml>jmswud`x[yurji^flzjms{sdh#|¨}c`djml>~Cl:udh#`dlch¨uW|q^)l>l>h2|¦urh#ozl>hqu_^f`dps#C >h<~f^f[)gFjms ud^Y[]pjiYjmqh<sdh#|q}>`djiu_tjiudc^)}pubgm^fsdjml>~Tud>h<e"h#l>h¨>uxsb^)ud>h/lch¨u_U^)`r?TXY[y\_^f`Uh#[]a?^)lzsdtps_urhqYv[)opYjml>jmswud`x[yur^)`xs c[%fhjilCud>h{f}ch#swu^)`swh2|¨}>`rjiu_t©jsur>h"`dh#U[)gig8XUhqgmgur}>l>h2oTc`rhq[]gmgjsur>hc`xswugmjil>hW^]Aophqhqlcsdh^f`l>hqu_^f`dfh#o Y[)|x>jml>h2sq >js`dh#a"^f`wu|q^y)hq`xsc`rhq[]gmg'|q^)lp"~)}>`x[yurji^fl^)a>udjm^)lcs^f`ud>h/jil}p^)a?hq`x[yudjml>~sdtswudh#YT{u{[)srsw}>Yh2s[¤~fhql>h#`r[)g []Yjmgij[]`rjiu_tbjiudc`rhq[]gmgc[]l"olfurhq`rl>h¨uU F`r^]ud^p|q^)gL¡_ U¢'l>hqu_^f`djml>~|¨^)l"|¨hqa>urs#OXo>ophql"op}>YX£a>`r^yjmoph2sF[]l^yfhq`r:jmhq ^]"`dh#U[)gigO|¨^)l"|¨hqa>urs[)lcoTurhq`rY{jml>^fgi^f~)t©^)`ur>h{}>l>jml>j¤urjm[]udh2o¥Xo>oph#lcop}>Y§¦ |¨^flfux[]jmlcs[<e>`rjihqFjil:ud`r^pop}c|¨udjm^)lur^/udch l:udh#`dl>hqu F`r^]ud^p|q^)g¡_ U¢Ul>h¨u_U^)`rjil>~|¨^flc|¨h#apurs`rhqgmhqy[)lfuur^[o>jmsr|¨}csrsdji^fl<^]Oc`rhq[]gmg¥swtpswudhqYs# >h`rhqY[]jmlcoph#`^]Oud>jsac[)a"h#`js^)`r~f[)l>ji#h#o<jil:ud^^f}>`sdh#|¨udjm^)lcs#lswh2|¦udjm^)l¤u_U^hjmgig¨gi^^f<[yu^f}>`sdhqac[)`r[]udh c`rhq[]gmg"jmYa>gmhqYhql:ur[]udjm^)lcs^f`jil}p¥©:udc`dh#h^fa"h#lpªsd^)}c`r|qh[]l"o/^)lch|q^)YYhq`x|¨j[]g8O >h#lL«pjml©sdh#|¦urji^flcsAud>`rhqh[]lco/^)}>` Uhjmgighqp[)Yjil>hU^)lch^)cudchA^f}>`'jiYa>gmhqYhql:ux[yudjm^)l"sq«]lch¨uw"g¤urhq`¨¬%jmapur[)e>gih2sq«yjmlWo>h¨ur[)jig8­h#|¨udjm^)l®|¨^fl:ur[]jmlcs'sd^)YhA~fhql>h#`r[)g
    [Show full text]
  • Nsrc Default Presentation
    Simple iptables firewall Network Startup Resource Center www.nsrc.org These materials are licensed under the Creative Commons Attribution-NonCommercial 4.0 International license (http://creativecommons.org/licenses/by-nc/4.0/) Linux has a built-in firewall ● A good way to limit access to your host ● Has been through many versions! – ipfwadm – ipchains – iptables – nftables ● Today most distributions use iptables iptables: viewing rules ● iptables -L -n -v – Show the FILTER rules – (L)ist rules, (n)o reverse DNS, (v)erbose – Separate rules INPUT (packets to the host), OUTPUT (packets from the host), and FORWARD (packets routed via the host) ● iptables -L -n -v -t nat – Show the NAT rules iptables: writing rules ● It's very difficult to do it properly – lots of edge cases – certain ICMP packets are essential for correct network operation (e.g. path MTU discovery) ● Instead, use a simpler front-end ● For Ubuntu/Debian: look at ufw and ferm ● For CentOS/RedHAT: system-config-firewall-tui or firewall-cmd ufw in operation # install apt-get install ufw # show rules ufw status # allow all traffic from a given IP ufw allow in from 128.223.157.19 # allow from all IPs to given service # (note: "in" is assumed if not specified) ufw allow proto tcp to 1.2.3.4 port 80 ufw configuration storage ● Stored in /etc/ufw/ and /etc/ufw/applications.d/ ● The latter has pre-defined application rules – you can apply these rules if you want them – simplifies application configuration # cat /etc/ufw/applications.d/openssh-server [OpenSSH] title=Secure shell server, an rshd replacement description=OpenSSH is a free implementation of \ the Secure Shell protocol.
    [Show full text]
  • A Practical Approach to Protect Iot Devices Against Attacks and Compile Security Incident Datasets
    Hindawi Scientific Programming Volume 2019, Article ID 9067512, 11 pages https://doi.org/10.1155/2019/9067512 Research Article A Practical Approach to Protect IoT Devices against Attacks and Compile Security Incident Datasets Bruno Cruz ,1 Silvana Go´mez-Meire ,1 David Ruano-Orda´s ,1,2,3,4 Helge Janicke,3,4 Iryna Yevseyeva ,3,4 and Jose R. Me´ndez 1,2 1Department of Computer Science, University of Vigo, ESEI—Escuela Superior de Ingenier´ıa Informa´tica, Edificio Polite´cnico, Campus Universitario As Lagoas s/n, 32004 Ourense, Spain 2SING Research Group, Galicia Sur Health Research Institute (IIS Galicia Sur), SERGAS-UVIGO, Vigo, Spain 3Cyber Technology Institute, School of Computer Science and Informatics, De Montfort University, Gateway House 5.33, 7e Gateway, LE1 9BH Leicester, UK 4Faculty of Computing, Engineering & Media (CEM), De Montfort University, Leicester, UK Correspondence should be addressed to Jose R. Me´ndez; [email protected] Received 27 April 2019; Revised 26 June 2019; Accepted 7 July 2019; Published 29 July 2019 Guest Editor: Daniele D’Agostino Copyright © 2019 Bruno Cruz et al. +is is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. +e Internet of +ings (IoT) introduced the opportunity of remotely manipulating home appliances (such as heating systems, ovens, blinds, etc.) using computers and mobile devices. +is idea fascinated people and originated a boom of IoTdevices together with an increasing demand that was difficult to support. Many manufacturers quickly created hundreds of devices implementing functionalities but neglected some critical issues pertaining to device security.
    [Show full text]