Cmd

9 Lethal Linux Commands You Should Never Run

Linux can be a double-edged sword. It assumes that you know what you’re doing and gives you the freedom to do whatever you want. It won’t question you. This is convenient when you actually know what you’re doing, but it also means that you could conceivably render your system unusable within seconds. New to the Linux command line? No worries. With those two resources, you’ll familiarize yourself with the command line in no time. But whether you’re a Linux newbie or veteran, you should never run a command unless you know exactly what it does. Here are some of the deadliest Linux commands that you’ll, for the most part, want to avoid. Delete Recursively The Linux ability to delete anything you want without question is a godsend, especially after dealing with years of “That file can’t be deleted” errors in Windows. But Internet trolls will be quick to deceive you, presenting you with extremely dangerous removal commands that can wipe entire hard drives. rm -rf / This line executes the remove command rm with two toggles: -r which forces recursive deletion through all subdirectories and -f which forces deletion of read-only files without confirmation. The command is executed on the / root directory, essentially wiping your whole system clean.

Continue reading

Cheat – Command Line Cheat-Sheet for Linux cmd Nerds

Was Sie tun, wenn Sie sich nicht sicher sind, welchen Befehl Sie ausführen müssen, insbesondere bei komplexen Befehlen, die viele Optionen mit verwenden. Die meisten verwenden dazu dann Manpages, um in solchen Situationen Hilfe zu erhalten. Einige der anderen Optionen können Befehle wie ’ help ‘, ’ whereis ’ und ’ whatis ’ sein. Aber alle haben ihre Vor- und Nachteile. Beim Durchsuchen von Manpages nach Optionen und Hilfe ist die Beschreibung in Manpages zu lang, um sie in kurzer Zeit zu verstehen. Linux Man Pages In ähnlicher Weise liefert der Befehl ‘help’ möglicherweise nicht die gewünschte Ausgabe. Hilfe command Ein ‘whereis’-Befehl sagt kaum etwas anderes als den Speicherort der installierten Binärdateien aus (kann zur Zeit wichtig sein). whereis command Ein ‘whatis’-Befehl gibt eine strenge und einzeilige Antwort, die nicht viel hilfreich ist, außer den Zweck des Befehls anzuerkennen. Außerdem sagt er kein einziges Wort über die verfügbaren Optionen. whatis command Wir haben alle diese Optionen bis heute genutzt, um unser Problem im Dilemma zu lösen, aber hier kommt eine interaktive Spickzettel-Anwendung “Cheat”, die den Rest führen wird. Was ist Cheat? Cheat bietet einfache Befehlsoptionen und ist eine interaktive Cheat-Sheet-Anwendung, die unter der GNU General Public License für Linux-Befehlszeilenbenutzer veröffentlicht wurde.

Continue reading

Cheatsheet vim

Code formatting :set list, \l - show invisibles :retab! - auto converting between tabs and spaces :set expandtab, retab! - to spaces :set noexpandtab, retab! - to tabs . - repeat Normal mode h, j, k, l - left, down, up, right gj - go down display line gk - go up display line 0 - to the first character of real line g0 - to the first character of display line ^ - to the first nonblank character of line g^ - to the first nonblank character of display line $ - to the end of real line g$ - to the end of display line w - forward to start of next word W - to the next WORD b - backward to start of current/previous word B - backward to start of current/previous WORD e - forward to end of current/next word E - forward to end of current/next WORD ge - backward to end of previous word gE - backward to end of previous WORD <number>G - to the line gg - beginning of the file G - end of the file ^G - show current line % - move to matching brackets f<char> - find next F<char> - find backward t<char> - find next char and place cursor before T<char> - find next char and place cursor before backward ; - go to the next of f/t , - go to previous of f/t g; - back to the last change g, - forward to the next change :changes - list changes {number}+ - go to the {number} lines down {number}- - go to the {number} lines up Marks m{a-zA-Z} - set a mark `{mark} - go to the exact mark place '{mark} - go the first non-whitespace character on where mark was set Automatic marks ` - Position before the last jump within current file .

Continue reading

Cracking Wifi WPA/WPA2 passwords using pyrit cowpatty– with cuda or calpp in Kali Linux

There are just too many guides on Cracking Wifi WPA/WPA2 passwords using different methods. Everyone has their own take on it. Personally, I think there’s no right or wrong way of cracking a Wireless Access Point. Following way is my way and I found it extremely efficient and fast during my tests for Cracking Wifi WPA/WPA2 passwords using pyrit cowpatty in Kali Linux where I attacked with Dictionary using either cuda or calpp (cal++) and at the same time I used WiFite to fast track a few things. This whole process was used in Kali Linux and it took me less than 10 minutes to crack a Wifi WPA/WPA2 password using pyrit cowpatty WiFite combination using my laptop running a AMD ATI 7500HD Graphics card. You can make the following process faster like I did. If you have an AMD ATI Graphics card you’ll have to follow these guides below: Contents Cracking Wifi WPA/WPA2 passwords using pyrit cowpatty– with cuda or calpp in Kali Linux NVIDIA Users: AMD Users: Capture handshake with WiFite Create ESSID in Pyrit Database Import Dictionary in Pyrit Create tables in Pyrit using batch process Cracking Process Attack a handshake with PMKs from the db using Pyrit Attack a handshake with passwords from a file or Dictionary using Pyrit Crack using Cowpatty Export to cowpatty Let it rip: Crack WPA WPA2 PSK password using cowpatty Attack a handshake with PMKs from a cowpatty-file using Pyrit Cleanup Pyrit and database Conclusion Cracking Wifi WPA/WPA2 passwords Related NVIDIA Users: Install proprietary NVIDIA driver on Kali Linux – NVIDIA Accelerated Linux Graphics Driver Install NVIDIA driver kernel Module CUDA and Pyrit on Kali Linux – CUDA, Pyrit and Cpyrit-cuda AMD Users: Install AMD ATI proprietary fglrx driver in Kali Linux 1.

Continue reading

Dateien finden mit dem Befehl: find

Wie finde ich die neuesten Dateien unter Linux? Ein Programm schreibt jedem Menge Logdateien mit cryptischen Dateinamen. Wie findet man die letzte Logdatei? Wie finde ich die letzten Dateien in meinem Browser-Cache? ls -ltr Der ls-Befehl kann Dateien nach dem (Modifikations-) Datum (time) sortieren (Option -t). Die Option -r /reverse) dreht das Ergebnis einfach um. Mit ls -ltr werden einfach alle Dateien in einem Verzeichnis umgekehrt nach der Zeit sortiert. Die neuesten (und wichtigsten) Dateien stehen dann am Ende des Listings. Wenn das Verzeichnis viele Dateien enthält, lässt man das Listing einfach an sich vorbeirauschen, die wichtigsten Dateien stehen unten. Analog findet ls -lSr Übrigens die größten Dateien (-S: sort by size). Nur die letzte Datei finden Die neueste Datei findet man z.B. in shell-Skripten zusammen mit tail. Die -l (long) Option stört an dieser Stelle und macht es nur kompliziert. last=`ls -tr | tail -1` if [ -z "$last" ] then echo "keine Datei gefunden" else echo "letzte Datei: $last" fi Suchen in Unterverzeichnissen Bei der Suche in Unterverzeichnissen helfen find und xargs. Firefox organisiert seinen Cache in Unterverzeichnissen. Welches ist die zuletzt heruntergeladene Datei? cd ~/.mozilla/firefox/\*/Cache # In das Cache Verzeichnis wechseln find . -type d | xargs ls -ltrd # nur neueste Verzeichnisse suchen # (ls -d: Verzeichnisinhalt nicht anzeigen)

Continue reading

Denial-of-service Attack

Denial-of-service Attack – DOS using hping3 with spoofed IP in Linux In computing, a denial-of-service (DoS) or distributed denial-of-service (DDoS) attack is an attempt to make a machine or network resource unavailable to its intended users. Although the means to carry out, the motives for, and targets of a DoS attack vary, it generally consists of efforts to temporarily or indefinitely interrupt or suspend services of a host connected to the Internet. As clarification, distributed denial-of-service attacks are sent by two or more persons, or bots, and denial-of-service attacks are sent by one person or system. As of 2014, the frequency of recognized DDoS attacks had reached an average rate of 28 per hour. Perpetrators of DoS attacks typically target sites or services hosted on high-profile web servers such as banks, credit card payment gateways, and even root DNS-Nameserver’s. Denial-of-service threats are also common in business, and are sometimes responsible for website attacks. This technique has now seen extensive use in certain games, used by server owners, or disgruntled competitors on games, such as popular Minecraft servers. Increasingly, DoS attacks have also been used as a form of resistance. Richard Stallman has stated that DoS is a form of ‘Internet Street Protests’.

Continue reading

Fritzbox: Datenverkehr mitschneiden

Über eine versteckte Funktion können Sie mit Ihrer Fritzbox den Datenverkehr mitschneiden. So kommen Sie Problemen und mysteriösen Aktivitäten in Ihrem Netzwerk auf die Schliche. Wir zeigen Ihnen, wie’s geht. Datenverkehr mit der Fritzbox aufzeichen Datenverkehr in der Fritzbox Grundsätzlich kann jeder mit der Fritzbox den Datenverkehr aufzeichnen. Die Auswertung der Daten ist jedoch kompliziert und nur etwas für fortgeschrittene Nutzer. Sie können den Datenverkehr aber selbst mitschneiden und das Ergebnis an einen Experten senden, der es für Sie auswertet. Öffnen Sie den folgenden Link, über den Sie direkt zum Datenmitschnitt der Fritzbox gelangen. Loggen Sie sich hier mit Ihrem Passwort ein. Nun können Sie nach Belieben verschiedene Schnittstellen Ihres Netzwerks mitschneiden. Wählen Sie zwischen den Oberpunkten “Internet”, “Netzwerkschnittstellen”, “WLAN”, “USB” und “DTrace”. Um die Aufzeichnung zu starten, klicken Sie auf die Schaltfläche “Start” neben der gewünschten Schnittstelle. Es beginnt nun ein Download, der erst abgeschlossen wird, wenn Sie auf “Stopp” klicken. Der Download wird daraufhin beendet und die Datei kann ausgelesen werden. Datenverkehr der Fritzbox mit Wireshark auswerten Datenverkehr mit Wireshark Laden Sie sich das kostenlose Programm “Wireshark” herunter und installieren Sie es. Wählen Sie bei der Installation die Zusatz-Software “WinPcap” ab. Diese wird nicht benötigt. Starten Sie das Programm und klicken Sie oben links auf “File” und anschließend auf “Open”.

Continue reading

Hacker Angriffsarten

Hacker Angriff: Asynchrone State Gefahr: Maskerade Dieser Angriff [Joncheray 95] basiert auf dem Versuch, einen asynchronen Zustand auf beiden Seiten der TCP-Verbindung zu erzwingen, durch den der Angreifer Pakete erstellen kann, die auf beiden Seiten als echte Pakete akzeptiert werden. Dieser Angriff ist durch Verkehrsüberwachung zu erkennen. Die einzige Möglichkeit, sich vor diesem Angriff zu schützen, ist, die Daten zu verschlüsseln und zu signieren. Hacker Angriff: Ausführbarer Code Gefahr: Manipulation Über HTTP können Java-Applets und ActiveX Controls übertragen werden. Außerdem dient das Multipurpose Internet Mail Extensions Protocol (MIME) dazu, den Aufbau einer Seite im HTML-Format zu beschreiben. Somit ist ausführbarer Code eine wesentliche Gefahr, die von HTTP ausgeht. Proxies können HTTP-Nachrichten auf ausführbaren Code untersuchen. Hacker Angriff: Ausführbarer Code Gefahr: Manipulation, Eindringen Je nach Konfiguration könnte Software im FTP-Bereich manipuliert sein - besonders, wenn es sich um ausführbaren Code handelt. Ist ein Angreifer in der Lage, ausführbare Programme auf ein fremdes System zu bringen, so kann er dort “Trojanische Pferde” installieren. Dies können Programme sein, die intern Information sammeln und diese möglichst unbemerkt nach außen zurück zum Angreifer schmuggeln. Sie verstecken sich in einem scheinbar nützlichen ausführbaren Programm. Dieses kann per FTP angeboten oder per Mail verschickt werden - in jedem Fall muss der Empfänger dazu motiviert werden, das Programm zu starten.

Continue reading

Leserliche Ausgabeformate

Leserliche Ausgabeformate Viele Linux-Kommandos, die Dateigrößen anzeigen, wie etwa der Directory-Lister ls oder die Anzeige des freien Plattenspeichers df, liefern als Standard ein Ergebnis, das für menschlichen Gebrauch realtiv ungeeignet ist. Das muß auch so sein, weil viele Skripts diese Ergebnisse der Kommandos aufnehmen und weiterverarbeiten. Um dennoch lesbare Ergebnisse zu erreichen, verfügen viele Programme über den Parameter -h, wie “human”, der beispielsweise statt “7533549” die Variante “7.5G” ausgibt.

Continue reading

Linux CMD Tastatur Befehle

Linux CMD Tastatur Befehle Ins vorherige Verzeichnis Wechseln: cd - Insert the last argument from the previous command [ESC]+.That’s hold down escape and press . This is a great one if you’re processing a file in multiple steps. The result file is often the last argument of a command then is will be an argument of the next command. Hier ist ein Beispielspromt PS1="\[\e[30;1m\]\u@\h:\[\e[34;1m\]\w\n\`if [ \$? = 0 ]; then echo \[\e[30m\]! \!\[\e[30m\]\$; else echo \[\e[31m\]! \!\[\e[30\;0m\]\$; fi\` \[\e[0m\\]"It looks like this: user@host:****/current/working/directory ! 506$ If the command you run returns an exit status that’s not 0, i.e. it fails, then it looks like this user@host:****/current/working/directory ! 506$ CMD Shortcuts Here’s the top shortcuts I use on the command line. These should speed up your productivity quite nicely. If you’re using the Gnome Terminal on Ubuntu (possibly other distro’s too) you might need to enable ALT+f and ALT+b in the preferences. ESC + .Escape key and the period/full stop at the same time will insert the last argument from the previous command. For example if your previous command is: echo Hello World Then this shortcut will insert ‘World’ and the current point. However, if your previous command was echo "Hello World" Then it will insert ‘“Hello World”’.

Continue reading

Linux Tastenkombinationen

Strg Alt F1 Ctrl Alt F1 Switch to the first text terminals. Under Linux you can have several (6 in standard setup) terminals opened at the same time. This is a keyboard shortcut, which means: “press the control key and the alt key, hold them. Now press F1. Release all keys.” ​ Ctrl Alt Fn (n=1..6) Switch to the nth text terminal. (The same could be accomplished with the rarely used command chvt n. “chvt” stands for “change virtual terminal”). In text terminal (outside X), you can also use Alt Fn (the key Ctrl is not needed). tty Print the name of the terminal in which you are typing this command. If you prefer the number of the active terminal (instead of its name), it can be printed using the command fgconsole (=“foreground console”). Ctrl ​ Alt F7 Switch to the first GUI terminal (if X-windows is running on the 7th terminal, where it typcially is). Ctrl ​ Alt Fn (n=7..12) Switch to the nth GUI terminal (if a GUI terminal is running on screen n-1). On default, the first X server is running on terminal 7. On default, nothing is running on terminals 8 to 12–you can start subsequent X server there.

Continue reading

Midnight-Commander Templates

1) Rot-Grau - Editor Schwarz [Colors] base_color=normal=lightgray,red:input=white,brown:errors=white,brightred:gauge=brown, black:selected=black,white:marked=yellow,red:markselect=yellow,white:directory=white, red:executable=brightgreen,red:link=lightgray,red:device=brightmagenta,red:special=brightmagenta, red:core=brightred,red:menu=black,white:menuhot=yellow,white:menuhotsel=brightred, black:dnormal=black,white:dfocus=white,lightgray:dhotnormal=yellow, white:dhotfocus=brightred,lightgray:editnormal=lightgray,black:editmarked=yellow,white 2) Gelb Schwarz - Editor schwarz [Colors] base_color=gray,black:normal=yellow,black:menu=yellow,gray:viewunderline=black, green:editnormal=white,black:editmarked=black,white:menuhot=red,gray:directory=brightred, gray:executable=brightgreen,gray:device=white,gray:input=yellow,gray:link=brightcyan, gray:stalledlink=white,gray:reverse=brightmagenta,black:selected=black, yellow:marked=yellow,brown:markselect=black,magenta 3) Schwarz-Weiß-Türkis Template - Editor schwarz [Colors] base_color=normal=white,default:directory=white,default:marked=yellow,default:selected=gray, white:executable=brightgreen,default:link=lightgray,default:stalelink=brightred, default:special=brightblue,default:device=magenta,default:editnormal=white,default 4) Schwarzes Template - Editor gleich blau [Colors] base_color=normal=,default:selected=,:marked=,default:markselect=,:menu=,:menuhot=, :menusel=,:menuhotsel=,:dnormal=,:dfocus=,:dhotnormal=,:dhotfocus=,:input=,:reverse=,:executable=, default:directory=,default:link=,default:device=,default:special=,:core=,:helpnormal=,:helplink=,:helpslink=,: 5) Grün-blau - Editor schwarz [Colors] base_color=lightgray,green:normal=green,default:selected=white,gray:marked=yellow, default:markselect=yellow,gray:directory=blue,default:executable=brightgreen, default:link=cyan,default:device=brightmagenta,default:special=lightgray,default:errors=red, default:reverse=green,default:gauge=green,default:input=white,gray:dnormal=green, gray:dfocus=brightgreen,gray:dhotnormal=cyan,gray:dhotfocus=brightcyan, gray:menu=green,default:menuhot=cyan,default:menusel=green,gray:menuhotsel=cyan, default:helpnormal=cyan,default:editnormal=green,default:editbold=blue, default:editmarked=gray,blue:stalelink=red,default 6) Türkis-Gelb gut [Colors] color_terminals=linux,xterm,gnome-terminalbase_color=normal=cyan,black:directory=yellow,black:selected=blue, cyan:marked=brightcyan,brown:menu=blue,cyan:link=green,black:executable=brightmagenta, black:core=red,black:editnormal=cyan,black:editbold=yellow,black:editmarked=magenta, white:dnormal=green,black:dfocus=white,green:dhotnormal=yellow,black:dhotfocus=green, black:helpnormal=yellow,blue:helpslink=white,green:helplink=white,blue:gauge=white,green:input=white,red: Midnight Commander + 7zip Download p7zip_4.42_src_all.tar.bz2 (p7zip homepage). Extract the file "contrib/VirtualFileSystemForMidnightCommander/u7z" and copy it to /usr/share/mc/extfs/ Edit /usr/share/mc/extfs/extfs.ini to add "u7z" after urar. Edit /usr/share/mc/mc.ext to add : ​ regex/.(7z|7Z)$ View=%view{ascii} 7za l %f Open=%cd %p#u7z Midnight Commander Verzeichnisse und Dateien /usr/share/mc/mc.hlp ​ The help file for the program. /usr/share/mc/mc.ext ​ The default system-wide extensions file. ~/.mc/bindings ​ User’s own extension, view configuration and edit configuration file. They override the contents of the system wide files if present. /usr/share/mc/mc.ini ​ The default system-wide setup for the Midnight Commander, used only if the user doesn’t have his own ~/.mc/ini file. /usr/share/mc/mc.lib ​ Global settings for the Midnight Commander. ​ Settings in this file affect all users, whether they have ~/.mc/ini or not. Currently, only terminal settings are loaded from mc.lib. ~/.mc/ini ​ User’s own setup.

Continue reading

Port Liste

Liste mit einer kleinen Auswahl der wichtigsten Ports. Portnummer Dienst Beschreibung 7 Echo Zurücksenden empfangener Daten 20 FTP-Data Dateitransfer (Datentransfer vom Server zum Client) 21 FTP Dateitransfer (Initiierung der Session und Senden der FTP-Steuerbefehle durch den Client) 22 SSH Secure Shell 23 Telnet Terminalemulation 25 SMTP, ESMTP E-Mail-Versand 53 DNS Auflösung von Domainnamen in IP-Adressen 67 DHCP Zuweisung der Netzwerkkonfiguration an Clients 70 Gopher Vorläufer des World Wide Web 80 HTTP Webserver 110 POP3 Client-Zugriff für E-Mail-Server 143 IMAP Client-Zugriff für E-Mail-Server 443 HTTPS sicherer Webserver (via SSL verschlüsselt) 548 AFP over IP Datei- und Druckdienste (Mac OS und Mac OS X) 993 IMAPS sicherer Client-Zugriff für E-Mail-Server 995 POP3S sicherer Client-Zugriff für E-Mail-Server 1433 Microsoft SQL Server Zugriff auf SQL-Server-Datenbanken 1521 Oracle Zugriff auf Oracle-Datenbanken 1723 VPN Aufbau von VPN-Verbindungen 3050 Firebird Zugriff auf Firebird-Datenbanken 3306 MySQL Zugriff auf MySQL-Datenbanken 3389 RDP Windows Remotedesktopzugriff, Windows Terminal Services 5190 ICQ Instant-Messaging-Programm ICQ 5432 PostgreSQL Zugriff auf PostgreSQL-Datenbanken 5984 CouchDB Zugriff auf CouchDB-Datenbanken 6667 IRC Chatserver 8080 alternativer HTTP Port Webserver (Standardport bei Apache Tomcat) IANA-Liste der zugeordneten Ports – „offizielle“, registrierte Portnummern .txt WikiListe der TCP- und UDP-Ports Ausführliche Liste von Portnummern – incl. vieler Würmer, Trojaner und Backdoors

Continue reading

Portscanner-nmap

Portscanner wie nmap sind eines der wichtigsten Arbeitsmittel von Administratoren. Dieses HowTo beschreibt den Einsatz des populären Portscanner Nmap unter Linux & Windows Systemen. Protokolle & Ports Um einen Dienst auf einen IP-Host eindeutig zu identifizieren werden drei Angaben benötigt: das Protokoll (z.B. TCP) die IP-Adresse (z.B. 10.0.0.1) die Portnummer (z.B. 80 für HTTP) Diese drei Angaben identifizieren einen Webserver (HTTP) der auf dem Host mit der IP-Adresse 10.0.0.1 läuft. Die Portnummer ist eine 16-Bit-Zahl zwischen 0 und 65535. Für Standarddienste werden die Portnummern von der IANA vergeben. Dort finden Sie auch die aktuelle Liste der Portnummern. Die Aufgabe eines Portscanners ist es nun, die offenen Ports eines Systems zu ermitteln. Also die Ports, auf denen ein Service angeboten wird. Beispiel: Sehen wir uns dazu ein erstes Beispiel an. [root] ~ $ nmap -sT lxu.io Starting nmap 3.20 ( www.insecure.org/nmap/ ) at 2005-03-01 18:18 CEST Interesting ports on lxu.io (10.0.0.1): (The 1610 ports scanned but not shown below are in state: closed) Port State Service 80/tcp open http Nmap run completed -- 1 IP address (1 host up) scanned in 9.966 seconds Mit dem Linux Kommando: nmap -sT lxu.io untersucht nmap den Host lxu.io auf offene TCP-Ports. Dabei überprüft nmap standartmässig nicht alle 65535 TCP-Ports.

Continue reading

Vim Kurz Referenz

Vim Editor Kurzreferenz Befehlsmodus Kommando Beschreibung i Insertmodus, damit kann man editieren Cursortasten navigieren h, j, k, l navigieren, wenn Cursortasten tod sind G letzte Zeile Dokument nG gehe zu Zeile n dd Zeile löschen (in Zwischenablage) yy Zeile in Zwischenablage nyy n Zeilen in Zwischenablage p Zwischenablage einfügen unterhalb /Muster Suche nach Muster n Suche wiederholen set ic Umschalten Suche “ignore case” set noic Umschalten Suche case sensitiv :1,$s/from/to/gc Ersetze from nach to im ganzen Dokument mit Nachfrage Strg+G Aktuelle Zeilennummer und Dateiname anzeigen :n Nächste Datei bearbeiten :rew Vorherige Datei bearbeiten :w Datei speichern :q Editor verlassen u Undo . letzte Änderung wiederholen Editiermodus Kommando Beschreibung ESC zurück in Befehlsmodus Cursortasten navigieren Vim Auführlicher Navigieren Kommando Beschreibung Cursortasten navigieren h, j, k, l; navigieren, wenn Cursortasten tod sind 1G erstes Zeile Dokument G letzte Zeile Dokument nG Gehe zu Zeile n (Bsp: 20G) 0 erstes Zeichen Zeile, wie Pos1 $ letztes Zeichen Zeile w Nächstes Wort. Anfang des Wortes. (auch W) b Vorheriges Wort. Anfang des Wortes. (auch B) e Nächstes Wort, Wortende. (auch E) ) Nächster Satz. ( Vorheriger Satz. } Nächster Absatz. { Vorheriger Absatz. Return Erstes nicht leeres Zeichen nächste Zeile n| Spalte n aktuelle Zeile Strg-F/Page-Down Seite vorwärts.

Continue reading

Wichtige /var/log/ Logdateien

Wenn Sie viel Zeit in einer Linux-Umgebung verbringen, ist es wichtig zu wissen, wo sich die Logdateien befinden und was in jeder Protokolldatei enthalten ist. Wenn Ihre Systeme reibungslos funktionieren, nehmen Sie sich etwas Zeit, um den Inhalt verschiedener Logdateien zu erlernen und zu verstehen. Dies hilft Ihnen bei Krisen und Sie müssen die Logdateien durchsehen, um das Problem zu identifizieren. /etc/rsyslog.conf steuert, was in einigen Logdateien enthalten ist. Im Folgenden finden Sie beispielsweise den Eintrag in der Datei rsyslog.conf für /var/log/messages. grep "/var/log/messages"/etc/rsyslog.conf *.info;mail.none;authpriv.none;cron.none /var/log/messages In der obigen Ausgabe * .info gibt an, dass alle Protokolle vom Typ INFO protokolliert werden. mail.none, authpriv.none, cron.none gibt an, dass diese Fehlermeldungen nicht in der Datei /var/log/messages protokolliert werden sollten. Sie können auch * .none angeben, was darauf hinweist, dass keine der Protokollnachrichten protokolliert wird. Im Folgenden sind die 20 verschiedenen Logdateien aufgeführt, die sich im Verzeichnis/var/log/ befinden. Einige dieser Logdateien sind verteilungsspezifisch. Beispielsweise wird dpkg.log auf Debian-basierten Systemen (z. B. unter Ubuntu) angezeigt. /var/log/messages - Enthält globale Systemnachrichten, einschließlich der Nachrichten, die beim Systemstart protokolliert werden. Es gibt verschiedene Dinge, die in /var/log/messages angemeldet sind, einschließlich Mail, Cron, Daemon, Kern, Auth usw. /var/log/dmesg - Enthält Informationen zum Kernel-Ringpuffer. Beim Systemstart wird eine Anzahl von Meldungen auf dem Bildschirm gedruckt, auf denen Informationen zu den Hardwaregeräten angezeigt werden, die der Kernel während des Startvorgangs erkennt.

Continue reading

Ansible AD HOC Command Examples – Ansible Cheat Sheet

Ansible AD HOC Command Examples - Ansible Cheat Sheet Excerpt Ansible ad hoc commands are one-liners designed to achieve a very specific task they are like quick snippets and your compact swiss army knife when you want to do a quick task across multiple machines. Simply put, Ansible ad hoc commands are single-line Linux shell commands, and a playbook is like a shell script, a collection of multiple commands with logic. Ansible special commands are single lines designed to accomplish a very specific task. They are like quick extractors and your compact Swiss army knife when you want to complete a task quickly on multiple machines. Simply put, Ansible ad hoc commands are single-line Linux shell commands, and a playbook is like a shell script, a collection of multiple commands with logic. Ansible special commands are useful when you want to perform a quick task. We’ve collected over 20 examples that will help you get started with Ansible AD HOC commands. This is your Ansible AD HOC command cheat sheet or Ansible cheat sheet. Prerequisites Must install Ansible (only on the control machine, remember there is no agent) Some remote virtual machines to test, you can use vagrant to build them.

Continue reading

Ansible apt module Examples - install with apt

Excerpt Ansible APT Package manager is an Ubuntu equivalent for RedHat yum package manager. Just like all other ansible modules apt ansible module is built after one specific unix command of Debian apt-get It is always recommended to choose the modules rather using the raw unix commands over the shell module as it would bring more standard and fault tolerance to your Ansible Playbook The Ansible APT package manager is the Ubuntu equivalent of the RedHat yum package manager. Just like all other Ansible ‘apt’ modules, the Ansible module is built after the Debian-specific Unix ‘apt-get’ command You should choose modules instead of using raw Unix commands instead of shell modules as this will bring more standards and fault tolerance to your Ansible Playbook. So how to use apt ansible module in playbook or in special way. GOOD!. This article will cover the ansible apt module in detail with various examples. Introduction to ansible apt module Ansible apt module manages apt packages in Debian or Ubuntu systems. In typical Ubuntu machine, in order to install a package, you would execute the following command apt install nginx Same way here in ansible, the following playbook/play would do that for you

Continue reading

Ansible Command Module Examples

Excerpt Ansible Command module is used to execute commands on a remote node. The Command module is mainly used to execute simple Linux commands on a remote node/server that is part of a server group or a standalone server mentioned in the server group. If you want to run some simple shell commands on a remote server, you can use Ansible Command Module Examples The Ansible Command module is used to execute commands on the remote node. The Command module is mainly used to execute simple Linux commands on a remote node/server that is part of a server group or a standalone server mentioned in the server group. If you want to run some simple shell commands on a remote server, you can use this Ansible command module . But when there are no overly complicated shell commands or two commands concatenated with PIPE. you cannot use this command module and you must choose the shell module instead of this one. Not just a pipe, if you use one of these characters like | > < in your command you should consider using the shell module Where to use Ansible SHELL and Where to use Ansible COMMAND? ls -lrt /etc/httpd/conf is simple and can be executed with Ansible command module

Continue reading

Ansible Dry Run – How to Run Playbook in Ansible Check mode

Excerpt Introduction Ansible Dry Run or Ansible Check mode feature is to check your playbook before execution like Ansible’s –syntax-check feature. With Ansible Dry Run feature you can execute the playbook without having to actually make changes on the server. With Ansible Dry Run you can see if the host is getting changed or not. Introduction Ansible Dry Run or Ansible Check mode feature is to check your playbook before execution like Ansible’s --syntax-check feature. With Ansible Dry Run feature you can execute the playbook without having to actually make changes on the server. With Ansible Dry Run you can see if the host is getting changed or not. Here is a sample playbook is written to install and start the Apache HTTPD web server. --- - name: Playbook hosts: webservers become: yes become_user: root tasks: - name: ensure apache is at the latest version yum: name: httpd state: latest - name: ensure apache is running service: name: httpd state: started Our objective is to install Apache web server and start it but if we want to see if it would affect/change the host or throw error . We can Dry Run this Playbook with no further ado, Let me tell you how to Run the Ansible Playbook in Check mode or dry run mode ASCII Video

Continue reading