<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>http://robopagex.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Geist</id>
	<title>robopagex.com - Benutzerbeiträge [de]</title>
	<link rel="self" type="application/atom+xml" href="http://robopagex.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Geist"/>
	<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Spezial:Beitr%C3%A4ge/Geist"/>
	<updated>2026-04-28T01:22:54Z</updated>
	<subtitle>Benutzerbeiträge</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>http://robopagex.com/index.php?title=Ssh&amp;diff=1155</id>
		<title>Ssh</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Ssh&amp;diff=1155"/>
		<updated>2025-06-11T13:05:14Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==== ''' AUTHOR | HACKBUGZ ''' ====&lt;br /&gt;
 [https://stackexchange.com/users/23684174/hackbugz?tab=accounts StackExchange | HACKBUGZ]&lt;br /&gt;
 [https://www.tiktok.com/@hackbugz? TIKTOK | HACKBUGZ]&lt;br /&gt;
&lt;br /&gt;
==== ''' Links ''' ====&lt;br /&gt;
 [https://linux.die.net/man/1/sshfs sshfs(1) - Linux man page]&lt;br /&gt;
 [https://wiki.ubuntuusers.de/FUSE/sshfs/ wiki.ubuntuusers.de FUSE/SSHFS]&lt;br /&gt;
 [https://wiki.ubuntuusers.de/FUSE/ wiki.ubuntuusers.de FUSE]  &lt;br /&gt;
&lt;br /&gt;
 [https://www.ssh.com/iam/ssh-key-management/ SSH Key Management]&lt;br /&gt;
 [https://www.ssh.com/ssh/authorized_keys/ Authorized_keys file in SSH]&lt;br /&gt;
 [https://unix.stackexchange.com/questions/208960/how-to-restrict-a-user-to-one-folder-and-not-allow-them-to-move-out-his-folder How to restrict a user to one folder and not allow them to move out his folder - Unix &amp;amp; Linux Stack Exchange]&lt;br /&gt;
 [https://www.tecmint.com/restrict-ssh-user-to-directory-using-chrooted-jail/ Restrict SSH User Access to Certain Directory Using Chrooted Jail]&lt;br /&gt;
 [https://www.cyberciti.biz/faq/debian-ubuntu-restricting-ssh-user-session-to-a-directory-chrooted-jail/ Debian/Ubuntu Linux: Restrict an SSH user session to a specific directory by setting chrooted jail - nixCraft]&lt;br /&gt;
 [https://wiki.archlinux.org/index.php/SSHFS SSHFS - ArchWiki]&lt;br /&gt;
&lt;br /&gt;
 [https://askubuntu.com/questions/48129/how-to-create-a-restricted-ssh-user-for-port-forwarding security - How to create a restricted SSH user for port forwarding? - Ask Ubuntu]&lt;br /&gt;
 [https://www.linux-magazin.de/ausgaben/2018/08/einfuehrung-2-5/ Aus dem Alltag eines Sysadmin: Reverse-SSH-Tunnel und Autossh]&lt;br /&gt;
 [https://www.howtogeek.com/428413/what-is-reverse-ssh-tunneling-and-how-to-use-it/ What Is Reverse SSH Tunneling? (and How to Use It)]&lt;br /&gt;
 [https://unix.stackexchange.com/questions/100859/ssh-tunnel-without-shell-on-ssh-server ssh tunneling - SSH: tunnel without shell on ssh server - Unix &amp;amp; Linux Stack Exchange]&lt;br /&gt;
 [https://serverfault.com/questions/56566/ssh-tunneling-only-access linux - ssh tunneling only access - Server Fault]&lt;br /&gt;
 [https://www.it-react.com/index.php/2020/01/06/how-to-setup-reverse-ssh-tunnel-on-linux/ How to Setup Reverse SSH Tunnel on Raspberry Pi behind a 3G USB stick modem - IT-REACT]&lt;br /&gt;
 [https://dev.to/bulletmark/create-a-reverse-ssh-tunnel-for-remote-access-to-a-restricted-machine-1ma0 Create a reverse SSH tunnel for remote access to a restricted Linux machine - DEV Community]&lt;br /&gt;
 [https://unix.stackexchange.com/questions/55106/disable-user-shell-for-security-reasons https://unix.stackexchange.com/questions/55106/disable-user-shell-for-security-reasons]&lt;br /&gt;
 [https://www.everythingcli.org/ssh-tunnelling-for-fun-and-profit-autossh/ SSH tunnelling for fun and profit: Autossh]&lt;br /&gt;
 [https://man7.org/linux/man-pages/man1/ssh-keygen.1.html ssh-keygen(1) - Linux manual page]&lt;br /&gt;
 [https://unix.stackexchange.com/questions/128894/ssh-exchange-identification-connection-closed-by-remote-host-not-using-hosts-d linux - ssh_exchange_identification: Connection closed by remote host (not using hosts.deny) - Unix &amp;amp; Linux Stack Exchange]&lt;br /&gt;
&lt;br /&gt;
 [https://github.com/szmi Miklos Szeredi | github]&lt;br /&gt;
 [https://indico.cern.ch/event/608592/contributions/2830117/attachments/1592339/2520491/Evolution_of_FUSE_and_OverlayFS.pdf  Evolution of FUSE and OverlayFS | Miklos Szeredi]&lt;br /&gt;
&lt;br /&gt;
 [https://explainshell.com/explain?cmd=ssh+-L+-N+-f+-l+-R+-i+-1 explainshell]&lt;br /&gt;
 [https://wiki.ubuntuusers.de/Screen/ Screen]&lt;br /&gt;
 [https://wiki.ubuntuusers.de/nohup/ nohup]&lt;br /&gt;
 [https://linuxcommand.org/lc3_man_pages/ssh1.html linuxcommand ssh1]&lt;br /&gt;
 open ip&lt;br /&gt;
&lt;br /&gt;
SSHFS und FUSE sind zwei verschiedene Dinge, die jedoch eng miteinander verwandt sind.&lt;br /&gt;
&lt;br /&gt;
FUSE (Filesystem in Userspace) ist ein Framework für das Betriebssystem Linux, das es ermöglicht, Dateisysteme in Benutzermodus-Programmen zu implementieren, anstatt diese im Kernelmodus implementieren zu müssen. Durch die Verwendung von FUSE können Benutzermodus-Programme wie SSHFS auf einfache Weise ein Dateisystem erstellen, das wie ein herkömmliches Dateisystem gemountet werden kann.&lt;br /&gt;
&lt;br /&gt;
SSHFS (SSH Filesystem) ist eine Erweiterung des FUSE-Frameworks, mit der man ein Dateisystem über SSH mounten kann. Das bedeutet, dass man über eine sichere Verbindung (SSH) auf Dateien und Verzeichnisse auf einem entfernten System zugreifen kann, als wären sie auf dem eigenen Computer vorhanden.&lt;br /&gt;
&lt;br /&gt;
Zusammenfassend kann man sagen, dass FUSE ein Framework ist, das es ermöglicht, Dateisysteme in Benutzermodus-Programmen zu implementieren, während SSHFS eine Anwendung ist, die FUSE verwendet, um ein Dateisystem über SSH zu mounten.&lt;br /&gt;
&lt;br /&gt;
SFTP und SSHFS sind ähnliche Technologien, die beide eine sichere Möglichkeit bieten, auf entfernte Dateien und Verzeichnisse zuzugreifen. Beide basieren auf dem SSH-Protokoll, das eine sichere Verschlüsselung der Datenübertragung ermöglicht. Der Hauptunterschied zwischen SFTP und SSHFS liegt jedoch in der Art und Weise, wie sie die Remote-Dateisysteme bereitstellen.&lt;br /&gt;
&lt;br /&gt;
SFTP (Secure File Transfer Protocol) ist ein Dateiübertragungsprotokoll, das auf dem SSH-Protokoll basiert und es ermöglicht, Dateien zwischen lokalen und entfernten Systemen zu übertragen. SFTP bietet jedoch keine Möglichkeit, ein entferntes Dateisystem zu mounten. Stattdessen bietet SFTP einen Dateizugriff über eine sichere Verbindung, ähnlich wie beim FTP-Protokoll.&lt;br /&gt;
&lt;br /&gt;
SSHFS (SSH Filesystem) hingegen ist ein FUSE (Filesystem in Userspace)-basiertes Dateisystem, das es ermöglicht, ein entferntes Dateisystem als lokales Dateisystem zu mounten. SSHFS verwendet das SSH-Protokoll, um eine sichere Verbindung zu einem entfernten System herzustellen und ein entferntes Dateisystem als lokales Dateisystem zu mounten. Dadurch können Sie auf entfernte Dateien und Verzeichnisse zugreifen, als wären sie auf Ihrem lokalen Computer vorhanden.&lt;br /&gt;
&lt;br /&gt;
Wenn es darum geht, auf entfernte Dateien und Verzeichnisse zuzugreifen, ist SSHFS in der Regel die bessere Option, da es die Möglichkeit bietet, ein entferntes Dateisystem als lokales Dateisystem zu mounten, was die Arbeit mit entfernten Dateien und Verzeichnissen erleichtert. SFTP ist jedoch eine gute Option, wenn Sie nur Dateien übertragen müssen, ohne das gesamte Dateisystem mounten zu müssen.&lt;br /&gt;
&lt;br /&gt;
=== '''SSH|SCP|SFTP FUSE, SSHFS''' ===&lt;br /&gt;
 '''Mit dem SSH-Clients SSHSSH|SCP|SFTP kann man sich über ein Terminal auf entfernte Rechner anmelden.'''&lt;br /&gt;
 '''Die Kommunikation und die Authentifizierung findet dabei verschlüsselt statt.'''&lt;br /&gt;
 '''SSH kann dabei interaktiv oder nicht interaktiv genutzt werden'''&lt;br /&gt;
&lt;br /&gt;
=== '''RANKING DER REMOTE CLIENTS|TOOLS NACH SICHERHEIT''' ===&lt;br /&gt;
 # '''SSH'''&lt;br /&gt;
 # '''SCP'''&lt;br /&gt;
 # '''SFTP'''&lt;br /&gt;
 # '''RLOGIN'''&lt;br /&gt;
 # '''TELNET'''&lt;br /&gt;
 # '''FTP'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSH STATUS''' ====&lt;br /&gt;
 '''$ systemctl status ssh '''&lt;br /&gt;
&lt;br /&gt;
 '''$ whoami'''&lt;br /&gt;
 '''$ who'''&lt;br /&gt;
 '''$ w'''&lt;br /&gt;
&lt;br /&gt;
 '''$ ps'''&lt;br /&gt;
 '''$ ps aux'''&lt;br /&gt;
 '''$ ps aux | grep ssh '''&lt;br /&gt;
 '''$ ps aux | grep sshd '''&lt;br /&gt;
&lt;br /&gt;
 '''$ lsof -i -n | egrep 'ssh' '''&lt;br /&gt;
 '''$ lsof -i -n | egrep 'sshd' '''&lt;br /&gt;
&lt;br /&gt;
 '''$ ss '''&lt;br /&gt;
 '''$ ss -l'''&lt;br /&gt;
 '''$ ss | grep tcp'''&lt;br /&gt;
 '''$ ss | grep -i ssh'''&lt;br /&gt;
 '''$ ss -u -a'''&lt;br /&gt;
&lt;br /&gt;
 '''$ last -a | grep -i still'''&lt;br /&gt;
&lt;br /&gt;
 '''apk*error'''&lt;br /&gt;
 ''$ service ssh status ''&lt;br /&gt;
 ''$ netstat -tanup | grep ssh ''&lt;br /&gt;
 ''$ netstat -tnpa | grep 'ESTABLISHED.*sshd''&lt;br /&gt;
 ''$ netstat -an | grep 8090/port''&lt;br /&gt;
 ''$ firewall-cmd --list-all-zones ''&lt;br /&gt;
&lt;br /&gt;
==== '''SSH tools''' ====&lt;br /&gt;
 '''ssh-keygen'''&lt;br /&gt;
 '''$ ssh-keyscan ip &amp;gt; known_hosts'''&lt;br /&gt;
 '''$ ssh-keyscan -f txtwithhosts'''&lt;br /&gt;
&lt;br /&gt;
 '''ssh-keyscan'''&lt;br /&gt;
&lt;br /&gt;
 '''ssh-copy-id'''&lt;br /&gt;
&lt;br /&gt;
 '''ssh-add'''&lt;br /&gt;
 '''$ ssh-add -l '''&lt;br /&gt;
 '''$ ssh-add KEY '''&lt;br /&gt;
&lt;br /&gt;
 '''ssh-agent'''&lt;br /&gt;
 '''$ pgrep ssh-agent '''&lt;br /&gt;
 '''$ ps aux | grep ssh-agent'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSH|SSHFS|FUSE CONFIG FILES''' ====&lt;br /&gt;
 '''$ cat /etc/ssh/sshd_config'''&lt;br /&gt;
 '''$ cat /etc/ssh/ssh_config'''&lt;br /&gt;
 '''$ /etc/fuse.conf'''&lt;br /&gt;
 '''$ /etc/modules'''&lt;br /&gt;
''&lt;br /&gt;
 '''''IN LAB'''''&lt;br /&gt;
 '''AllowHosts'''&lt;br /&gt;
 '''AllowUsers'''&lt;br /&gt;
 '''AllowGroups'''&lt;br /&gt;
 '''ChRootGroups(Syntax: AllowGroups)'''&lt;br /&gt;
 '''ChRootUsers(Syntax: AllowUsers)'''&lt;br /&gt;
&lt;br /&gt;
==== '''Create SSH Key''' ====&lt;br /&gt;
 '''$ ssh-keygen -t ed25519 -b 4096'''&lt;br /&gt;
&lt;br /&gt;
==== '''Copy SSH Key''' ====&lt;br /&gt;
 '''$ ssh-copy-id  -i KEY user@IP'''&lt;br /&gt;
 '''$ ssh-copy-id  -i ~/.ssh/KEY user@IP'''&lt;br /&gt;
&lt;br /&gt;
 ''copy key while login with key''&lt;br /&gt;
 '''$ ssh-copy-id -i KEYTOCOPY -f -o 'IdentityFile KEYTOLOGIN' -p 5000 USER@IP'''&lt;br /&gt;
&lt;br /&gt;
==== '''Login with SSH Key''' ====&lt;br /&gt;
 '''$ ssh -i ~/.ssh/KEY user@IP -p 5001'''&lt;br /&gt;
&lt;br /&gt;
==== '''Login SSH Password automation''' ====&lt;br /&gt;
 '''install sshpass '''&lt;br /&gt;
 '''#!/bin/bash '''&lt;br /&gt;
 '''read -s -p &amp;quot;Enter your password: &amp;quot; password '''&lt;br /&gt;
 '''echo '''&lt;br /&gt;
 '''sshpass -p &amp;quot;$password&amp;quot; ssh username@remote_server'''&lt;br /&gt;
&lt;br /&gt;
==== '''ssh config files &amp;amp; folders''' ====&lt;br /&gt;
 '''/etc/ssh/ssh_config'''&lt;br /&gt;
 '''/etc/ssh/sshd_config'''&lt;br /&gt;
 '''~/.ssh'''&lt;br /&gt;
 '''~/.ssh/authorized_keys '''&lt;br /&gt;
 '''~/.ssh/known_hosts'''&lt;br /&gt;
&lt;br /&gt;
==== '''ssh sshd_config file''' ====&lt;br /&gt;
 '''$ nano /etc/ssh/sshd_config'''&lt;br /&gt;
 ''' Port 5000'''&lt;br /&gt;
 ''' PubkeyAuthentication yes'''&lt;br /&gt;
 ''' PasswordAuthentication no'''&lt;br /&gt;
 ''' PermitEmptyPasswords no'''&lt;br /&gt;
 ''' X11Forwarding no'''&lt;br /&gt;
 ''' Banner /path/ (Message before login)'''&lt;br /&gt;
 ''''' ListenAddress (Strict/Diff Networks)'''''&lt;br /&gt;
 ''''' MaxSessions '''''&lt;br /&gt;
 [https://unix.stackexchange.com/questions/26170/sshd-config-maxsessions-parameter  MaxSessions parameter]&lt;br /&gt;
&lt;br /&gt;
==== '''ssh motd file''' ====&lt;br /&gt;
 '''$ nano /etc/motd (Message after Login)'''&lt;br /&gt;
&lt;br /&gt;
==== '''ssh known_hosts file''' ====&lt;br /&gt;
 '''$ nano ~/.ssh/known_hosts '''&lt;br /&gt;
&lt;br /&gt;
==== '''ssh authorized_keys file''' ====&lt;br /&gt;
 '''$ nano ~/.ssh/authorized_keys '''&lt;br /&gt;
&lt;br /&gt;
 '''How to manually copy SSH public keys to server:'''&lt;br /&gt;
 On the local machine&lt;br /&gt;
 '''$ cat ~/.ssh/id_rsa.pub'''&lt;br /&gt;
 copy&lt;br /&gt;
 ''ssh-rsa .STRING. USER@IP''&lt;br /&gt;
&lt;br /&gt;
 On the remote server paste the line to:&lt;br /&gt;
 '''~/.ssh/authorized_keys'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE''' ====&lt;br /&gt;
 '''$ sshfs user@host:/dir /dir -o IdentityFile=~/.ssh/KEY'''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs user@host:/dir /dir -o IdentityFile=~/.ssh/KEY -o idmap=user -o uid=$(id -u) -o gid=$(id -g)'''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs user@host:/dir /dir -C -p 5001'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE | USER MAPPING''' ====&lt;br /&gt;
 '''$ sshfs Benutzername@irgendEinRechner:/pfad_auf_dem_server/ ~/fusessh -o idmap=user -o uid=$(id -u) -o gid=$(id -g) '''&lt;br /&gt;
 '''$ sshfs user@host:/dir /dir -o IdentityFile=~/.ssh/KEY -o idmap=user -o uid=$(id -u) -o gid=$(id -g) -o nonempty -p 5001 '''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE | SYMLINKS''' ====&lt;br /&gt;
 '''$ sshfs -o follow_symlinks'''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs Benutzername@irgendEinRechner:/pfad_auf_dem_server/ ~/fusessh -o follow_symlinks '''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE | FUSERMOUNT''' ====&lt;br /&gt;
 '''$ fusermount -u /dir '''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE | Denied root access to user mounted FUSE file system''' ====&lt;br /&gt;
 This is by design in fuse as a security measure. &lt;br /&gt;
 Pass the '''-o allow_root''' or '''-o allow_other''' option when mounting the filesystem with sshfs.&lt;br /&gt;
 [https://serverfault.com/questions/188894/denied-root-access-to-user-mounted-fuse-file-system https://serverfault.com]&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS TIMEOUT''' ====&lt;br /&gt;
 '''1) In der Datei .ssh/config folgende Zeile hinzufügen (liegt im Homeverzeichnis des Anwenders, bzw. wenn man Automount beim Systemstart macht, ist die Datei /root/.ssh/config zu ändern):'''&lt;br /&gt;
 &lt;br /&gt;
  '''$ sshfs -o ServerAliveInterval=15'''&lt;br /&gt;
  '''$ sshfs-o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3  '''&lt;br /&gt;
  [https://serverfault.com/questions/6709/sshfs-mount-that-survives-disconnect SSHFS mount that survives disconnect| keep connection alive]&lt;br /&gt;
 The options ServerAliveInterval=5,ServerAliveCountMax=3 say that ssh checks every 5 seconds to see whether the remote server is still responding. &lt;br /&gt;
 If it does not receive a response after 3 of these checks, then it disconnects automatically. &lt;br /&gt;
 Thus any process waiting on this mount should hang about 15 seconds max.&lt;br /&gt;
 The options ConnectTimeout=3,ConnectionAttempts=1 are necessary because otherwise ssh will wait a very long time when attempting to reestablish connections, &lt;br /&gt;
 which again causes other processes to hang if they try to access the mount during this time.&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS SYSTEMSTART | /etc/fstab''' ====&lt;br /&gt;
 '''$ sshfs#Benutzername@irgendEinRechner:/pfad_auf_dem_server/ ~/fusessh fuse uid=1003,gid=100,umask=0,allow_other,_netdev 0 0'''&lt;br /&gt;
 &lt;br /&gt;
 '''$ sshfs#user@server:/remote/folder /local/mount/dir fuse IdentityFile=sshkeyfile,Port=XXX,allow_other,_netdev,ServerAliveInterval=45,ServerAliveCountMax=2,reconnect,noatime,auto 0 0 '''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs#user@server:/remote/folder /local/mount/dir fuse IdentityFile=sshkeyfile,Port=XXX,uid=1000,gid=1000,allow_other,_netdev,ServerAliveInterval=45,ServerAliveCountMax=2,reconnect,noatime,auto 0 0 '''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs#user@server:/remote/folder /local/mount/dir fuse delay_connect,IdentityFile=sshkeyfile,Port=XXX,uid=1000,gid=1000,allow_other,_netdev,ServerAliveInterval=45,ServerAliveCountMax=2,reconnect,noatime,auto 0 0 '''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS SHOW MOUNTS/CHECK MOUNTED | /etc/mtab''' ====&lt;br /&gt;
 '''$ mount'''&lt;br /&gt;
 '''$ cat /proc/mounts'''&lt;br /&gt;
 '''$ cat /etc/mtab'''&lt;br /&gt;
 '''$ cat /etc/mtab | grep fuse'''&lt;br /&gt;
 '''$ cat /etc/mtab | grep ssh'''&lt;br /&gt;
 '''$ findmnt'''&lt;br /&gt;
 '''$ findmnt | grep fuse'''&lt;br /&gt;
 '''$ findmnt | grep ssh'''&lt;br /&gt;
 '''$ df -h'''&lt;br /&gt;
 '''$ lsblk -f'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSH Port-Tunneling ''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''Local Forwarding'''===== &lt;br /&gt;
 '''$ ssh -i ~/.ssh/KEY -L 80:IP:80 user@IP -p 2000 '''&lt;br /&gt;
&lt;br /&gt;
===== '''Remote Forwarding'''===== &lt;br /&gt;
&lt;br /&gt;
===== '''Port Forwarding'''=====&lt;br /&gt;
&lt;br /&gt;
==== '''Reverse SSH Tunnel ''' ====&lt;br /&gt;
 ''Check for:''&lt;br /&gt;
 ''1. ServerAliveInterval(sshd_config)''&lt;br /&gt;
 ''2. autossh''&lt;br /&gt;
&lt;br /&gt;
 '''ssh -R 5001:localhost:22 -fN I'''P&lt;br /&gt;
&lt;br /&gt;
==== '''AutoSSH SSH Tunnel ''' ====&lt;br /&gt;
 '''$ autossh -NT -o &amp;quot;ExitOnForwardFailure=yes&amp;quot; -R 5001:localhost:6001 -l USER IP -p 7001 -i /home/USER/.ssh/KEY'''&lt;br /&gt;
&lt;br /&gt;
 '''$ autossh -N -f -i /home/&amp;lt;user&amp;gt;/.ssh/id_rsa -R 22222:localhost:22 &amp;lt;user&amp;gt;@&amp;lt;remote_host&amp;gt;'''&lt;br /&gt;
 '''-N:''' tell ssh to not execute any command, since we only use it for tunneling.&lt;br /&gt;
 '''-f:''' tell autossh to fall into background on start.&lt;br /&gt;
 '''-i:''' tell ssh to use the proper identity.&lt;br /&gt;
 '''-R''' 22222:localhost:22: &lt;br /&gt;
 reverse tunnel remote host's 22222 port to localhost's 22 port. &lt;br /&gt;
 So that we can use ssh -p 22222 localhost on remote host to ssh into local machine.&lt;br /&gt;
&lt;br /&gt;
 '''nano /etc/systemd/system/sshtunnel.service''' &lt;br /&gt;
&lt;br /&gt;
===== '''sshtunnel.service''' =====&lt;br /&gt;
&lt;br /&gt;
 '''[Unit]'''&lt;br /&gt;
 Description=AutoSSH tunnel service&lt;br /&gt;
 #After=network.target&lt;br /&gt;
 After=network-online.target ssh.service&lt;br /&gt;
 '''[Service]'''&lt;br /&gt;
 User=USER&lt;br /&gt;
 Environment=&amp;quot;AUTOSSH_GATETIME=0&amp;quot;&lt;br /&gt;
 RestartSec=30&lt;br /&gt;
 Restart=always&lt;br /&gt;
 ExecStart=/usr/bin/autossh -NT -o &amp;quot;ExitOnForwardFailure=yes&amp;quot; -R 5001:localhost:6000 -l USER IP -p 6001 -i /home/USER/.ssh/KEY&lt;br /&gt;
 ExecStop=pkill -s KILL autossh&lt;br /&gt;
 TimeoutStopSec=10&lt;br /&gt;
 '''[Install]'''&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
 '''systemctl status sshtunnel.service'''&lt;br /&gt;
 '''systemctl daemon-reload'''&lt;br /&gt;
 '''systemctl restart sshtunnel.service'''&lt;br /&gt;
 &lt;br /&gt;
 When using ssh multiplexing, killing the ssh process is often undesirable &lt;br /&gt;
 (it kills all open connections with that host), &lt;br /&gt;
 and you cannot easily access the escape because &amp;quot;escape not available to multiplexed sessions&amp;quot;. &lt;br /&gt;
 The right way is then to run the analogue of the forwarding command that you want to cancel, &lt;br /&gt;
 but adding -O cancel. For instance:&lt;br /&gt;
&lt;br /&gt;
 '''ssh -O cancel -L 5002:192.168.0.10:5002 192.168.178.100'''&lt;br /&gt;
&lt;br /&gt;
 This will disable this port forwarding without terminating the session. Again, this will only   &lt;br /&gt;
 work if ssh multiplexing is in use for the connection to 192.168.178.100&lt;br /&gt;
&lt;br /&gt;
 $ ssh -luser 192.xx.xxx.xx&lt;br /&gt;
&lt;br /&gt;
==== ''' ssh commands ''' ====&lt;br /&gt;
 $ ssh user@192.168.188.2 '[command]'&lt;br /&gt;
 $ ssh user@192.168.188.2 'ls -la /home/user'&lt;br /&gt;
 $ put&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== ''' ssh execute command ''' ====&lt;br /&gt;
 $ ssh user@ip 'ls -la'&lt;br /&gt;
&lt;br /&gt;
==== ''' ssh execute script ''' ====&lt;br /&gt;
&lt;br /&gt;
 $ ssh user@ip &amp;lt; script.sh&lt;br /&gt;
 $ ssh user@ip &amp;quot;bash -s&amp;quot; &amp;lt; script.sh&lt;br /&gt;
&lt;br /&gt;
==== ''' secure file transfer ''' ====&lt;br /&gt;
&lt;br /&gt;
===== ''' SCP file ''' =====&lt;br /&gt;
 $ pscp&lt;br /&gt;
&lt;br /&gt;
 # scp [source][destination]&lt;br /&gt;
 # destination ip:/path/&lt;br /&gt;
&lt;br /&gt;
 '''$ scp /test user@192.168.188.2:/home/user/test'''&lt;br /&gt;
 '''$ scp *.txt user@192.168.188.2:/home/user/txt'''&lt;br /&gt;
&lt;br /&gt;
 '''$ scp user@192.168.188.2:/home/user/txt.txt .'''&lt;br /&gt;
&lt;br /&gt;
[https://unix.stackexchange.com/a/748130/515538 How to copy files from one machine to another using ssh]&lt;br /&gt;
&lt;br /&gt;
===== ''' SCP folder ''' =====&lt;br /&gt;
&lt;br /&gt;
 '''$ scp -r /dir user@192.168.188.2:/home/user/dir '''&lt;br /&gt;
 '''$ scp -r /dir/* user@192.168.188.2:/home/user/dir '''&lt;br /&gt;
 '''$ scp -r user@192.168.188.2:/home/user/dir /home/dir'''&lt;br /&gt;
 '''$ scp -r user@192.168.188.2:/home/user/dir .'''&lt;br /&gt;
&lt;br /&gt;
===== ''' sftp ''' =====&lt;br /&gt;
 &lt;br /&gt;
===== ''' psftp ''' =====&lt;br /&gt;
&lt;br /&gt;
===== ''' ssh Jumphost ''' =====&lt;br /&gt;
#ssh jumphost&lt;br /&gt;
 PC-&amp;gt;Junphost-&amp;gt;IntServer&lt;br /&gt;
 PC-&amp;gt;Firewall-&amp;gt;IntServer&lt;br /&gt;
 ssh -J user@ip user@ip&lt;br /&gt;
&lt;br /&gt;
===== ''' ssh Multi-hop Tunnel ''' =====&lt;br /&gt;
 ssh -L8080:localhost:8080 user@host1&lt;br /&gt;
 SSH Tunnel with -t and -v (verbose)&lt;br /&gt;
&lt;br /&gt;
===== ''' ssh X11 Forwarding ''' =====&lt;br /&gt;
 '''$ ssh -X user@ip'''&lt;br /&gt;
 firefox &amp;amp; &lt;br /&gt;
&lt;br /&gt;
===== ''' ssh config file ''' =====&lt;br /&gt;
#ssh config file in .ssh/config&lt;br /&gt;
Host *&lt;br /&gt;
        User user&lt;br /&gt;
Host linuxhost&lt;br /&gt;
        HostName 192.168.188.2&lt;br /&gt;
        User user&lt;br /&gt;
        Port 2000&lt;br /&gt;
        IdentityFile ~/.ssh/mykey&lt;br /&gt;
&lt;br /&gt;
 ssh config file in /etc/ssh/ssh_config&lt;br /&gt;
&lt;br /&gt;
 debug modus&lt;br /&gt;
 $ ssh debianvm -v&lt;br /&gt;
&lt;br /&gt;
===== ''' ssh VNC|DISPLAY ''' =====&lt;br /&gt;
 ssh user @&amp;lt;ipadresse&amp;gt; &amp;quot;DISPLAY =:0 nohup firefox&amp;quot;&lt;br /&gt;
 ssh -i KEY -p XXXX user@x.x.x.x &amp;quot;DIS1PLAY =:0 nohup firefox&amp;quot;&lt;br /&gt;
 ssh -i KEY -p XXXX -X user@x.x.x.x&lt;br /&gt;
 ssh -i KEY -L 5901:127.0.0.1:5901 -C -N -l -p XXXX user@x.x.x.x&lt;br /&gt;
 ssh -i KEY -p XXXX -L 5901:127.0.0.1:5901 -C -N -l user x.x.x.x&lt;br /&gt;
&lt;br /&gt;
===== '''  socks proxy with google-authenticator!?  ''' =====&lt;br /&gt;
 # in SSHD FILE&lt;br /&gt;
 $ AuthenticationMethods publickey,keyboard-interactive&lt;br /&gt;
 $ nano /etc/pam.d/sshd 	&lt;br /&gt;
&lt;br /&gt;
 # google auth&lt;br /&gt;
 $auth required pam_google_authenticator.so &lt;br /&gt;
 $auth required pam_google_authenticator.so nullok&lt;br /&gt;
&lt;br /&gt;
ssh socks reverse&lt;br /&gt;
&lt;br /&gt;
'''Das ClientAlive-Mechanismus''' in SSH dient dazu, festzustellen, ob der Client noch verbunden ist, auch wenn keine Aktivität (Datenübertragung) stattfindet. Es unterscheidet sich von der Shell-Variable TMOUT, die Nutzer nach einer bestimmten Inaktivität abmeldet.&lt;br /&gt;
&lt;br /&gt;
    ClientAliveInterval und ClientAliveCountMax: Konfigurieren, wie oft der Server überprüft, ob der Client noch da ist.&lt;br /&gt;
    TCP Keepalive: Allgemeiner Mechanismus, um zu erkennen, ob Verbindungen tot sind und sie am Leben zu halten, besonders bei NAT-Routern.&lt;br /&gt;
    Inaktivität in der Shell (z.B. keine Eingaben) beeinflusst nicht die automatische Antwort des Clients auf Alive-Nachrichten.&lt;br /&gt;
    2023: Neue Optionen ChannelTimeout und UnusedConnectionTimeout in sshd_config eingeführt, um ungenutzte Verbindungen zu beenden.&lt;br /&gt;
&lt;br /&gt;
Tabelle&lt;br /&gt;
Option	Beschreibung&lt;br /&gt;
ClientAliveInterval	Intervall, in dem der Server Alive-Nachrichten sendet.&lt;br /&gt;
ClientAliveCountMax	Anzahl der fehlenden Antworten, bevor die Verbindung als tot betrachtet wird.&lt;br /&gt;
ServerAliveInterval	Intervall, in dem der Client Alive-Nachrichten sendet.&lt;br /&gt;
ServerAliveCountMax	Anzahl der fehlenden Antworten, bevor der Client die Verbindung trennt.&lt;br /&gt;
TCP Keepalive	Verhindert, dass Router NAT-Verbindungen als inaktiv betrachten.&lt;br /&gt;
TMOUT	Shell-Variable, die inaktive Nutzer abmeldet.&lt;br /&gt;
ChannelTimeout (ab 2023)	Timeout für inaktive SSH-Kanäle.&lt;br /&gt;
UnusedConnectionTimeout	Timeout für ungenutzte SSH-Verbindungen.&lt;br /&gt;
&lt;br /&gt;
ClientAliveInterval und ClientAliveCountMax&lt;br /&gt;
&lt;br /&gt;
    Zweck: Dient dazu, festzustellen, ob der Client noch aktiv ist. Der Server sendet Alive-Nachrichten, und wenn der Client nicht antwortet, wird die Verbindung getrennt.&lt;br /&gt;
    Vorteil: Nützlich, um Verbindungsprobleme festzustellen, z.B. bei einem plötzlich abgestürzten Client oder einer unterbrochenen Netzwerkverbindung.&lt;br /&gt;
    Anwendung: Gut, wenn du sicherstellen willst, dass Verbindungen aktiv bleiben und nicht durch Netzwerkprobleme oder Client-Abstürze blockiert werden.&lt;br /&gt;
&lt;br /&gt;
ChannelTimeout und UnusedConnectionTimeout (ab 2023)&lt;br /&gt;
&lt;br /&gt;
    Zweck: Diese Optionen zielen darauf ab, ungenutzte oder inaktive SSH-Kanäle bzw. Verbindungen zu beenden. Sie berücksichtigen, ob tatsächlich Aktivitäten über die Kanäle stattfinden.&lt;br /&gt;
    Vorteil: Effizienter, um Verbindungen zu schließen, die zwar noch offen sind, aber keine Daten mehr übertragen. Diese Optionen sind gezielter auf Inaktivität in Bezug auf tatsächliche Nutzung.&lt;br /&gt;
    Anwendung: Nützlich, wenn du Verbindungen beenden willst, die einfach offen bleiben, aber nicht aktiv genutzt werden, z.B. bei Portweiterleitungen, die nicht mehr verwendet werden.&lt;br /&gt;
&lt;br /&gt;
Alles zusammen verwenden?&lt;br /&gt;
&lt;br /&gt;
    Sinnvoll?: Ja, wenn du sowohl sicherstellen möchtest, dass Verbindungen aktiv sind (ClientAliveInterval/CountMax), als auch inaktive Kanäle oder Verbindungen schließt (ChannelTimeout/UnusedConnectionTimeout).&lt;br /&gt;
    Anwendung: Wenn du eine robustere Kontrolle über die SSH-Verbindung wünschst, kannst du beide Mechanismen kombinieren, um einerseits abgebrochene Verbindungen zu erkennen und andererseits ungenutzte Verbindungen zu schließen.&lt;br /&gt;
&lt;br /&gt;
Fazit:&lt;br /&gt;
&lt;br /&gt;
    Nur ClientAliveInterval/CountMax: Wenn du nur sicherstellen willst, dass abgebrochene Verbindungen erkannt werden.&lt;br /&gt;
    Nur ChannelTimeout/UnusedConnectionTimeout: Wenn du hauptsächlich ungenutzte Verbindungen automatisch beenden willst.&lt;br /&gt;
    Beide zusammen: Optimale Kontrolle über die Verbindungsstabilität und das automatische Schließen inaktiver Verbindungen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
s geht um die Konfiguration von SSH-Verbindungen, insbesondere um das ClientAlive-Mechanismus, der dafür sorgt, dass SSH-Verbindungen nicht unbegrenzt offen bleiben, wenn sie nicht aktiv sind. Zusätzlich wird erklärt, wie man TCPKeepAlive und systemweite TCP-Einstellungen anpasst. Wenn keine Anpassung möglich ist, wird empfohlen, den SSH-Prozess manuell zu beenden.&lt;br /&gt;
&lt;br /&gt;
    ClientAliveInterval und ClientAliveCountMax: Server sendet Alive-Nachrichten, um festzustellen, ob der Client noch reagiert.&lt;br /&gt;
    TCPKeepAlive: Systemweite TCP-Einstellung, die Verbindungen auf lebendig prüft.&lt;br /&gt;
    Manuelles Beenden: Auf dem Client SSH beenden, um Portweiterleitungen zu unterbrechen.&lt;br /&gt;
    Script: Ein Beispielskript zum Beenden der SSH-Verbindung und Einrichten eines neuen Tunnels.&lt;br /&gt;
&lt;br /&gt;
Tabelle&lt;br /&gt;
Option	Beschreibung&lt;br /&gt;
ClientAliveInterval	Intervall, in dem der Server Alive-Nachrichten sendet (Standard: 0 = deaktiviert).&lt;br /&gt;
ClientAliveCountMax	Anzahl der ausstehenden Nachrichten, bevor die Verbindung getrennt wird.&lt;br /&gt;
TCPKeepAlive	Allgemeine TCP-Einstellung, um zu überprüfen, ob eine Verbindung noch aktiv ist.&lt;br /&gt;
ServerAliveInterval	Ähnlich wie ClientAlive, aber für den Client, um Verbindungsabbrüche zu erkennen.&lt;br /&gt;
SSH-Skript	Skript, um SSH-Tunnel manuell zu beenden und neu zu starten.&lt;br /&gt;
&lt;br /&gt;
[https://unix.stackexchange.com/a/796924/342980 SSH AuthenticationMethods for publickey]&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Bash&amp;diff=1154</id>
		<title>Bash</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Bash&amp;diff=1154"/>
		<updated>2025-02-22T12:30:03Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://unix.stackexchange.com/q/740146/342980 How can I restore my default .bashrc file again?]&lt;br /&gt;
&lt;br /&gt;
[https://unix.stackexchange.com/q/749678/342980 Do I need both /boot and /boot/efi?]&lt;br /&gt;
&lt;br /&gt;
[https://unix.stackexchange.com/q/751942/342980 eep the PC in low power, but not sleeping]&lt;br /&gt;
&lt;br /&gt;
[https://unix.stackexchange.com/q/782971/342980 Is it safe to install programs other than with a distro's package manager?]&lt;br /&gt;
&lt;br /&gt;
[https://unix.stackexchange.com/q/785544/342980 How to know if the network is configured through /etc/network/interfaces, NetworkManager, Systemd or Netplan?]&lt;br /&gt;
&lt;br /&gt;
== Script ==&lt;br /&gt;
 '''$ type script'''&lt;br /&gt;
 '''$ chmod +x script'''&lt;br /&gt;
 '''$ ./script'''&lt;br /&gt;
 '''$ .script'''&lt;br /&gt;
 '''$ source script'''&lt;br /&gt;
 '''$ bash script'''&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
&lt;br /&gt;
== Command Line ==&lt;br /&gt;
 '''Everything is a file'''&lt;br /&gt;
 '''255 Byte'''&lt;br /&gt;
 The maximum length for a file name is 255 bytes.&lt;br /&gt;
 The maximum combined length of both the file name and path name is 4096 bytes.&lt;br /&gt;
 This length matches the PATH_MAX that is supported by the operating system.&lt;br /&gt;
 '''Names are case-sensitive'''&lt;br /&gt;
&lt;br /&gt;
==== Special chars to avoid in names/filenames ====&lt;br /&gt;
 /   Never&lt;br /&gt;
 \   Escaped&lt;br /&gt;
 -   Never at beginning&lt;br /&gt;
 []  Escaped&lt;br /&gt;
 {}  Escaped&lt;br /&gt;
 *   Escaped&lt;br /&gt;
 '   Escaped&lt;br /&gt;
 &amp;quot;   Escaped&lt;br /&gt;
&lt;br /&gt;
==== Wildcards ====&lt;br /&gt;
 '''*'''  asterisk        | any char&lt;br /&gt;
 '''?'''  question mark   | single char&lt;br /&gt;
 '''[]''' square brackets | set of single char or a range of chars&lt;br /&gt;
&lt;br /&gt;
==== List files and folders ====&lt;br /&gt;
 '''$ ls'''&lt;br /&gt;
 '''$ ls folder'''&lt;br /&gt;
 '''$ ls ./folder'''&lt;br /&gt;
 '''$ ls /path/folder'''&lt;br /&gt;
 '''$ ls ~/folder'''&lt;br /&gt;
 '''$ ls ~/folder/*.jpg'''&lt;br /&gt;
 '''$ ls ~/folder/*txt*'''&lt;br /&gt;
 '''$ ls -R folder''' (list of subfolders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -l''' (single column)&lt;br /&gt;
  '''-''' regular file&lt;br /&gt;
  '''_''' executable&lt;br /&gt;
  '''d''' directory&lt;br /&gt;
  '''l''' symbolic link&lt;br /&gt;
  '''s''' socket&lt;br /&gt;
  '''b''' block device&lt;br /&gt;
  '''c''' character device&lt;br /&gt;
  '''p''' named pipe&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -m''' (comma-separated list)&lt;br /&gt;
 '''$ ls -a''' (hidden files and folders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -F''' (file type)&lt;br /&gt;
 Symbols and file types&lt;br /&gt;
  '''*''' Executable&lt;br /&gt;
  '''/''' Directory&lt;br /&gt;
  '''@''' Symbolic link&lt;br /&gt;
  '''|''' FIFO&lt;br /&gt;
  '''=''' Socket&lt;br /&gt;
&lt;br /&gt;
 '''$ ls --color (content in color)'''&lt;br /&gt;
 '''$ dircolors'''&lt;br /&gt;
 '''$ dircolors --print-database'''&lt;br /&gt;
 '''$ ls -F --color'''&lt;br /&gt;
 '''$ la -la'''&lt;br /&gt;
 '''$ ls -r'''&lt;br /&gt;
 '''$ ls -X''' (sort by extension)&lt;br /&gt;
 '''$ ls -t''' (sort by date)&lt;br /&gt;
 '''$ ls -S''' (sort by content)&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
 '''$ ls -laS'''&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
&lt;br /&gt;
 '''$ pwd''' (current path)&lt;br /&gt;
&lt;br /&gt;
==== Change directory with '''cd'''====&lt;br /&gt;
 '''$ cd folder'''&lt;br /&gt;
 '''$ cd ~'''&lt;br /&gt;
 '''$ cd -'''&lt;br /&gt;
 '''$ cd ..'''&lt;br /&gt;
&lt;br /&gt;
==== Create and change current time of file '''touch'''====&lt;br /&gt;
 create new, empty file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 update access and modification time for file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 any desired time for file&lt;br /&gt;
 '''$ touch -t [[CC]YY]MMDDhhmm[.ss]file'''&lt;br /&gt;
&lt;br /&gt;
==== Create directory with '''mkdir'''====&lt;br /&gt;
 new directory&lt;br /&gt;
 '''$ mkdir folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory with subdirectories&lt;br /&gt;
 '''$ mkdir -p test/sub/folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory and show steps&lt;br /&gt;
 '''$ mkdir -v test/sub/folder'''&lt;br /&gt;
 '''$ mkdir -pv test/sub/folder'''&lt;br /&gt;
 &lt;br /&gt;
== Count files and directories, summary size and '''EXCLUDE''' folders ==&lt;br /&gt;
'''[https://unix.stackexchange.com/q/691703/515538 '''bash count files and directory, summary size and EXCLUDE folders that are fuse|sshfs''']'''&lt;br /&gt;
&lt;br /&gt;
==== Full size of a folder with '''du'''====&lt;br /&gt;
 get the full size of workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs workdir'''&lt;br /&gt;
&lt;br /&gt;
 get the full size of workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs --exclude=mysshf workdir'''&lt;br /&gt;
&lt;br /&gt;
==== Count files in folder with '''find'''====&lt;br /&gt;
 count files in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune -o \( -type f -print \) | wc -l'''&lt;br /&gt;
&lt;br /&gt;
==== Count folders in folder with '''find'''====&lt;br /&gt;
 count folders in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune \( -type d -print \)  | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Building blocks ==&lt;br /&gt;
&lt;br /&gt;
==== run several commands sequentially with ''';''' and '''&amp;amp;&amp;amp;''' ====&lt;br /&gt;
 executed sequential no matter if successfully or unsucessfully&lt;br /&gt;
 ''';'''&lt;br /&gt;
 '''$ ls /home ; ls notfound; ls ~'''&lt;br /&gt;
&lt;br /&gt;
 executed sequential if successfully run next&lt;br /&gt;
 '''&amp;amp;&amp;amp;'''&lt;br /&gt;
 '''$ ls /home &amp;amp;&amp;amp; ls notfound &amp;amp;&amp;amp; ls ~'''&lt;br /&gt;
&lt;br /&gt;
== PORT SCAN with bash's built-in /dev/tcp ==&lt;br /&gt;
'''check if host response on a give port with bash's built-in /dev/tcp'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 HOST_PORT=&amp;quot;80&amp;quot;&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 exit; '''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 for HOST_PORT in {1..1000}&lt;br /&gt;
 do&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 declare -A PORT_ON&lt;br /&gt;
 for HOST_PORT in {1..65535}&lt;br /&gt;
 do&lt;br /&gt;
    if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
        PORT_ON[${HOST_PORT}]=&amp;quot;ON&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
 done&lt;br /&gt;
 for i in ${!PORT_ON[*]}&lt;br /&gt;
 do&lt;br /&gt;
    echo -e &amp;quot;$i : ${PORT_ON[$i]}&amp;quot;&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
== watch ==&lt;br /&gt;
&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo&amp;quot;'''&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
== Firefox bash output ==&lt;br /&gt;
&lt;br /&gt;
 For the usage in bash:&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -d -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
 Load a page and press F5 in the tab(again and again or hold the F5 button pressed) and watch&lt;br /&gt;
 When i kill the a tab with the right pid i get the message in the tab, that the tab is crashed now&lt;br /&gt;
 &lt;br /&gt;
 ''' In Firefox, about:performance'''&lt;br /&gt;
&lt;br /&gt;
 But check also this in bash if i close or open and load a page tab:&lt;br /&gt;
 '''$ pidof firefox'''&lt;br /&gt;
 '''$ pidof firefox-esr'''&lt;br /&gt;
 '''$ pgrep firefox get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
 '''$ pgrep firefox-esr get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
&lt;br /&gt;
 Get parentid and childid&lt;br /&gt;
 '''$ ps aux | grep [f]irefox'''&lt;br /&gt;
 '''$ ps aux | grep [f]irefox | grep tab'''&lt;br /&gt;
&lt;br /&gt;
 You see the parentBuildID and something of the child/tab&lt;br /&gt;
 It looks like that you can't close the child/tab only the parentBuildID, if you kill the child/tab the tab will crash but not close(but killed).&lt;br /&gt;
&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | wc -l'''&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | grep tab | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Create Symbolic Links ==&lt;br /&gt;
 [https://man7.org/linux/man-pages/man1/ln.1.html ln|Linux manual page]&lt;br /&gt;
 ''Symlink To a File''&lt;br /&gt;
 '''$ ln -s [OPTIONS] TARGET LINKNAME'''&lt;br /&gt;
 '''$ ln -s TARGET LINK_NAME''' &lt;br /&gt;
&lt;br /&gt;
 ''Symlinks To a Directory''&lt;br /&gt;
 '''$ ln -s /mnt/my_drive/movies ~/my_movies '''&lt;br /&gt;
&lt;br /&gt;
 ''Overwriting Symlinks''&lt;br /&gt;
 ''To overwrite the destination path of the symlink, use the -f (--force) option''&lt;br /&gt;
 '''$ ln -sf my_file.txt my_link.txt'''&lt;br /&gt;
&lt;br /&gt;
 ''Removing Symlinks ''&lt;br /&gt;
 '''$ unlink symlink_to_remove'''&lt;br /&gt;
 '''$ rm symlink_to_remove'''&lt;br /&gt;
&lt;br /&gt;
== List harddisk|usb|volume|partitions  ==&lt;br /&gt;
 ''Get label names:''&lt;br /&gt;
 '''$ e2label /dev/sdXx '''&lt;br /&gt;
 '''$ /sbin/blkid | grep sdXx''''&lt;br /&gt;
 '''$ blkid /dev/sdXx | awk -F'&amp;quot;' '{print $2}''''&lt;br /&gt;
&lt;br /&gt;
 ''Set label name:''&lt;br /&gt;
 '''$ e2label /dev/sdXx MYNAME'''&lt;br /&gt;
 '''$ tune2fs -L MYNAME /dev/sdXx '''&lt;br /&gt;
&lt;br /&gt;
== Create filesystem with '''mkfs.ext4'''  ==&lt;br /&gt;
 '''$ mkfs.ext4 /dev/sda1 -L MYNAME'''&lt;br /&gt;
&lt;br /&gt;
== Create/Add new USER '''useradd'''==&lt;br /&gt;
 Useradd is built-in Linux command that can be found on any Linux system. However, creating new users with this low-level is a tedious task because it doesn't create the home directory and user password by default.&lt;br /&gt;
&lt;br /&gt;
 Adduser is not a standard Linux command. It’s essentially a Perl script that uses the useradd command in the background. This high-level utility  is more efficient in properly creating new users on Linux. It gives you the option to create the home directory, and set password along with a few more parameters.&lt;br /&gt;
&lt;br /&gt;
 [https://linuxhandbook.com/useradd-vs-adduser/ Difference between adduser and useradd commands]&lt;br /&gt;
 [https://linuxconfig.org/add-user-linux-command adduser vs useradd in Linux] &lt;br /&gt;
&lt;br /&gt;
 '''$ useradd [OPTIONS] USERNAME'''&lt;br /&gt;
&lt;br /&gt;
 '''$ cat /etc/default/useradd'''&lt;br /&gt;
 '''$ ls -la /etc/skel/'''&lt;br /&gt;
 '''$ cat /etc/login.defs'''&lt;br /&gt;
&lt;br /&gt;
 View default options:&lt;br /&gt;
 '''$ useradd -D '''&lt;br /&gt;
&lt;br /&gt;
 Change the default login shell&lt;br /&gt;
 '''$ useradd -D -s /bin/bash '''&lt;br /&gt;
 '''$ useradd -D | grep -i shell '''&lt;br /&gt;
&lt;br /&gt;
 To create a user without home directory&lt;br /&gt;
 '''$ useradd -M user '''&lt;br /&gt;
&lt;br /&gt;
 Create a user with changed login shell &lt;br /&gt;
 '''$ useradd -s /bin/sh user '''&lt;br /&gt;
&lt;br /&gt;
 Option to create a user home directory &lt;br /&gt;
 '''--create-home'''&lt;br /&gt;
 '''-m '''&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -m -u 10000 USERNAME -s /bin/bash '''&lt;br /&gt;
&lt;br /&gt;
 There is an option for adding an encrypted password via the '''-p''' option on useradd&lt;br /&gt;
 Note that the '''-p''' option '''doesn't allow you to input a plaintext password''', it expects you to  encrypt it first. &lt;br /&gt;
 This is intentionally difficult, because you should not do it! &lt;br /&gt;
 Just use the '''passwd''' command or '''chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 '''passwd USER'''&lt;br /&gt;
 or&lt;br /&gt;
 '''echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 [https://stackoverflow.com/questions/2150882/how-to-automatically-add-user-account-and-password-with-a-bash-script How to automatically add user account AND password with a Bash script?]&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER'''&lt;br /&gt;
 Create USER + Homedirectory + Bash as Shell&lt;br /&gt;
&lt;br /&gt;
 USER+HOME+SHELL+PASSWORD&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER &amp;amp;&amp;amp; echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
== Delete USER '''userdel'''==&lt;br /&gt;
 '''$ userdel [OPTIONS] USERNAME '''&lt;br /&gt;
&lt;br /&gt;
 Use the -r (--remove) option to force userdel to remove the user’s home directory and mail spool:&lt;br /&gt;
 '''$ userdel -r username '''&lt;br /&gt;
&lt;br /&gt;
 Kill all user’s running processes&lt;br /&gt;
 '''$ killall -u username '''&lt;br /&gt;
&lt;br /&gt;
 Another option is to use the -f (--force) option that tells userdel to forcefully remove the user account, even if the user is still logged in or if there are running processes that belong to the user.&lt;br /&gt;
 '''$ userdel -f username '''&lt;br /&gt;
&lt;br /&gt;
[https://linuxize.com/post/how-to-delete-users-in-linux-using-the-userdel-command/ How to Delete/Remove Users in Linux (userdel Command)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''usermod'''==&lt;br /&gt;
&lt;br /&gt;
https://linuxize.com/post/usermod-command-in-linux/#:~:text=By%20default%2C%20on%20most%20Linux%20systems%2C%20the%20default,name%20of%20the%20user%3A%20usermod%20-s%20SHELL%20USER&lt;br /&gt;
&lt;br /&gt;
https://linuxconfig.org/usermod#:~:text=usermod%20command%20in%20Linux%20Advanced%20Examples%201%20Use,given%20a%20unique%20ID%20when%20first%20created.%20&lt;br /&gt;
&lt;br /&gt;
https://wiki.ubuntuusers.de/usermod/&lt;br /&gt;
&lt;br /&gt;
== '''GROUP, USER | GROUP VS PASSWD''' ==&lt;br /&gt;
&lt;br /&gt;
 https://teaching.idallen.com/cst8207/12f/notes/600_users_and_groups.html&lt;br /&gt;
&lt;br /&gt;
 https://www.unix.com/unix-for-dummies-questions-and-answers/162563-inconsistency-between-passwd-group.html&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/55107/why-dont-etc-group-and-etc-password-match&lt;br /&gt;
&lt;br /&gt;
 https://www.man7.org/linux/man-pages/man3/initgroups.3.html&lt;br /&gt;
&lt;br /&gt;
== chown ==&lt;br /&gt;
&lt;br /&gt;
 https://wiki.ubuntuusers.de/chown/&lt;br /&gt;
&lt;br /&gt;
== chmod ==&lt;br /&gt;
&lt;br /&gt;
 https://wiki.ubuntuusers.de/chmod/&lt;br /&gt;
&lt;br /&gt;
== chattr ==&lt;br /&gt;
 &lt;br /&gt;
 https://wiki.ubuntuusers.de/chattr/&lt;br /&gt;
&lt;br /&gt;
 https://man7.org/linux/man-pages/man1/chattr.1.html&lt;br /&gt;
&lt;br /&gt;
== SHELL USER INFOS ==&lt;br /&gt;
&lt;br /&gt;
 '''getent passwd &amp;quot;$LOGNAME&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
 '''grep passwd /etc/nsswitch.conf'''&lt;br /&gt;
&lt;br /&gt;
== rbash | Restricted Bash ==&lt;br /&gt;
 '''$ rbash '''&lt;br /&gt;
 '''$ bash -r'''&lt;br /&gt;
&lt;br /&gt;
 https://www.tecmint.com/rbash-a-restricted-bash-shell-explained-with-practical-examples/&lt;br /&gt;
 https://www.thegeekdiary.com/rbash-set-restricted-shell-in-linux/&lt;br /&gt;
&lt;br /&gt;
 https://www.howtogeek.com/718074/how-to-use-restricted-shell-to-limit-what-a-linux-user-cando/&lt;br /&gt;
 https://ostechnix.com/how-to-limit-users-access-to-the-linux-system/&lt;br /&gt;
 https://averagelinuxuser.com/creating-new-user-linux/&lt;br /&gt;
 https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/&lt;br /&gt;
 https://www.howtoforge.com/user_password_creating_with_a_bash_script&lt;br /&gt;
&lt;br /&gt;
== Simple Script Jail ==&lt;br /&gt;
&lt;br /&gt;
 This is are the default settings for the USER to login and run a bash shell:&lt;br /&gt;
 '''$  chsh -s /bin/bash [USER] ''' &lt;br /&gt;
 &lt;br /&gt;
 This for the simple jail:&lt;br /&gt;
 '''$ chsh -s /home/[USER]/./run [USER] '''&lt;br /&gt;
&lt;br /&gt;
== Disable history ==&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-bash-shell-commands-history-on-linux&lt;br /&gt;
 https://www.cyberciti.biz/faq/disable-bash-shell-history-linux/&lt;br /&gt;
 https://www.thegeeksearch.com/how-to-disable-and-clear-linux-command-line-history/&lt;br /&gt;
&lt;br /&gt;
== Disable LASTLOGIN ==&lt;br /&gt;
 '''$ touch /home/user/.hushlogin'''&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-last-login-message-on-rhel-linux&lt;br /&gt;
 https://www.heatware.net/linux-unix/linux-how-to-disable-last-login-welcome-message/&lt;br /&gt;
&lt;br /&gt;
== type | command check ==&lt;br /&gt;
&lt;br /&gt;
 Check whether a command is built-in or not&lt;br /&gt;
 '''$ type [COMMAND]'''&lt;br /&gt;
&lt;br /&gt;
== RANDOM NUMBERS ==&lt;br /&gt;
 '''$ echo $RANDOM'''&lt;br /&gt;
 '''$ echo $(( $RANDOM % 9 + 0 ))'''&lt;br /&gt;
&lt;br /&gt;
 '''$ echo $(shuf -i 0-9 -n1)'''&lt;br /&gt;
&lt;br /&gt;
 '''$ od /dev/urandom  -A n -t d -N 1 '''&lt;br /&gt;
&lt;br /&gt;
 https://linuxhint.com/generate-random-number-bash/&lt;br /&gt;
 https://linuxconfig.org/generating-random-numbers-in-bash-with-examples&lt;br /&gt;
 https://www.delftstack.com/howto/linux/random-number-generation-in-bash/&lt;br /&gt;
&lt;br /&gt;
== RANDOM STRINGS ==&lt;br /&gt;
 '''$ echo $RANDOM | md5sum | head -c 1; echo; ''' &lt;br /&gt;
 '''$ tr -dc A-Za-z0-9 &amp;lt;/dev/urandom | head -c 1 ; echo ' ' '''&lt;br /&gt;
&lt;br /&gt;
 https://gist.github.com/earthgecko/3089509&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/230673/how-to-generate-a-random-string&lt;br /&gt;
 https://linuxhint.com/generate-random-string-bash/&lt;br /&gt;
 https://www.saotn.org/bash-function-to-generate-a-random-alphanumeric-string/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/a/709895/515538&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/747546/dhcpd-or-dhclient-not-found#comment1421782_747546&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/747014/command-to-check-if-the-machine-was-rebooted#comment1420778_747014&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/745582/block-every-website-but-one-specific-one#comment1418071_745582&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/745375/what-does-run-rm-rf-do-in-dockerfile#comment1417469_745375&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/741540/setting-alias-for-sourcing-a-script-to-run-that-script-in-jenkins-with-restrict/741545#comment1408882_741545&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/741028/how-do-i-create-a-copy-of-a-hard-drive-on-my-pc#comment1407651_741028&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/740700/how-to-restrict-ssh-for-specific-user-from-specific-subnet#comment1406816_740700&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/740606/migration-of-a-working-debian-11-system-to-another/740612#comment1406640_740612&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/740105/cannot-figure-out-how-to-turn-off-stricthostkeychecking/740107#comment1405529_740107&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/734385/remove-directory-failed-even-as-root#comment1393984_734385&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/715772/how-to-create-a-hash-sha256sum-in-bash-with-more-than-one-source-input-and-w#comment1356335_715772&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/13802/execute-a-specific-command-in-a-given-directory-without-cding-to-it/709871#comment1344018_709871&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/693566/how-can-i-determine-which-browser-tab-is-the-most-network-intensive/693588#comment1311841_693588&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/693006/what-are-these-unexpected-network-devices-which-appear-in-kernel-log/693011#comment1310798_693011&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Ssh&amp;diff=1153</id>
		<title>Ssh</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Ssh&amp;diff=1153"/>
		<updated>2024-10-09T10:02:53Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==== ''' AUTHOR | HACKBUGZ ''' ====&lt;br /&gt;
 [https://stackexchange.com/users/23684174/hackbugz?tab=accounts StackExchange | HACKBUGZ]&lt;br /&gt;
 [https://www.tiktok.com/@hackbugz? TIKTOK | HACKBUGZ]&lt;br /&gt;
&lt;br /&gt;
==== ''' Links ''' ====&lt;br /&gt;
 [https://linux.die.net/man/1/sshfs sshfs(1) - Linux man page]&lt;br /&gt;
 [https://wiki.ubuntuusers.de/FUSE/sshfs/ wiki.ubuntuusers.de FUSE/SSHFS]&lt;br /&gt;
 [https://wiki.ubuntuusers.de/FUSE/ wiki.ubuntuusers.de FUSE]  &lt;br /&gt;
&lt;br /&gt;
 [https://www.ssh.com/iam/ssh-key-management/ SSH Key Management]&lt;br /&gt;
 [https://www.ssh.com/ssh/authorized_keys/ Authorized_keys file in SSH]&lt;br /&gt;
 [https://unix.stackexchange.com/questions/208960/how-to-restrict-a-user-to-one-folder-and-not-allow-them-to-move-out-his-folder How to restrict a user to one folder and not allow them to move out his folder - Unix &amp;amp; Linux Stack Exchange]&lt;br /&gt;
 [https://www.tecmint.com/restrict-ssh-user-to-directory-using-chrooted-jail/ Restrict SSH User Access to Certain Directory Using Chrooted Jail]&lt;br /&gt;
 [https://www.cyberciti.biz/faq/debian-ubuntu-restricting-ssh-user-session-to-a-directory-chrooted-jail/ Debian/Ubuntu Linux: Restrict an SSH user session to a specific directory by setting chrooted jail - nixCraft]&lt;br /&gt;
 [https://wiki.archlinux.org/index.php/SSHFS SSHFS - ArchWiki]&lt;br /&gt;
&lt;br /&gt;
 [https://askubuntu.com/questions/48129/how-to-create-a-restricted-ssh-user-for-port-forwarding security - How to create a restricted SSH user for port forwarding? - Ask Ubuntu]&lt;br /&gt;
 [https://www.linux-magazin.de/ausgaben/2018/08/einfuehrung-2-5/ Aus dem Alltag eines Sysadmin: Reverse-SSH-Tunnel und Autossh]&lt;br /&gt;
 [https://www.howtogeek.com/428413/what-is-reverse-ssh-tunneling-and-how-to-use-it/ What Is Reverse SSH Tunneling? (and How to Use It)]&lt;br /&gt;
 [https://unix.stackexchange.com/questions/100859/ssh-tunnel-without-shell-on-ssh-server ssh tunneling - SSH: tunnel without shell on ssh server - Unix &amp;amp; Linux Stack Exchange]&lt;br /&gt;
 [https://serverfault.com/questions/56566/ssh-tunneling-only-access linux - ssh tunneling only access - Server Fault]&lt;br /&gt;
 [https://www.it-react.com/index.php/2020/01/06/how-to-setup-reverse-ssh-tunnel-on-linux/ How to Setup Reverse SSH Tunnel on Raspberry Pi behind a 3G USB stick modem - IT-REACT]&lt;br /&gt;
 [https://dev.to/bulletmark/create-a-reverse-ssh-tunnel-for-remote-access-to-a-restricted-machine-1ma0 Create a reverse SSH tunnel for remote access to a restricted Linux machine - DEV Community]&lt;br /&gt;
 [https://unix.stackexchange.com/questions/55106/disable-user-shell-for-security-reasons https://unix.stackexchange.com/questions/55106/disable-user-shell-for-security-reasons]&lt;br /&gt;
 [https://www.everythingcli.org/ssh-tunnelling-for-fun-and-profit-autossh/ SSH tunnelling for fun and profit: Autossh]&lt;br /&gt;
 [https://man7.org/linux/man-pages/man1/ssh-keygen.1.html ssh-keygen(1) - Linux manual page]&lt;br /&gt;
 [https://unix.stackexchange.com/questions/128894/ssh-exchange-identification-connection-closed-by-remote-host-not-using-hosts-d linux - ssh_exchange_identification: Connection closed by remote host (not using hosts.deny) - Unix &amp;amp; Linux Stack Exchange]&lt;br /&gt;
&lt;br /&gt;
 [https://github.com/szmi Miklos Szeredi | github]&lt;br /&gt;
 [https://indico.cern.ch/event/608592/contributions/2830117/attachments/1592339/2520491/Evolution_of_FUSE_and_OverlayFS.pdf  Evolution of FUSE and OverlayFS | Miklos Szeredi]&lt;br /&gt;
&lt;br /&gt;
 [https://explainshell.com/explain?cmd=ssh+-L+-N+-f+-l+-R+-i+-1 explainshell]&lt;br /&gt;
 [https://wiki.ubuntuusers.de/Screen/ Screen]&lt;br /&gt;
 [https://wiki.ubuntuusers.de/nohup/ nohup]&lt;br /&gt;
 [https://linuxcommand.org/lc3_man_pages/ssh1.html linuxcommand ssh1]&lt;br /&gt;
 open ip&lt;br /&gt;
&lt;br /&gt;
SSHFS und FUSE sind zwei verschiedene Dinge, die jedoch eng miteinander verwandt sind.&lt;br /&gt;
&lt;br /&gt;
FUSE (Filesystem in Userspace) ist ein Framework für das Betriebssystem Linux, das es ermöglicht, Dateisysteme in Benutzermodus-Programmen zu implementieren, anstatt diese im Kernelmodus implementieren zu müssen. Durch die Verwendung von FUSE können Benutzermodus-Programme wie SSHFS auf einfache Weise ein Dateisystem erstellen, das wie ein herkömmliches Dateisystem gemountet werden kann.&lt;br /&gt;
&lt;br /&gt;
SSHFS (SSH Filesystem) ist eine Erweiterung des FUSE-Frameworks, mit der man ein Dateisystem über SSH mounten kann. Das bedeutet, dass man über eine sichere Verbindung (SSH) auf Dateien und Verzeichnisse auf einem entfernten System zugreifen kann, als wären sie auf dem eigenen Computer vorhanden.&lt;br /&gt;
&lt;br /&gt;
Zusammenfassend kann man sagen, dass FUSE ein Framework ist, das es ermöglicht, Dateisysteme in Benutzermodus-Programmen zu implementieren, während SSHFS eine Anwendung ist, die FUSE verwendet, um ein Dateisystem über SSH zu mounten.&lt;br /&gt;
&lt;br /&gt;
SFTP und SSHFS sind ähnliche Technologien, die beide eine sichere Möglichkeit bieten, auf entfernte Dateien und Verzeichnisse zuzugreifen. Beide basieren auf dem SSH-Protokoll, das eine sichere Verschlüsselung der Datenübertragung ermöglicht. Der Hauptunterschied zwischen SFTP und SSHFS liegt jedoch in der Art und Weise, wie sie die Remote-Dateisysteme bereitstellen.&lt;br /&gt;
&lt;br /&gt;
SFTP (Secure File Transfer Protocol) ist ein Dateiübertragungsprotokoll, das auf dem SSH-Protokoll basiert und es ermöglicht, Dateien zwischen lokalen und entfernten Systemen zu übertragen. SFTP bietet jedoch keine Möglichkeit, ein entferntes Dateisystem zu mounten. Stattdessen bietet SFTP einen Dateizugriff über eine sichere Verbindung, ähnlich wie beim FTP-Protokoll.&lt;br /&gt;
&lt;br /&gt;
SSHFS (SSH Filesystem) hingegen ist ein FUSE (Filesystem in Userspace)-basiertes Dateisystem, das es ermöglicht, ein entferntes Dateisystem als lokales Dateisystem zu mounten. SSHFS verwendet das SSH-Protokoll, um eine sichere Verbindung zu einem entfernten System herzustellen und ein entferntes Dateisystem als lokales Dateisystem zu mounten. Dadurch können Sie auf entfernte Dateien und Verzeichnisse zugreifen, als wären sie auf Ihrem lokalen Computer vorhanden.&lt;br /&gt;
&lt;br /&gt;
Wenn es darum geht, auf entfernte Dateien und Verzeichnisse zuzugreifen, ist SSHFS in der Regel die bessere Option, da es die Möglichkeit bietet, ein entferntes Dateisystem als lokales Dateisystem zu mounten, was die Arbeit mit entfernten Dateien und Verzeichnissen erleichtert. SFTP ist jedoch eine gute Option, wenn Sie nur Dateien übertragen müssen, ohne das gesamte Dateisystem mounten zu müssen.&lt;br /&gt;
&lt;br /&gt;
=== '''SSH|SCP|SFTP FUSE, SSHFS''' ===&lt;br /&gt;
 '''Mit dem SSH-Clients SSHSSH|SCP|SFTP kann man sich über ein Terminal auf entfernte Rechner anmelden.'''&lt;br /&gt;
 '''Die Kommunikation und die Authentifizierung findet dabei verschlüsselt statt.'''&lt;br /&gt;
 '''SSH kann dabei interaktiv oder nicht interaktiv genutzt werden'''&lt;br /&gt;
&lt;br /&gt;
=== '''RANKING DER REMOTE CLIENTS|TOOLS NACH SICHERHEIT''' ===&lt;br /&gt;
 # '''SSH'''&lt;br /&gt;
 # '''SCP'''&lt;br /&gt;
 # '''SFTP'''&lt;br /&gt;
 # '''RLOGIN'''&lt;br /&gt;
 # '''TELNET'''&lt;br /&gt;
 # '''FTP'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSH STATUS''' ====&lt;br /&gt;
 '''$ systemctl status ssh '''&lt;br /&gt;
&lt;br /&gt;
 '''$ whoami'''&lt;br /&gt;
 '''$ who'''&lt;br /&gt;
 '''$ w'''&lt;br /&gt;
&lt;br /&gt;
 '''$ ps'''&lt;br /&gt;
 '''$ ps aux'''&lt;br /&gt;
 '''$ ps aux | grep ssh '''&lt;br /&gt;
 '''$ ps aux | grep sshd '''&lt;br /&gt;
&lt;br /&gt;
 '''$ lsof -i -n | egrep 'ssh' '''&lt;br /&gt;
 '''$ lsof -i -n | egrep 'sshd' '''&lt;br /&gt;
&lt;br /&gt;
 '''$ ss '''&lt;br /&gt;
 '''$ ss -l'''&lt;br /&gt;
 '''$ ss | grep tcp'''&lt;br /&gt;
 '''$ ss | grep -i ssh'''&lt;br /&gt;
 '''$ ss -u -a'''&lt;br /&gt;
&lt;br /&gt;
 '''$ last -a | grep -i still'''&lt;br /&gt;
&lt;br /&gt;
 '''apk*error'''&lt;br /&gt;
 ''$ service ssh status ''&lt;br /&gt;
 ''$ netstat -tanup | grep ssh ''&lt;br /&gt;
 ''$ netstat -tnpa | grep 'ESTABLISHED.*sshd''&lt;br /&gt;
 ''$ netstat -an | grep 8090/port''&lt;br /&gt;
 ''$ firewall-cmd --list-all-zones ''&lt;br /&gt;
&lt;br /&gt;
==== '''SSH tools''' ====&lt;br /&gt;
 '''ssh-keygen'''&lt;br /&gt;
 '''$ ssh-keyscan ip &amp;gt; known_hosts'''&lt;br /&gt;
 '''$ ssh-keyscan -f txtwithhosts'''&lt;br /&gt;
&lt;br /&gt;
 '''ssh-keyscan'''&lt;br /&gt;
&lt;br /&gt;
 '''ssh-copy-id'''&lt;br /&gt;
&lt;br /&gt;
 '''ssh-add'''&lt;br /&gt;
 '''$ ssh-add -l '''&lt;br /&gt;
 '''$ ssh-add KEY '''&lt;br /&gt;
&lt;br /&gt;
 '''ssh-agent'''&lt;br /&gt;
 '''$ pgrep ssh-agent '''&lt;br /&gt;
 '''$ ps aux | grep ssh-agent'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSH|SSHFS|FUSE CONFIG FILES''' ====&lt;br /&gt;
 '''$ cat /etc/ssh/sshd_config'''&lt;br /&gt;
 '''$ cat /etc/ssh/ssh_config'''&lt;br /&gt;
 '''$ /etc/fuse.conf'''&lt;br /&gt;
 '''$ /etc/modules'''&lt;br /&gt;
''&lt;br /&gt;
 '''''IN LAB'''''&lt;br /&gt;
 '''AllowHosts'''&lt;br /&gt;
 '''AllowUsers'''&lt;br /&gt;
 '''AllowGroups'''&lt;br /&gt;
 '''ChRootGroups(Syntax: AllowGroups)'''&lt;br /&gt;
 '''ChRootUsers(Syntax: AllowUsers)'''&lt;br /&gt;
&lt;br /&gt;
==== '''Create SSH Key''' ====&lt;br /&gt;
 '''$ ssh-keygen -t ed25519 -b 4096'''&lt;br /&gt;
&lt;br /&gt;
==== '''Copy SSH Key''' ====&lt;br /&gt;
 '''$ ssh-copy-id  -i KEY user@IP'''&lt;br /&gt;
 '''$ ssh-copy-id  -i ~/.ssh/KEY user@IP'''&lt;br /&gt;
&lt;br /&gt;
 ''copy key while login with key''&lt;br /&gt;
 '''$ ssh-copy-id -i KEYTOCOPY -f -o 'IdentityFile KEYTOLOGIN' -p 5000 USER@IP'''&lt;br /&gt;
&lt;br /&gt;
==== '''Login with SSH Key''' ====&lt;br /&gt;
 '''$ ssh -i ~/.ssh/KEY user@IP -p 5001'''&lt;br /&gt;
&lt;br /&gt;
==== '''Login SSH Password automation''' ====&lt;br /&gt;
 '''install sshpass '''&lt;br /&gt;
 '''#!/bin/bash '''&lt;br /&gt;
 '''read -s -p &amp;quot;Enter your password: &amp;quot; password '''&lt;br /&gt;
 '''echo '''&lt;br /&gt;
 '''sshpass -p &amp;quot;$password&amp;quot; ssh username@remote_server'''&lt;br /&gt;
&lt;br /&gt;
==== '''ssh config files &amp;amp; folders''' ====&lt;br /&gt;
 '''/etc/ssh/ssh_config'''&lt;br /&gt;
 '''/etc/ssh/sshd_config'''&lt;br /&gt;
 '''~/.ssh'''&lt;br /&gt;
 '''~/.ssh/authorized_keys '''&lt;br /&gt;
 '''~/.ssh/known_hosts'''&lt;br /&gt;
&lt;br /&gt;
==== '''ssh sshd_config file''' ====&lt;br /&gt;
 '''$ nano /etc/ssh/sshd_config'''&lt;br /&gt;
 ''' Port 5000'''&lt;br /&gt;
 ''' PubkeyAuthentication yes'''&lt;br /&gt;
 ''' PasswordAuthentication no'''&lt;br /&gt;
 ''' PermitEmptyPasswords no'''&lt;br /&gt;
 ''' X11Forwarding no'''&lt;br /&gt;
 ''' Banner /path/ (Message before login)'''&lt;br /&gt;
 ''''' ListenAddress (Strict/Diff Networks)'''''&lt;br /&gt;
 ''''' MaxSessions '''''&lt;br /&gt;
 [https://unix.stackexchange.com/questions/26170/sshd-config-maxsessions-parameter  MaxSessions parameter]&lt;br /&gt;
&lt;br /&gt;
==== '''ssh motd file''' ====&lt;br /&gt;
 '''$ nano /etc/motd (Message after Login)'''&lt;br /&gt;
&lt;br /&gt;
==== '''ssh known_hosts file''' ====&lt;br /&gt;
 '''$ nano ~/.ssh/known_hosts '''&lt;br /&gt;
&lt;br /&gt;
==== '''ssh authorized_keys file''' ====&lt;br /&gt;
 '''$ nano ~/.ssh/authorized_keys '''&lt;br /&gt;
&lt;br /&gt;
 '''How to manually copy SSH public keys to server:'''&lt;br /&gt;
 On the local machine&lt;br /&gt;
 '''$ cat ~/.ssh/id_rsa.pub'''&lt;br /&gt;
 copy&lt;br /&gt;
 ''ssh-rsa .STRING. USER@IP''&lt;br /&gt;
&lt;br /&gt;
 On the remote server paste the line to:&lt;br /&gt;
 '''~/.ssh/authorized_keys'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE''' ====&lt;br /&gt;
 '''$ sshfs user@host:/dir /dir -o IdentityFile=~/.ssh/KEY'''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs user@host:/dir /dir -o IdentityFile=~/.ssh/KEY -o idmap=user -o uid=$(id -u) -o gid=$(id -g)'''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs user@host:/dir /dir -C -p 5001'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE | USER MAPPING''' ====&lt;br /&gt;
 '''$ sshfs Benutzername@irgendEinRechner:/pfad_auf_dem_server/ ~/fusessh -o idmap=user -o uid=$(id -u) -o gid=$(id -g) '''&lt;br /&gt;
 '''$ sshfs user@host:/dir /dir -o IdentityFile=~/.ssh/KEY -o idmap=user -o uid=$(id -u) -o gid=$(id -g) -o nonempty -p 5001 '''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE | SYMLINKS''' ====&lt;br /&gt;
 '''$ sshfs -o follow_symlinks'''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs Benutzername@irgendEinRechner:/pfad_auf_dem_server/ ~/fusessh -o follow_symlinks '''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE | FUSERMOUNT''' ====&lt;br /&gt;
 '''$ fusermount -u /dir '''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE | Denied root access to user mounted FUSE file system''' ====&lt;br /&gt;
 This is by design in fuse as a security measure. &lt;br /&gt;
 Pass the '''-o allow_root''' or '''-o allow_other''' option when mounting the filesystem with sshfs.&lt;br /&gt;
 [https://serverfault.com/questions/188894/denied-root-access-to-user-mounted-fuse-file-system https://serverfault.com]&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS TIMEOUT''' ====&lt;br /&gt;
 '''1) In der Datei .ssh/config folgende Zeile hinzufügen (liegt im Homeverzeichnis des Anwenders, bzw. wenn man Automount beim Systemstart macht, ist die Datei /root/.ssh/config zu ändern):'''&lt;br /&gt;
 &lt;br /&gt;
  '''$ sshfs -o ServerAliveInterval=15'''&lt;br /&gt;
  '''$ sshfs-o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3  '''&lt;br /&gt;
  [https://serverfault.com/questions/6709/sshfs-mount-that-survives-disconnect SSHFS mount that survives disconnect| keep connection alive]&lt;br /&gt;
 The options ServerAliveInterval=5,ServerAliveCountMax=3 say that ssh checks every 5 seconds to see whether the remote server is still responding. &lt;br /&gt;
 If it does not receive a response after 3 of these checks, then it disconnects automatically. &lt;br /&gt;
 Thus any process waiting on this mount should hang about 15 seconds max.&lt;br /&gt;
 The options ConnectTimeout=3,ConnectionAttempts=1 are necessary because otherwise ssh will wait a very long time when attempting to reestablish connections, &lt;br /&gt;
 which again causes other processes to hang if they try to access the mount during this time.&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS SYSTEMSTART | /etc/fstab''' ====&lt;br /&gt;
 '''$ sshfs#Benutzername@irgendEinRechner:/pfad_auf_dem_server/ ~/fusessh fuse uid=1003,gid=100,umask=0,allow_other,_netdev 0 0'''&lt;br /&gt;
 &lt;br /&gt;
 '''$ sshfs#user@server:/remote/folder /local/mount/dir fuse IdentityFile=sshkeyfile,Port=XXX,allow_other,_netdev,ServerAliveInterval=45,ServerAliveCountMax=2,reconnect,noatime,auto 0 0 '''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs#user@server:/remote/folder /local/mount/dir fuse IdentityFile=sshkeyfile,Port=XXX,uid=1000,gid=1000,allow_other,_netdev,ServerAliveInterval=45,ServerAliveCountMax=2,reconnect,noatime,auto 0 0 '''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs#user@server:/remote/folder /local/mount/dir fuse delay_connect,IdentityFile=sshkeyfile,Port=XXX,uid=1000,gid=1000,allow_other,_netdev,ServerAliveInterval=45,ServerAliveCountMax=2,reconnect,noatime,auto 0 0 '''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS SHOW MOUNTS/CHECK MOUNTED | /etc/mtab''' ====&lt;br /&gt;
 '''$ mount'''&lt;br /&gt;
 '''$ cat /proc/mounts'''&lt;br /&gt;
 '''$ cat /etc/mtab'''&lt;br /&gt;
 '''$ cat /etc/mtab | grep fuse'''&lt;br /&gt;
 '''$ cat /etc/mtab | grep ssh'''&lt;br /&gt;
 '''$ findmnt'''&lt;br /&gt;
 '''$ findmnt | grep fuse'''&lt;br /&gt;
 '''$ findmnt | grep ssh'''&lt;br /&gt;
 '''$ df -h'''&lt;br /&gt;
 '''$ lsblk -f'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSH Port-Tunneling ''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''Local Forwarding'''===== &lt;br /&gt;
 '''$ ssh -i ~/.ssh/KEY -L 80:IP:80 user@IP -p 2000 '''&lt;br /&gt;
&lt;br /&gt;
===== '''Remote Forwarding'''===== &lt;br /&gt;
&lt;br /&gt;
===== '''Port Forwarding'''=====&lt;br /&gt;
&lt;br /&gt;
==== '''Reverse SSH Tunnel ''' ====&lt;br /&gt;
 ''Check for:''&lt;br /&gt;
 ''1. ServerAliveInterval(sshd_config)''&lt;br /&gt;
 ''2. autossh''&lt;br /&gt;
&lt;br /&gt;
 '''ssh -R 5001:localhost:22 -fN I'''P&lt;br /&gt;
&lt;br /&gt;
==== '''AutoSSH SSH Tunnel ''' ====&lt;br /&gt;
 '''$ autossh -NT -o &amp;quot;ExitOnForwardFailure=yes&amp;quot; -R 5001:localhost:6001 -l USER IP -p 7001 -i /home/USER/.ssh/KEY'''&lt;br /&gt;
&lt;br /&gt;
 '''$ autossh -N -f -i /home/&amp;lt;user&amp;gt;/.ssh/id_rsa -R 22222:localhost:22 &amp;lt;user&amp;gt;@&amp;lt;remote_host&amp;gt;'''&lt;br /&gt;
 '''-N:''' tell ssh to not execute any command, since we only use it for tunneling.&lt;br /&gt;
 '''-f:''' tell autossh to fall into background on start.&lt;br /&gt;
 '''-i:''' tell ssh to use the proper identity.&lt;br /&gt;
 '''-R''' 22222:localhost:22: &lt;br /&gt;
 reverse tunnel remote host's 22222 port to localhost's 22 port. &lt;br /&gt;
 So that we can use ssh -p 22222 localhost on remote host to ssh into local machine.&lt;br /&gt;
&lt;br /&gt;
 '''nano /etc/systemd/system/sshtunnel.service''' &lt;br /&gt;
&lt;br /&gt;
===== '''sshtunnel.service''' =====&lt;br /&gt;
&lt;br /&gt;
 '''[Unit]'''&lt;br /&gt;
 Description=AutoSSH tunnel service&lt;br /&gt;
 #After=network.target&lt;br /&gt;
 After=network-online.target ssh.service&lt;br /&gt;
 '''[Service]'''&lt;br /&gt;
 User=USER&lt;br /&gt;
 Environment=&amp;quot;AUTOSSH_GATETIME=0&amp;quot;&lt;br /&gt;
 RestartSec=30&lt;br /&gt;
 Restart=always&lt;br /&gt;
 ExecStart=/usr/bin/autossh -NT -o &amp;quot;ExitOnForwardFailure=yes&amp;quot; -R 5001:localhost:6000 -l USER IP -p 6001 -i /home/USER/.ssh/KEY&lt;br /&gt;
 ExecStop=pkill -s KILL autossh&lt;br /&gt;
 TimeoutStopSec=10&lt;br /&gt;
 '''[Install]'''&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
 '''systemctl status sshtunnel.service'''&lt;br /&gt;
 '''systemctl daemon-reload'''&lt;br /&gt;
 '''systemctl restart sshtunnel.service'''&lt;br /&gt;
 &lt;br /&gt;
 When using ssh multiplexing, killing the ssh process is often undesirable &lt;br /&gt;
 (it kills all open connections with that host), &lt;br /&gt;
 and you cannot easily access the escape because &amp;quot;escape not available to multiplexed sessions&amp;quot;. &lt;br /&gt;
 The right way is then to run the analogue of the forwarding command that you want to cancel, &lt;br /&gt;
 but adding -O cancel. For instance:&lt;br /&gt;
&lt;br /&gt;
 '''ssh -O cancel -L 5002:192.168.0.10:5002 192.168.178.100'''&lt;br /&gt;
&lt;br /&gt;
 This will disable this port forwarding without terminating the session. Again, this will only   &lt;br /&gt;
 work if ssh multiplexing is in use for the connection to 192.168.178.100&lt;br /&gt;
&lt;br /&gt;
 $ ssh -luser 192.xx.xxx.xx&lt;br /&gt;
&lt;br /&gt;
==== ''' ssh commands ''' ====&lt;br /&gt;
 $ ssh user@192.168.188.2 '[command]'&lt;br /&gt;
 $ ssh user@192.168.188.2 'ls -la /home/user'&lt;br /&gt;
 $ put&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== ''' ssh execute command ''' ====&lt;br /&gt;
 $ ssh user@ip 'ls -la'&lt;br /&gt;
&lt;br /&gt;
==== ''' ssh execute script ''' ====&lt;br /&gt;
&lt;br /&gt;
 $ ssh user@ip &amp;lt; script.sh&lt;br /&gt;
 $ ssh user@ip &amp;quot;bash -s&amp;quot; &amp;lt; script.sh&lt;br /&gt;
&lt;br /&gt;
==== ''' secure file transfer ''' ====&lt;br /&gt;
&lt;br /&gt;
===== ''' SCP file ''' =====&lt;br /&gt;
 $ pscp&lt;br /&gt;
&lt;br /&gt;
 # scp [source][destination]&lt;br /&gt;
 # destination ip:/path/&lt;br /&gt;
&lt;br /&gt;
 '''$ scp /test user@192.168.188.2:/home/user/test'''&lt;br /&gt;
 '''$ scp *.txt user@192.168.188.2:/home/user/txt'''&lt;br /&gt;
&lt;br /&gt;
 '''$ scp user@192.168.188.2:/home/user/txt.txt .'''&lt;br /&gt;
&lt;br /&gt;
[https://unix.stackexchange.com/a/748130/515538 How to copy files from one machine to another using ssh]&lt;br /&gt;
&lt;br /&gt;
===== ''' SCP folder ''' =====&lt;br /&gt;
&lt;br /&gt;
 '''$ scp -r /dir user@192.168.188.2:/home/user/dir '''&lt;br /&gt;
 '''$ scp -r /dir/* user@192.168.188.2:/home/user/dir '''&lt;br /&gt;
 '''$ scp -r user@192.168.188.2:/home/user/dir /home/dir'''&lt;br /&gt;
 '''$ scp -r user@192.168.188.2:/home/user/dir .'''&lt;br /&gt;
&lt;br /&gt;
===== ''' sftp ''' =====&lt;br /&gt;
 &lt;br /&gt;
===== ''' psftp ''' =====&lt;br /&gt;
&lt;br /&gt;
===== ''' ssh Jumphost ''' =====&lt;br /&gt;
#ssh jumphost&lt;br /&gt;
 PC-&amp;gt;Junphost-&amp;gt;IntServer&lt;br /&gt;
 PC-&amp;gt;Firewall-&amp;gt;IntServer&lt;br /&gt;
 ssh -J user@ip user@ip&lt;br /&gt;
&lt;br /&gt;
===== ''' ssh Multi-hop Tunnel ''' =====&lt;br /&gt;
 ssh -L8080:localhost:8080 user@host1&lt;br /&gt;
 SSH Tunnel with -t and -v (verbose)&lt;br /&gt;
&lt;br /&gt;
===== ''' ssh X11 Forwarding ''' =====&lt;br /&gt;
 '''$ ssh -X user@ip'''&lt;br /&gt;
 firefox &amp;amp; &lt;br /&gt;
&lt;br /&gt;
===== ''' ssh config file ''' =====&lt;br /&gt;
#ssh config file in .ssh/config&lt;br /&gt;
Host *&lt;br /&gt;
        User user&lt;br /&gt;
Host linuxhost&lt;br /&gt;
        HostName 192.168.188.2&lt;br /&gt;
        User user&lt;br /&gt;
        Port 2000&lt;br /&gt;
        IdentityFile ~/.ssh/mykey&lt;br /&gt;
&lt;br /&gt;
 ssh config file in /etc/ssh/ssh_config&lt;br /&gt;
&lt;br /&gt;
 debug modus&lt;br /&gt;
 $ ssh debianvm -v&lt;br /&gt;
&lt;br /&gt;
===== ''' ssh VNC|DISPLAY ''' =====&lt;br /&gt;
 ssh user @&amp;lt;ipadresse&amp;gt; &amp;quot;DISPLAY =:0 nohup firefox&amp;quot;&lt;br /&gt;
 ssh -i KEY -p XXXX user@x.x.x.x &amp;quot;DIS1PLAY =:0 nohup firefox&amp;quot;&lt;br /&gt;
 ssh -i KEY -p XXXX -X user@x.x.x.x&lt;br /&gt;
 ssh -i KEY -L 5901:127.0.0.1:5901 -C -N -l -p XXXX user@x.x.x.x&lt;br /&gt;
 ssh -i KEY -p XXXX -L 5901:127.0.0.1:5901 -C -N -l user x.x.x.x&lt;br /&gt;
&lt;br /&gt;
===== '''  socks proxy with google-authenticator!?  ''' =====&lt;br /&gt;
 # in SSHD FILE&lt;br /&gt;
 $ AuthenticationMethods publickey,keyboard-interactive&lt;br /&gt;
 $ nano /etc/pam.d/sshd 	&lt;br /&gt;
&lt;br /&gt;
 # google auth&lt;br /&gt;
 $auth required pam_google_authenticator.so &lt;br /&gt;
 $auth required pam_google_authenticator.so nullok&lt;br /&gt;
&lt;br /&gt;
ssh socks reverse&lt;br /&gt;
&lt;br /&gt;
'''Das ClientAlive-Mechanismus''' in SSH dient dazu, festzustellen, ob der Client noch verbunden ist, auch wenn keine Aktivität (Datenübertragung) stattfindet. Es unterscheidet sich von der Shell-Variable TMOUT, die Nutzer nach einer bestimmten Inaktivität abmeldet.&lt;br /&gt;
&lt;br /&gt;
    ClientAliveInterval und ClientAliveCountMax: Konfigurieren, wie oft der Server überprüft, ob der Client noch da ist.&lt;br /&gt;
    TCP Keepalive: Allgemeiner Mechanismus, um zu erkennen, ob Verbindungen tot sind und sie am Leben zu halten, besonders bei NAT-Routern.&lt;br /&gt;
    Inaktivität in der Shell (z.B. keine Eingaben) beeinflusst nicht die automatische Antwort des Clients auf Alive-Nachrichten.&lt;br /&gt;
    2023: Neue Optionen ChannelTimeout und UnusedConnectionTimeout in sshd_config eingeführt, um ungenutzte Verbindungen zu beenden.&lt;br /&gt;
&lt;br /&gt;
Tabelle&lt;br /&gt;
Option	Beschreibung&lt;br /&gt;
ClientAliveInterval	Intervall, in dem der Server Alive-Nachrichten sendet.&lt;br /&gt;
ClientAliveCountMax	Anzahl der fehlenden Antworten, bevor die Verbindung als tot betrachtet wird.&lt;br /&gt;
ServerAliveInterval	Intervall, in dem der Client Alive-Nachrichten sendet.&lt;br /&gt;
ServerAliveCountMax	Anzahl der fehlenden Antworten, bevor der Client die Verbindung trennt.&lt;br /&gt;
TCP Keepalive	Verhindert, dass Router NAT-Verbindungen als inaktiv betrachten.&lt;br /&gt;
TMOUT	Shell-Variable, die inaktive Nutzer abmeldet.&lt;br /&gt;
ChannelTimeout (ab 2023)	Timeout für inaktive SSH-Kanäle.&lt;br /&gt;
UnusedConnectionTimeout	Timeout für ungenutzte SSH-Verbindungen.&lt;br /&gt;
&lt;br /&gt;
ClientAliveInterval und ClientAliveCountMax&lt;br /&gt;
&lt;br /&gt;
    Zweck: Dient dazu, festzustellen, ob der Client noch aktiv ist. Der Server sendet Alive-Nachrichten, und wenn der Client nicht antwortet, wird die Verbindung getrennt.&lt;br /&gt;
    Vorteil: Nützlich, um Verbindungsprobleme festzustellen, z.B. bei einem plötzlich abgestürzten Client oder einer unterbrochenen Netzwerkverbindung.&lt;br /&gt;
    Anwendung: Gut, wenn du sicherstellen willst, dass Verbindungen aktiv bleiben und nicht durch Netzwerkprobleme oder Client-Abstürze blockiert werden.&lt;br /&gt;
&lt;br /&gt;
ChannelTimeout und UnusedConnectionTimeout (ab 2023)&lt;br /&gt;
&lt;br /&gt;
    Zweck: Diese Optionen zielen darauf ab, ungenutzte oder inaktive SSH-Kanäle bzw. Verbindungen zu beenden. Sie berücksichtigen, ob tatsächlich Aktivitäten über die Kanäle stattfinden.&lt;br /&gt;
    Vorteil: Effizienter, um Verbindungen zu schließen, die zwar noch offen sind, aber keine Daten mehr übertragen. Diese Optionen sind gezielter auf Inaktivität in Bezug auf tatsächliche Nutzung.&lt;br /&gt;
    Anwendung: Nützlich, wenn du Verbindungen beenden willst, die einfach offen bleiben, aber nicht aktiv genutzt werden, z.B. bei Portweiterleitungen, die nicht mehr verwendet werden.&lt;br /&gt;
&lt;br /&gt;
Alles zusammen verwenden?&lt;br /&gt;
&lt;br /&gt;
    Sinnvoll?: Ja, wenn du sowohl sicherstellen möchtest, dass Verbindungen aktiv sind (ClientAliveInterval/CountMax), als auch inaktive Kanäle oder Verbindungen schließt (ChannelTimeout/UnusedConnectionTimeout).&lt;br /&gt;
    Anwendung: Wenn du eine robustere Kontrolle über die SSH-Verbindung wünschst, kannst du beide Mechanismen kombinieren, um einerseits abgebrochene Verbindungen zu erkennen und andererseits ungenutzte Verbindungen zu schließen.&lt;br /&gt;
&lt;br /&gt;
Fazit:&lt;br /&gt;
&lt;br /&gt;
    Nur ClientAliveInterval/CountMax: Wenn du nur sicherstellen willst, dass abgebrochene Verbindungen erkannt werden.&lt;br /&gt;
    Nur ChannelTimeout/UnusedConnectionTimeout: Wenn du hauptsächlich ungenutzte Verbindungen automatisch beenden willst.&lt;br /&gt;
    Beide zusammen: Optimale Kontrolle über die Verbindungsstabilität und das automatische Schließen inaktiver Verbindungen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
s geht um die Konfiguration von SSH-Verbindungen, insbesondere um das ClientAlive-Mechanismus, der dafür sorgt, dass SSH-Verbindungen nicht unbegrenzt offen bleiben, wenn sie nicht aktiv sind. Zusätzlich wird erklärt, wie man TCPKeepAlive und systemweite TCP-Einstellungen anpasst. Wenn keine Anpassung möglich ist, wird empfohlen, den SSH-Prozess manuell zu beenden.&lt;br /&gt;
&lt;br /&gt;
    ClientAliveInterval und ClientAliveCountMax: Server sendet Alive-Nachrichten, um festzustellen, ob der Client noch reagiert.&lt;br /&gt;
    TCPKeepAlive: Systemweite TCP-Einstellung, die Verbindungen auf lebendig prüft.&lt;br /&gt;
    Manuelles Beenden: Auf dem Client SSH beenden, um Portweiterleitungen zu unterbrechen.&lt;br /&gt;
    Script: Ein Beispielskript zum Beenden der SSH-Verbindung und Einrichten eines neuen Tunnels.&lt;br /&gt;
&lt;br /&gt;
Tabelle&lt;br /&gt;
Option	Beschreibung&lt;br /&gt;
ClientAliveInterval	Intervall, in dem der Server Alive-Nachrichten sendet (Standard: 0 = deaktiviert).&lt;br /&gt;
ClientAliveCountMax	Anzahl der ausstehenden Nachrichten, bevor die Verbindung getrennt wird.&lt;br /&gt;
TCPKeepAlive	Allgemeine TCP-Einstellung, um zu überprüfen, ob eine Verbindung noch aktiv ist.&lt;br /&gt;
ServerAliveInterval	Ähnlich wie ClientAlive, aber für den Client, um Verbindungsabbrüche zu erkennen.&lt;br /&gt;
SSH-Skript	Skript, um SSH-Tunnel manuell zu beenden und neu zu starten.&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=API_%26_RESTful_API&amp;diff=1152</id>
		<title>API &amp; RESTful API</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=API_%26_RESTful_API&amp;diff=1152"/>
		<updated>2023-11-10T17:48:25Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; '''API = Application Programming Interface'''&lt;br /&gt;
&lt;br /&gt;
 How computers can talk to other computers&lt;br /&gt;
 It doesn't matter what language you're using&lt;br /&gt;
&lt;br /&gt;
 '''Quest &amp;amp; Request'''&lt;br /&gt;
&lt;br /&gt;
 '''RESTful API'''&lt;br /&gt;
 REpresentational&lt;br /&gt;
 State&lt;br /&gt;
 Transfer&lt;br /&gt;
&lt;br /&gt;
 Request for data or take an action&lt;br /&gt;
&lt;br /&gt;
 '''Request Methods:'''&lt;br /&gt;
 HTTP GET&lt;br /&gt;
 HTTP POST&lt;br /&gt;
 HTTP PUT&lt;br /&gt;
 HTTP DELETE&lt;br /&gt;
 HTTP PATCH&lt;br /&gt;
&lt;br /&gt;
 '''HTTP Methods for RESTful Requests'''&lt;br /&gt;
 ''HTTP    Method CRUD Operation   Example URL(s)''&lt;br /&gt;
 GET     Read                    HTTP GET http://website.com/api/users/&lt;br /&gt;
                                 HTTP GET http://website.com/api/users/1/&lt;br /&gt;
 POST    Create                  HTTP POST http://website.com/api/users/&lt;br /&gt;
 DELETE  Delete                  HTTP DELETE http://website.com/api/user/1/&lt;br /&gt;
 PUT     Update/Replace          HTTP PUT http://website.com/api/user/1/&lt;br /&gt;
 PATCH   Partial Update/Modify   HTTP PATCH http://website.com/api/user/1/&lt;br /&gt;
&lt;br /&gt;
 HTTP STATUS CODES&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=API_%26_RESTful_API&amp;diff=1151</id>
		<title>API &amp; RESTful API</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=API_%26_RESTful_API&amp;diff=1151"/>
		<updated>2023-11-10T17:40:28Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; '''API = Application Programming Interface'''&lt;br /&gt;
&lt;br /&gt;
 How computers can talk to other computers&lt;br /&gt;
 It doesn't matter what language you're using&lt;br /&gt;
&lt;br /&gt;
 '''Quest &amp;amp; Request'''&lt;br /&gt;
&lt;br /&gt;
 '''RESTful API'''&lt;br /&gt;
 REpresentational&lt;br /&gt;
 State&lt;br /&gt;
 Transfer&lt;br /&gt;
&lt;br /&gt;
 Request for data or take an action&lt;br /&gt;
&lt;br /&gt;
 '''Request Methods:'''&lt;br /&gt;
 HTTP GET&lt;br /&gt;
 HTTP POST&lt;br /&gt;
 HTTP PUT&lt;br /&gt;
 HTTP DELETE&lt;br /&gt;
 HTTP PATCH&lt;br /&gt;
&lt;br /&gt;
 '''HTTP Methods for RESTful Requests'''&lt;br /&gt;
 ''HTTP    Method CRUD Operation   Example URL(s)''&lt;br /&gt;
 GET     Read                    HTTP GET http://website.com/api/users/&lt;br /&gt;
                                 HTTP GET http://website.com/api/users/1/&lt;br /&gt;
 POST    Create                  HTTP POST http://website.com/api/users/&lt;br /&gt;
 DELETE  Delete                  HTTP DELETE http://website.com/api/user/1/&lt;br /&gt;
 PUT     Update/Replace          HTTP PUT http://website.com/api/user/1/&lt;br /&gt;
 PATCH   Partial Update/Modify   HTTP PATCH http://website.com/api/user/1/&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=API_%26_RESTful_API&amp;diff=1150</id>
		<title>API &amp; RESTful API</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=API_%26_RESTful_API&amp;diff=1150"/>
		<updated>2023-11-10T17:06:17Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; '''API = Application Programming Interface'''&lt;br /&gt;
&lt;br /&gt;
 How computers can talk to other computers&lt;br /&gt;
 It doesn't matter what language you're using&lt;br /&gt;
&lt;br /&gt;
 '''Quest &amp;amp; Request'''&lt;br /&gt;
&lt;br /&gt;
 '''RESTful API'''&lt;br /&gt;
 REpresentational&lt;br /&gt;
 State&lt;br /&gt;
 Transfer&lt;br /&gt;
&lt;br /&gt;
 Request for data or take an action&lt;br /&gt;
&lt;br /&gt;
 '''Request Methods:'''&lt;br /&gt;
 HTTP GET&lt;br /&gt;
 HTTP POST&lt;br /&gt;
 HTTP PUT&lt;br /&gt;
 HTTP DELETE&lt;br /&gt;
 HTTP PATCH&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=API_%26_RESTful_API&amp;diff=1149</id>
		<title>API &amp; RESTful API</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=API_%26_RESTful_API&amp;diff=1149"/>
		<updated>2023-11-10T17:05:20Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; '''API = Application Programming Interface'''&lt;br /&gt;
&lt;br /&gt;
 How computers can talk to other computers&lt;br /&gt;
 It doesn't matter what language you're using&lt;br /&gt;
&lt;br /&gt;
 '''Quest &amp;amp; Request'''&lt;br /&gt;
&lt;br /&gt;
 '''RESTful API'''&lt;br /&gt;
 REpresentational&lt;br /&gt;
 State&lt;br /&gt;
 Transfer&lt;br /&gt;
&lt;br /&gt;
 '''Request Methods:'''&lt;br /&gt;
 HTTP GET&lt;br /&gt;
 HTTP POST&lt;br /&gt;
 HTTP PUT&lt;br /&gt;
 HTTP DELETE&lt;br /&gt;
 HTTP PATCH&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=API_%26_RESTful_API&amp;diff=1148</id>
		<title>API &amp; RESTful API</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=API_%26_RESTful_API&amp;diff=1148"/>
		<updated>2023-11-10T16:46:59Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; '''API = Application Programming Interface'''&lt;br /&gt;
&lt;br /&gt;
 How computers can talk to other computers&lt;br /&gt;
 It doesn't matter what language you're using&lt;br /&gt;
&lt;br /&gt;
 '''Quest &amp;amp; Request'''&lt;br /&gt;
&lt;br /&gt;
 '''RESTful API'''&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=API_%26_RESTful_API&amp;diff=1147</id>
		<title>API &amp; RESTful API</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=API_%26_RESTful_API&amp;diff=1147"/>
		<updated>2023-11-10T16:42:01Z</updated>

		<summary type="html">&lt;p&gt;Geist: Die Seite wurde neu angelegt: „ '''API = Application Programming Interface'''“&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; '''API = Application Programming Interface'''&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Apt_sources.list&amp;diff=1146</id>
		<title>Apt sources.list</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Apt_sources.list&amp;diff=1146"/>
		<updated>2023-11-10T16:38:45Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; ''' #/etc/apt/sources.list '''&lt;br /&gt;
  [https://wiki.debian.org/SourcesList SourcesList Debian] &lt;br /&gt;
&lt;br /&gt;
== Debian Apt downloads packages ==&lt;br /&gt;
&lt;br /&gt;
=== Debian BOOKWORM ===&lt;br /&gt;
&lt;br /&gt;
 '''#MAIN STABLE'''&lt;br /&gt;
 deb http://deb.debian.org/debian bookworm main&lt;br /&gt;
 deb-src http://deb.debian.org/debian bookworm main&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian-security/ bookworm-security main&lt;br /&gt;
 deb-src http://deb.debian.org/debian-security/ bookworm-security main&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian bookworm-updates main&lt;br /&gt;
 deb-src http://deb.debian.org/debian bookworm-updates main&lt;br /&gt;
&lt;br /&gt;
 '''#NON-FREE'''&lt;br /&gt;
 deb http://deb.debian.org/debian bookworm main non-free-firmware&lt;br /&gt;
 deb-src http://deb.debian.org/debian bookworm main non-free-firmware&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian-security/ bookworm-security main non-free-firmware&lt;br /&gt;
 deb-src http://deb.debian.org/debian-security/ bookworm-security main non-free-firmware&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian bookworm-updates main non-free-firmware&lt;br /&gt;
 deb-src http://deb.debian.org/debian bookworm-updates main non-free-firmware&lt;br /&gt;
&lt;br /&gt;
 '''#BACKPORTS'''&lt;br /&gt;
 deb http://deb.debian.org/debian bookworm-backports main contrib non-free&lt;br /&gt;
 deb-src http://deb.debian.org/debian bookworm-backports main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 '''#UNSTABLE'''&lt;br /&gt;
 deb http://deb.debian.org/debian/ unstable main&lt;br /&gt;
 deb-src http://deb.debian.org/debian/ unstable main&lt;br /&gt;
&lt;br /&gt;
=== Debian BUSTER ===&lt;br /&gt;
&lt;br /&gt;
 '''# CDROM / DVD'''&lt;br /&gt;
 '''# deb cdrom:[Debian GNU/Linux 12.0.0 _Buster_ - Official amd64 DVD Binary-1 2023xxxx-xx:xx]/ buster contrib main'''&lt;br /&gt;
&lt;br /&gt;
 '''#DEBIAN BUSTER MAIN'''&lt;br /&gt;
 deb http://deb.debian.org/debian buster main&lt;br /&gt;
 deb-src http://deb.debian.org/debian buster main&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian-security/ buster/updates main&lt;br /&gt;
 deb-src http://deb.debian.org/debian-security/ buster/updates main&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian buster-updates main&lt;br /&gt;
 deb-src http://deb.debian.org/debian buster-updates main&lt;br /&gt;
&lt;br /&gt;
 '''#DEBIAN BUSTER NON FREE'''&lt;br /&gt;
 deb http://deb.debian.org/debian buster main contrib non-free&lt;br /&gt;
 deb-src http://deb.debian.org/debian buster main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free&lt;br /&gt;
 deb-src http://deb.debian.org/debian-security/ buster/updates main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian buster-updates main contrib non-free&lt;br /&gt;
 deb-src http://deb.debian.org/debian buster-updates main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 '''#DEBIAN BUSTER BACKPORTS'''&lt;br /&gt;
 deb http://deb.debian.org/debian buster-backports main contrib non-free&lt;br /&gt;
 deb-src http://deb.debian.org/debian buster-backports main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 '''#DEBIAN BUSTER THIRD-PARTY'''&lt;br /&gt;
 deb http://download.virtualbox.org/virtualbox/debian buster contrib&lt;br /&gt;
&lt;br /&gt;
 deb https://deb.torproject.org/torproject.org stretch main&lt;br /&gt;
 deb-src https://deb.torproject.org/torproject.org stretch main&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.opera.com/opera-stable/ stable non-free&lt;br /&gt;
 deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main&lt;br /&gt;
&lt;br /&gt;
=== Debian STRETCH ===&lt;br /&gt;
&lt;br /&gt;
 '''#DEBIAN STRETCH MAIN'''&lt;br /&gt;
 deb  http://deb.debian.org/debian stretch main&lt;br /&gt;
 deb-src  http://deb.debian.org/debian stretch main&lt;br /&gt;
&lt;br /&gt;
 deb  http://deb.debian.org/debian stretch-updates main&lt;br /&gt;
 deb-src  http://deb.debian.org/debian stretch-updates main&lt;br /&gt;
&lt;br /&gt;
 deb http://security.debian.org/ stretch/updates main&lt;br /&gt;
 deb-src http://security.debian.org/ stretch/updates main&lt;br /&gt;
&lt;br /&gt;
 '''#DEBIAN STRETCH NON FREE'''&lt;br /&gt;
 deb  http://deb.debian.org/debian stretch main contrib non-free&lt;br /&gt;
 deb-src  http://deb.debian.org/debian stretch main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 deb  http://deb.debian.org/debian stretch-updates main contrib non-free&lt;br /&gt;
 deb-src  http://deb.debian.org/debian stretch-updates main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 deb http://security.debian.org/ stretch/updates main contrib non-free&lt;br /&gt;
 deb-src http://security.debian.org/ stretch/updates main contrib non-free&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Apt_sources.list&amp;diff=1145</id>
		<title>Apt sources.list</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Apt_sources.list&amp;diff=1145"/>
		<updated>2023-11-10T16:37:37Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; ''' #/etc/apt/sources.list '''&lt;br /&gt;
  [https://wiki.debian.org/SourcesList SourcesList Debian] &lt;br /&gt;
&lt;br /&gt;
== Debian Apt downloads packages ==&lt;br /&gt;
&lt;br /&gt;
=== Debian BOOKWORM ===&lt;br /&gt;
&lt;br /&gt;
 '''MAIN STABLE'''&lt;br /&gt;
 deb http://deb.debian.org/debian bookworm main&lt;br /&gt;
 deb-src http://deb.debian.org/debian bookworm main&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian-security/ bookworm-security main&lt;br /&gt;
 deb-src http://deb.debian.org/debian-security/ bookworm-security main&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian bookworm-updates main&lt;br /&gt;
 deb-src http://deb.debian.org/debian bookworm-updates main&lt;br /&gt;
&lt;br /&gt;
 '''NON-FREE'''&lt;br /&gt;
 deb http://deb.debian.org/debian bookworm main non-free-firmware&lt;br /&gt;
 deb-src http://deb.debian.org/debian bookworm main non-free-firmware&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian-security/ bookworm-security main non-free-firmware&lt;br /&gt;
 deb-src http://deb.debian.org/debian-security/ bookworm-security main non-free-firmware&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian bookworm-updates main non-free-firmware&lt;br /&gt;
 deb-src http://deb.debian.org/debian bookworm-updates main non-free-firmware&lt;br /&gt;
&lt;br /&gt;
 '''BACKPORTS'''&lt;br /&gt;
 deb http://deb.debian.org/debian bookworm-backports main contrib non-free&lt;br /&gt;
 deb-src http://deb.debian.org/debian bookworm-backports main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 '''UNSTABLE'''&lt;br /&gt;
 deb http://deb.debian.org/debian/ unstable main&lt;br /&gt;
 deb-src http://deb.debian.org/debian/ unstable main&lt;br /&gt;
&lt;br /&gt;
=== Debian BUSTER ===&lt;br /&gt;
&lt;br /&gt;
 '''# CDROM / DVD'''&lt;br /&gt;
 '''# deb cdrom:[Debian GNU/Linux 12.0.0 _Buster_ - Official amd64 DVD Binary-1 2023xxxx-xx:xx]/ buster contrib main'''&lt;br /&gt;
&lt;br /&gt;
 '''DEBIAN BUSTER MAIN'''&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian buster main&lt;br /&gt;
 deb-src http://deb.debian.org/debian buster main&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian-security/ buster/updates main&lt;br /&gt;
 deb-src http://deb.debian.org/debian-security/ buster/updates main&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian buster-updates main&lt;br /&gt;
 deb-src http://deb.debian.org/debian buster-updates main&lt;br /&gt;
&lt;br /&gt;
 '''DEBIAN BUSTER NON FREE'''&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian buster main contrib non-free&lt;br /&gt;
 deb-src http://deb.debian.org/debian buster main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free&lt;br /&gt;
 deb-src http://deb.debian.org/debian-security/ buster/updates main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian buster-updates main contrib non-free&lt;br /&gt;
 deb-src http://deb.debian.org/debian buster-updates main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 '''DEBIAN BUSTER BACKPORTS'''&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian buster-backports main contrib non-free&lt;br /&gt;
 deb-src http://deb.debian.org/debian buster-backports main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 '''DEBIAN BUSTER THIRD-PARTY'''&lt;br /&gt;
&lt;br /&gt;
 deb http://download.virtualbox.org/virtualbox/debian buster contrib&lt;br /&gt;
&lt;br /&gt;
 deb https://deb.torproject.org/torproject.org stretch main&lt;br /&gt;
 deb-src https://deb.torproject.org/torproject.org stretch main&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.opera.com/opera-stable/ stable non-free&lt;br /&gt;
 deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main&lt;br /&gt;
&lt;br /&gt;
=== Debian STRETCH ===&lt;br /&gt;
&lt;br /&gt;
 '''DEBIAN STRETCH MAIN'''&lt;br /&gt;
&lt;br /&gt;
 deb  http://deb.debian.org/debian stretch main&lt;br /&gt;
 deb-src  http://deb.debian.org/debian stretch main&lt;br /&gt;
&lt;br /&gt;
 deb  http://deb.debian.org/debian stretch-updates main&lt;br /&gt;
 deb-src  http://deb.debian.org/debian stretch-updates main&lt;br /&gt;
&lt;br /&gt;
 deb http://security.debian.org/ stretch/updates main&lt;br /&gt;
 deb-src http://security.debian.org/ stretch/updates main&lt;br /&gt;
&lt;br /&gt;
 '''DEBIAN STRETCH NON FREE'''&lt;br /&gt;
&lt;br /&gt;
 deb  http://deb.debian.org/debian stretch main contrib non-free&lt;br /&gt;
 deb-src  http://deb.debian.org/debian stretch main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 deb  http://deb.debian.org/debian stretch-updates main contrib non-free&lt;br /&gt;
 deb-src  http://deb.debian.org/debian stretch-updates main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 deb http://security.debian.org/ stretch/updates main contrib non-free&lt;br /&gt;
 deb-src http://security.debian.org/ stretch/updates main contrib non-free&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Apt_sources.list&amp;diff=1144</id>
		<title>Apt sources.list</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Apt_sources.list&amp;diff=1144"/>
		<updated>2023-11-10T16:36:10Z</updated>

		<summary type="html">&lt;p&gt;Geist: /* Debian BOOKWORM */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; ''' #/etc/apt/sources.list '''&lt;br /&gt;
  [https://wiki.debian.org/SourcesList SourcesList Debian] &lt;br /&gt;
&lt;br /&gt;
== Debian Apt downloads packages ==&lt;br /&gt;
&lt;br /&gt;
=== Debian BOOKWORM ===&lt;br /&gt;
&lt;br /&gt;
## MAIN STABLE&lt;br /&gt;
deb http://deb.debian.org/debian bookworm main&lt;br /&gt;
deb-src http://deb.debian.org/debian bookworm main&lt;br /&gt;
&lt;br /&gt;
deb http://deb.debian.org/debian-security/ bookworm-security main&lt;br /&gt;
deb-src http://deb.debian.org/debian-security/ bookworm-security main&lt;br /&gt;
&lt;br /&gt;
deb http://deb.debian.org/debian bookworm-updates main&lt;br /&gt;
deb-src http://deb.debian.org/debian bookworm-updates main&lt;br /&gt;
&lt;br /&gt;
## NON-FREE&lt;br /&gt;
deb http://deb.debian.org/debian bookworm main non-free-firmware&lt;br /&gt;
deb-src http://deb.debian.org/debian bookworm main non-free-firmware&lt;br /&gt;
&lt;br /&gt;
deb http://deb.debian.org/debian-security/ bookworm-security main non-free-firmware&lt;br /&gt;
deb-src http://deb.debian.org/debian-security/ bookworm-security main non-free-firmware&lt;br /&gt;
&lt;br /&gt;
deb http://deb.debian.org/debian bookworm-updates main non-free-firmware&lt;br /&gt;
deb-src http://deb.debian.org/debian bookworm-updates main non-free-firmware&lt;br /&gt;
&lt;br /&gt;
## BACKPORTS&lt;br /&gt;
deb http://deb.debian.org/debian bookworm-backports main contrib non-free&lt;br /&gt;
deb-src http://deb.debian.org/debian bookworm-backports main contrib non-free&lt;br /&gt;
&lt;br /&gt;
## UNSTABLE&lt;br /&gt;
deb http://deb.debian.org/debian/ unstable main&lt;br /&gt;
deb-src http://deb.debian.org/debian/ unstable main&lt;br /&gt;
&lt;br /&gt;
=== Debian BUSTER ===&lt;br /&gt;
&lt;br /&gt;
 '''# CDROM / DVD'''&lt;br /&gt;
 '''# deb cdrom:[Debian GNU/Linux 12.0.0 _Buster_ - Official amd64 DVD Binary-1 2023xxxx-xx:xx]/ buster contrib main'''&lt;br /&gt;
&lt;br /&gt;
 '''DEBIAN BUSTER MAIN'''&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian buster main&lt;br /&gt;
 deb-src http://deb.debian.org/debian buster main&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian-security/ buster/updates main&lt;br /&gt;
 deb-src http://deb.debian.org/debian-security/ buster/updates main&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian buster-updates main&lt;br /&gt;
 deb-src http://deb.debian.org/debian buster-updates main&lt;br /&gt;
&lt;br /&gt;
 '''DEBIAN BUSTER NON FREE'''&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian buster main contrib non-free&lt;br /&gt;
 deb-src http://deb.debian.org/debian buster main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free&lt;br /&gt;
 deb-src http://deb.debian.org/debian-security/ buster/updates main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian buster-updates main contrib non-free&lt;br /&gt;
 deb-src http://deb.debian.org/debian buster-updates main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 '''DEBIAN BUSTER BACKPORTS'''&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian buster-backports main contrib non-free&lt;br /&gt;
 deb-src http://deb.debian.org/debian buster-backports main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 '''DEBIAN BUSTER THIRD-PARTY'''&lt;br /&gt;
&lt;br /&gt;
 deb http://download.virtualbox.org/virtualbox/debian buster contrib&lt;br /&gt;
&lt;br /&gt;
 deb https://deb.torproject.org/torproject.org stretch main&lt;br /&gt;
 deb-src https://deb.torproject.org/torproject.org stretch main&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.opera.com/opera-stable/ stable non-free&lt;br /&gt;
 deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main&lt;br /&gt;
&lt;br /&gt;
=== Debian STRETCH ===&lt;br /&gt;
&lt;br /&gt;
 '''DEBIAN STRETCH MAIN'''&lt;br /&gt;
&lt;br /&gt;
 deb  http://deb.debian.org/debian stretch main&lt;br /&gt;
 deb-src  http://deb.debian.org/debian stretch main&lt;br /&gt;
&lt;br /&gt;
 deb  http://deb.debian.org/debian stretch-updates main&lt;br /&gt;
 deb-src  http://deb.debian.org/debian stretch-updates main&lt;br /&gt;
&lt;br /&gt;
 deb http://security.debian.org/ stretch/updates main&lt;br /&gt;
 deb-src http://security.debian.org/ stretch/updates main&lt;br /&gt;
&lt;br /&gt;
 '''DEBIAN STRETCH NON FREE'''&lt;br /&gt;
&lt;br /&gt;
 deb  http://deb.debian.org/debian stretch main contrib non-free&lt;br /&gt;
 deb-src  http://deb.debian.org/debian stretch main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 deb  http://deb.debian.org/debian stretch-updates main contrib non-free&lt;br /&gt;
 deb-src  http://deb.debian.org/debian stretch-updates main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 deb http://security.debian.org/ stretch/updates main contrib non-free&lt;br /&gt;
 deb-src http://security.debian.org/ stretch/updates main contrib non-free&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Apt_sources.list&amp;diff=1143</id>
		<title>Apt sources.list</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Apt_sources.list&amp;diff=1143"/>
		<updated>2023-11-10T16:27:24Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; ''' #/etc/apt/sources.list '''&lt;br /&gt;
  [https://wiki.debian.org/SourcesList SourcesList Debian] &lt;br /&gt;
&lt;br /&gt;
== Debian Apt downloads packages ==&lt;br /&gt;
&lt;br /&gt;
=== Debian BOOKWORM ===&lt;br /&gt;
&lt;br /&gt;
=== Debian BUSTER ===&lt;br /&gt;
&lt;br /&gt;
 '''# CDROM / DVD'''&lt;br /&gt;
 '''# deb cdrom:[Debian GNU/Linux 12.0.0 _Buster_ - Official amd64 DVD Binary-1 2023xxxx-xx:xx]/ buster contrib main'''&lt;br /&gt;
&lt;br /&gt;
 '''DEBIAN BUSTER MAIN'''&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian buster main&lt;br /&gt;
 deb-src http://deb.debian.org/debian buster main&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian-security/ buster/updates main&lt;br /&gt;
 deb-src http://deb.debian.org/debian-security/ buster/updates main&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian buster-updates main&lt;br /&gt;
 deb-src http://deb.debian.org/debian buster-updates main&lt;br /&gt;
&lt;br /&gt;
 '''DEBIAN BUSTER NON FREE'''&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian buster main contrib non-free&lt;br /&gt;
 deb-src http://deb.debian.org/debian buster main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free&lt;br /&gt;
 deb-src http://deb.debian.org/debian-security/ buster/updates main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian buster-updates main contrib non-free&lt;br /&gt;
 deb-src http://deb.debian.org/debian buster-updates main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 '''DEBIAN BUSTER BACKPORTS'''&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.debian.org/debian buster-backports main contrib non-free&lt;br /&gt;
 deb-src http://deb.debian.org/debian buster-backports main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 '''DEBIAN BUSTER THIRD-PARTY'''&lt;br /&gt;
&lt;br /&gt;
 deb http://download.virtualbox.org/virtualbox/debian buster contrib&lt;br /&gt;
&lt;br /&gt;
 deb https://deb.torproject.org/torproject.org stretch main&lt;br /&gt;
 deb-src https://deb.torproject.org/torproject.org stretch main&lt;br /&gt;
&lt;br /&gt;
 deb http://deb.opera.com/opera-stable/ stable non-free&lt;br /&gt;
 deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main&lt;br /&gt;
&lt;br /&gt;
=== Debian STRETCH ===&lt;br /&gt;
&lt;br /&gt;
 '''DEBIAN STRETCH MAIN'''&lt;br /&gt;
&lt;br /&gt;
 deb  http://deb.debian.org/debian stretch main&lt;br /&gt;
 deb-src  http://deb.debian.org/debian stretch main&lt;br /&gt;
&lt;br /&gt;
 deb  http://deb.debian.org/debian stretch-updates main&lt;br /&gt;
 deb-src  http://deb.debian.org/debian stretch-updates main&lt;br /&gt;
&lt;br /&gt;
 deb http://security.debian.org/ stretch/updates main&lt;br /&gt;
 deb-src http://security.debian.org/ stretch/updates main&lt;br /&gt;
&lt;br /&gt;
 '''DEBIAN STRETCH NON FREE'''&lt;br /&gt;
&lt;br /&gt;
 deb  http://deb.debian.org/debian stretch main contrib non-free&lt;br /&gt;
 deb-src  http://deb.debian.org/debian stretch main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 deb  http://deb.debian.org/debian stretch-updates main contrib non-free&lt;br /&gt;
 deb-src  http://deb.debian.org/debian stretch-updates main contrib non-free&lt;br /&gt;
&lt;br /&gt;
 deb http://security.debian.org/ stretch/updates main contrib non-free&lt;br /&gt;
 deb-src http://security.debian.org/ stretch/updates main contrib non-free&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Hauptseite&amp;diff=1142</id>
		<title>Hauptseite</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Hauptseite&amp;diff=1142"/>
		<updated>2023-11-10T15:49:45Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' A ''' ==&lt;br /&gt;
==='''[[ADB]]'''===&lt;br /&gt;
==='''[[Agile]]'''===&lt;br /&gt;
==='''[[Alpine]]'''===&lt;br /&gt;
==='''[[Apache]]'''===&lt;br /&gt;
==='''[[Anacron]]'''===&lt;br /&gt;
==='''[[Android]]'''===&lt;br /&gt;
==='''[[API &amp;amp; RESTful API]]'''===&lt;br /&gt;
==='''[[apt sources.list]]'''===&lt;br /&gt;
==='''[[apt]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' B ''' ==&lt;br /&gt;
==='''[[Backup]]'''===&lt;br /&gt;
==='''[[bash]]'''===&lt;br /&gt;
==='''[[Bitcoin]]'''===&lt;br /&gt;
==='''[[blkid]]'''===&lt;br /&gt;
==='''[[Blockchain]]'''===&lt;br /&gt;
==='''[[Blockchain Office]]'''===&lt;br /&gt;
==='''[[Borg]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' C ''' ==&lt;br /&gt;
==='''[[Cookie]]'''===&lt;br /&gt;
==='''[[Cron]]'''===&lt;br /&gt;
==='''[[Crypto]]'''===&lt;br /&gt;
==='''[[Cryptographic Hash Algorithm]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' D ''' ==&lt;br /&gt;
==='''[[Debian]]'''===&lt;br /&gt;
==='''[[DevOps]]'''===&lt;br /&gt;
==='''[[Docker]]'''===&lt;br /&gt;
==='''[[Dockerfile]]===&lt;br /&gt;
==='''[[Dolphin KDE]]===&lt;br /&gt;
&lt;br /&gt;
== ''' F ''' ==&lt;br /&gt;
==='''[[Fail2Ban]]'''===&lt;br /&gt;
==='''[[FritzBox]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' G ''' ==&lt;br /&gt;
==='''[[Git]]'''===&lt;br /&gt;
==='''[[GNU/LINUX]]'''===&lt;br /&gt;
==='''[[ GnuPG/OpenPGP/PGP ]]'''===&lt;br /&gt;
==='''[[GRUB]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' H ''' ==&lt;br /&gt;
==='''[[Hacking-Methoden]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' I ''' ==&lt;br /&gt;
==='''[[Image mount]]'''===&lt;br /&gt;
==='''[[IP]]'''===&lt;br /&gt;
==='''[[IT Berufstitel]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' J ''' ==&lt;br /&gt;
==='''[[Jenkins]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' K ''' ==&lt;br /&gt;
==='''[[KanBoard]]'''===&lt;br /&gt;
==='''[[Kate]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' L ''' ==&lt;br /&gt;
==='''[[Linux Build]]'''===&lt;br /&gt;
==='''[[Luks]]'''===&lt;br /&gt;
==='''[[LXC LXD]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' M ''' ==&lt;br /&gt;
==='''[[MariaDB]]'''===&lt;br /&gt;
==='''[[MediaWiki]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' N ''' ==&lt;br /&gt;
==='''[[NFT]]'''===&lt;br /&gt;
==='''[[NMAP]]'''===&lt;br /&gt;
==='''[[NTFS]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' O ''' ==&lt;br /&gt;
==='''[[OpSec]]'''===&lt;br /&gt;
==='''[[OpenSSL]]'''===&lt;br /&gt;
==='''[[Oracle]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' P ''' ==&lt;br /&gt;
==='''[[PATH]]'''===&lt;br /&gt;
==='''[[PHP]]'''===&lt;br /&gt;
==='''[[Prometheus]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Q ''' ==&lt;br /&gt;
==='''[[quantum attacks]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' R ''' ==&lt;br /&gt;
==='''[[RSYNC]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' S ''' ==&lt;br /&gt;
==='''[[Scrum]]'''===&lt;br /&gt;
==='''[[Secure-Hash-Cookie]]'''===&lt;br /&gt;
==='''[[snap-snapd-snappy]]'''===&lt;br /&gt;
==='''[[SQL]]'''===&lt;br /&gt;
==='''[[ssh]]'''===&lt;br /&gt;
==='''[[SQL TUNING]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' T ''' ==&lt;br /&gt;
==='''[[TAR]]'''===&lt;br /&gt;
==='''[[TCPIP]]'''===&lt;br /&gt;
==='''[[TWRP]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' U ''' ==&lt;br /&gt;
==='''[[UUID]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' V ''' ==&lt;br /&gt;
==='''[[Vagrant]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' W ''' ==&lt;br /&gt;
==='''[[WEBRTC]]'''===&lt;br /&gt;
==='''[[Wireshark]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Y ''' ==&lt;br /&gt;
==='''[[Youtube]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Z ''' ==&lt;br /&gt;
==='''[[z4o]]'''===&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Hauptseite&amp;diff=1141</id>
		<title>Hauptseite</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Hauptseite&amp;diff=1141"/>
		<updated>2023-11-10T15:49:19Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' A ''' ==&lt;br /&gt;
==='''[[ADB]]'''===&lt;br /&gt;
==='''[[Agile]]'''===&lt;br /&gt;
==='''[[Alpine]]'''===&lt;br /&gt;
==='''[[Apache]]'''===&lt;br /&gt;
==='''[[Anacron]]'''===&lt;br /&gt;
==='''[[Android]]'''===&lt;br /&gt;
==='''[[API|RESTful API]]'''===&lt;br /&gt;
==='''[[apt sources.list]]'''===&lt;br /&gt;
==='''[[apt]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' B ''' ==&lt;br /&gt;
==='''[[Backup]]'''===&lt;br /&gt;
==='''[[bash]]'''===&lt;br /&gt;
==='''[[Bitcoin]]'''===&lt;br /&gt;
==='''[[blkid]]'''===&lt;br /&gt;
==='''[[Blockchain]]'''===&lt;br /&gt;
==='''[[Blockchain Office]]'''===&lt;br /&gt;
==='''[[Borg]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' C ''' ==&lt;br /&gt;
==='''[[Cookie]]'''===&lt;br /&gt;
==='''[[Cron]]'''===&lt;br /&gt;
==='''[[Crypto]]'''===&lt;br /&gt;
==='''[[Cryptographic Hash Algorithm]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' D ''' ==&lt;br /&gt;
==='''[[Debian]]'''===&lt;br /&gt;
==='''[[DevOps]]'''===&lt;br /&gt;
==='''[[Docker]]'''===&lt;br /&gt;
==='''[[Dockerfile]]===&lt;br /&gt;
==='''[[Dolphin KDE]]===&lt;br /&gt;
&lt;br /&gt;
== ''' F ''' ==&lt;br /&gt;
==='''[[Fail2Ban]]'''===&lt;br /&gt;
==='''[[FritzBox]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' G ''' ==&lt;br /&gt;
==='''[[Git]]'''===&lt;br /&gt;
==='''[[GNU/LINUX]]'''===&lt;br /&gt;
==='''[[ GnuPG/OpenPGP/PGP ]]'''===&lt;br /&gt;
==='''[[GRUB]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' H ''' ==&lt;br /&gt;
==='''[[Hacking-Methoden]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' I ''' ==&lt;br /&gt;
==='''[[Image mount]]'''===&lt;br /&gt;
==='''[[IP]]'''===&lt;br /&gt;
==='''[[IT Berufstitel]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' J ''' ==&lt;br /&gt;
==='''[[Jenkins]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' K ''' ==&lt;br /&gt;
==='''[[KanBoard]]'''===&lt;br /&gt;
==='''[[Kate]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' L ''' ==&lt;br /&gt;
==='''[[Linux Build]]'''===&lt;br /&gt;
==='''[[Luks]]'''===&lt;br /&gt;
==='''[[LXC LXD]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' M ''' ==&lt;br /&gt;
==='''[[MariaDB]]'''===&lt;br /&gt;
==='''[[MediaWiki]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' N ''' ==&lt;br /&gt;
==='''[[NFT]]'''===&lt;br /&gt;
==='''[[NMAP]]'''===&lt;br /&gt;
==='''[[NTFS]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' O ''' ==&lt;br /&gt;
==='''[[OpSec]]'''===&lt;br /&gt;
==='''[[OpenSSL]]'''===&lt;br /&gt;
==='''[[Oracle]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' P ''' ==&lt;br /&gt;
==='''[[PATH]]'''===&lt;br /&gt;
==='''[[PHP]]'''===&lt;br /&gt;
==='''[[Prometheus]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Q ''' ==&lt;br /&gt;
==='''[[quantum attacks]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' R ''' ==&lt;br /&gt;
==='''[[RSYNC]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' S ''' ==&lt;br /&gt;
==='''[[Scrum]]'''===&lt;br /&gt;
==='''[[Secure-Hash-Cookie]]'''===&lt;br /&gt;
==='''[[snap-snapd-snappy]]'''===&lt;br /&gt;
==='''[[SQL]]'''===&lt;br /&gt;
==='''[[ssh]]'''===&lt;br /&gt;
==='''[[SQL TUNING]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' T ''' ==&lt;br /&gt;
==='''[[TAR]]'''===&lt;br /&gt;
==='''[[TCPIP]]'''===&lt;br /&gt;
==='''[[TWRP]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' U ''' ==&lt;br /&gt;
==='''[[UUID]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' V ''' ==&lt;br /&gt;
==='''[[Vagrant]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' W ''' ==&lt;br /&gt;
==='''[[WEBRTC]]'''===&lt;br /&gt;
==='''[[Wireshark]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Y ''' ==&lt;br /&gt;
==='''[[Youtube]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Z ''' ==&lt;br /&gt;
==='''[[z4o]]'''===&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=FritzBox&amp;diff=1140</id>
		<title>FritzBox</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=FritzBox&amp;diff=1140"/>
		<updated>2023-10-17T14:51:41Z</updated>

		<summary type="html">&lt;p&gt;Geist: Die Seite wurde neu angelegt: „Lokale IP über Lan-Direkt: 169.254.1.1“&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Lokale IP über Lan-Direkt: 169.254.1.1&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Hauptseite&amp;diff=1139</id>
		<title>Hauptseite</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Hauptseite&amp;diff=1139"/>
		<updated>2023-10-17T14:50:54Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' A ''' ==&lt;br /&gt;
==='''[[ADB]]'''===&lt;br /&gt;
==='''[[Agile]]'''===&lt;br /&gt;
==='''[[Alpine]]'''===&lt;br /&gt;
==='''[[Apache]]'''===&lt;br /&gt;
==='''[[Anacron]]'''===&lt;br /&gt;
==='''[[Android]]'''===&lt;br /&gt;
==='''[[apt sources.list]]'''===&lt;br /&gt;
==='''[[apt]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' B ''' ==&lt;br /&gt;
==='''[[Backup]]'''===&lt;br /&gt;
==='''[[bash]]'''===&lt;br /&gt;
==='''[[Bitcoin]]'''===&lt;br /&gt;
==='''[[blkid]]'''===&lt;br /&gt;
==='''[[Blockchain]]'''===&lt;br /&gt;
==='''[[Blockchain Office]]'''===&lt;br /&gt;
==='''[[Borg]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' C ''' ==&lt;br /&gt;
==='''[[Cookie]]'''===&lt;br /&gt;
==='''[[Cron]]'''===&lt;br /&gt;
==='''[[Crypto]]'''===&lt;br /&gt;
==='''[[Cryptographic Hash Algorithm]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' D ''' ==&lt;br /&gt;
==='''[[Debian]]'''===&lt;br /&gt;
==='''[[DevOps]]'''===&lt;br /&gt;
==='''[[Docker]]'''===&lt;br /&gt;
==='''[[Dockerfile]]===&lt;br /&gt;
==='''[[Dolphin KDE]]===&lt;br /&gt;
&lt;br /&gt;
== ''' F ''' ==&lt;br /&gt;
==='''[[Fail2Ban]]'''===&lt;br /&gt;
==='''[[FritzBox]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' G ''' ==&lt;br /&gt;
==='''[[Git]]'''===&lt;br /&gt;
==='''[[GNU/LINUX]]'''===&lt;br /&gt;
==='''[[ GnuPG/OpenPGP/PGP ]]'''===&lt;br /&gt;
==='''[[GRUB]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' H ''' ==&lt;br /&gt;
==='''[[Hacking-Methoden]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' I ''' ==&lt;br /&gt;
==='''[[Image mount]]'''===&lt;br /&gt;
==='''[[IP]]'''===&lt;br /&gt;
==='''[[IT Berufstitel]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' J ''' ==&lt;br /&gt;
==='''[[Jenkins]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' K ''' ==&lt;br /&gt;
==='''[[KanBoard]]'''===&lt;br /&gt;
==='''[[Kate]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' L ''' ==&lt;br /&gt;
==='''[[Linux Build]]'''===&lt;br /&gt;
==='''[[Luks]]'''===&lt;br /&gt;
==='''[[LXC LXD]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' M ''' ==&lt;br /&gt;
==='''[[MariaDB]]'''===&lt;br /&gt;
==='''[[MediaWiki]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' N ''' ==&lt;br /&gt;
==='''[[NFT]]'''===&lt;br /&gt;
==='''[[NMAP]]'''===&lt;br /&gt;
==='''[[NTFS]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' O ''' ==&lt;br /&gt;
==='''[[OpSec]]'''===&lt;br /&gt;
==='''[[OpenSSL]]'''===&lt;br /&gt;
==='''[[Oracle]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' P ''' ==&lt;br /&gt;
==='''[[PATH]]'''===&lt;br /&gt;
==='''[[PHP]]'''===&lt;br /&gt;
==='''[[Prometheus]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Q ''' ==&lt;br /&gt;
==='''[[quantum attacks]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' R ''' ==&lt;br /&gt;
==='''[[RSYNC]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' S ''' ==&lt;br /&gt;
==='''[[Scrum]]'''===&lt;br /&gt;
==='''[[Secure-Hash-Cookie]]'''===&lt;br /&gt;
==='''[[snap-snapd-snappy]]'''===&lt;br /&gt;
==='''[[SQL]]'''===&lt;br /&gt;
==='''[[ssh]]'''===&lt;br /&gt;
==='''[[SQL TUNING]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' T ''' ==&lt;br /&gt;
==='''[[TAR]]'''===&lt;br /&gt;
==='''[[TCPIP]]'''===&lt;br /&gt;
==='''[[TWRP]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' U ''' ==&lt;br /&gt;
==='''[[UUID]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' V ''' ==&lt;br /&gt;
==='''[[Vagrant]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' W ''' ==&lt;br /&gt;
==='''[[WEBRTC]]'''===&lt;br /&gt;
==='''[[Wireshark]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Y ''' ==&lt;br /&gt;
==='''[[Youtube]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Z ''' ==&lt;br /&gt;
==='''[[z4o]]'''===&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Z4o&amp;diff=1138</id>
		<title>Z4o</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Z4o&amp;diff=1138"/>
		<updated>2023-09-30T17:07:52Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== z4o GNU/Linux OS ==&lt;br /&gt;
&lt;br /&gt;
'''z4o a linux distribution, powered by Blockchain Office'''&lt;br /&gt;
&lt;br /&gt;
https://z4o.de/&lt;br /&gt;
&lt;br /&gt;
 '' Install minimal os(deb 10.X , on 4GB)''&lt;br /&gt;
 '' clone 4GB Image''&lt;br /&gt;
&lt;br /&gt;
 '' Config ''&lt;br /&gt;
 '' 1. List/Show network devices ''&lt;br /&gt;
 '' 2. DHCP =&amp;gt; '''/etc/network/interfaces''' ''&lt;br /&gt;
 '' 3. APT Lists =&amp;gt; '''/etc/apt/sources.list''' ''&lt;br /&gt;
 '' 4. apt update &amp;amp; upgrade ''&lt;br /&gt;
 '' 5. disable the Lid Switch =&amp;gt; '''/etc/systemd/logind.conf''' ''&lt;br /&gt;
    If you just want to prevent suspending when the lid is closed you can set the following options&lt;br /&gt;
    '''HandleLidSwitch=ignore''' &lt;br /&gt;
    '''HandleLidSwitchDocked=ignore''' &lt;br /&gt;
    Then run '''systemctl restart systemd-logind.service''' or reboot&lt;br /&gt;
 '' 6. Logs and Kernel Messages&lt;br /&gt;
       1. dmesg&lt;br /&gt;
       2. journalctl -b -k&lt;br /&gt;
 '' 7. Grub ''&lt;br /&gt;
  su - root instead of su root&lt;br /&gt;
  /etc/default/grub&lt;br /&gt;
  '''update-grub'''&lt;br /&gt;
  '''grub-mkconfig'''&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=PATH&amp;diff=1137</id>
		<title>PATH</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=PATH&amp;diff=1137"/>
		<updated>2023-07-09T08:56:50Z</updated>

		<summary type="html">&lt;p&gt;Geist: Die Seite wurde neu angelegt: „https://unix.stackexchange.com/a/750958“&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;https://unix.stackexchange.com/a/750958&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Hauptseite&amp;diff=1136</id>
		<title>Hauptseite</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Hauptseite&amp;diff=1136"/>
		<updated>2023-07-09T08:56:32Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' A ''' ==&lt;br /&gt;
==='''[[ADB]]'''===&lt;br /&gt;
==='''[[Agile]]'''===&lt;br /&gt;
==='''[[Alpine]]'''===&lt;br /&gt;
==='''[[Apache]]'''===&lt;br /&gt;
==='''[[Anacron]]'''===&lt;br /&gt;
==='''[[Android]]'''===&lt;br /&gt;
==='''[[apt sources.list]]'''===&lt;br /&gt;
==='''[[apt]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' B ''' ==&lt;br /&gt;
==='''[[Backup]]'''===&lt;br /&gt;
==='''[[bash]]'''===&lt;br /&gt;
==='''[[Bitcoin]]'''===&lt;br /&gt;
==='''[[blkid]]'''===&lt;br /&gt;
==='''[[Blockchain]]'''===&lt;br /&gt;
==='''[[Blockchain Office]]'''===&lt;br /&gt;
==='''[[Borg]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' C ''' ==&lt;br /&gt;
==='''[[Cookie]]'''===&lt;br /&gt;
==='''[[Cron]]'''===&lt;br /&gt;
==='''[[Crypto]]'''===&lt;br /&gt;
==='''[[Cryptographic Hash Algorithm]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' D ''' ==&lt;br /&gt;
==='''[[Debian]]'''===&lt;br /&gt;
==='''[[DevOps]]'''===&lt;br /&gt;
==='''[[Docker]]'''===&lt;br /&gt;
==='''[[Dockerfile]]===&lt;br /&gt;
==='''[[Dolphin KDE]]===&lt;br /&gt;
&lt;br /&gt;
== ''' F ''' ==&lt;br /&gt;
==='''[[Fail2Ban]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' G ''' ==&lt;br /&gt;
==='''[[Git]]'''===&lt;br /&gt;
==='''[[GNU/LINUX]]'''===&lt;br /&gt;
==='''[[ GnuPG/OpenPGP/PGP ]]'''===&lt;br /&gt;
==='''[[GRUB]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' H ''' ==&lt;br /&gt;
==='''[[Hacking-Methoden]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' I ''' ==&lt;br /&gt;
==='''[[Image mount]]'''===&lt;br /&gt;
==='''[[IP]]'''===&lt;br /&gt;
==='''[[IT Berufstitel]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' J ''' ==&lt;br /&gt;
==='''[[Jenkins]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' K ''' ==&lt;br /&gt;
==='''[[KanBoard]]'''===&lt;br /&gt;
==='''[[Kate]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' L ''' ==&lt;br /&gt;
==='''[[Linux Build]]'''===&lt;br /&gt;
==='''[[Luks]]'''===&lt;br /&gt;
==='''[[LXC LXD]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' M ''' ==&lt;br /&gt;
==='''[[MariaDB]]'''===&lt;br /&gt;
==='''[[MediaWiki]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' N ''' ==&lt;br /&gt;
==='''[[NFT]]'''===&lt;br /&gt;
==='''[[NMAP]]'''===&lt;br /&gt;
==='''[[NTFS]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' O ''' ==&lt;br /&gt;
==='''[[OpSec]]'''===&lt;br /&gt;
==='''[[OpenSSL]]'''===&lt;br /&gt;
==='''[[Oracle]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' P ''' ==&lt;br /&gt;
==='''[[PATH]]'''===&lt;br /&gt;
==='''[[PHP]]'''===&lt;br /&gt;
==='''[[Prometheus]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Q ''' ==&lt;br /&gt;
==='''[[quantum attacks]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' R ''' ==&lt;br /&gt;
==='''[[RSYNC]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' S ''' ==&lt;br /&gt;
==='''[[Scrum]]'''===&lt;br /&gt;
==='''[[Secure-Hash-Cookie]]'''===&lt;br /&gt;
==='''[[snap-snapd-snappy]]'''===&lt;br /&gt;
==='''[[SQL]]'''===&lt;br /&gt;
==='''[[ssh]]'''===&lt;br /&gt;
==='''[[SQL TUNING]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' T ''' ==&lt;br /&gt;
==='''[[TAR]]'''===&lt;br /&gt;
==='''[[TCPIP]]'''===&lt;br /&gt;
==='''[[TWRP]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' U ''' ==&lt;br /&gt;
==='''[[UUID]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' V ''' ==&lt;br /&gt;
==='''[[Vagrant]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' W ''' ==&lt;br /&gt;
==='''[[WEBRTC]]'''===&lt;br /&gt;
==='''[[Wireshark]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Y ''' ==&lt;br /&gt;
==='''[[Youtube]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Z ''' ==&lt;br /&gt;
==='''[[z4o]]'''===&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Cookie&amp;diff=1135</id>
		<title>Cookie</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Cookie&amp;diff=1135"/>
		<updated>2023-06-27T16:26:26Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Cookies sind kleine Textdateien, die von einer Website auf deinem Computer oder Mobilgerät gespeichert werden, wenn du die Website besuchst. Sie dienen dazu, Informationen über deine Aktivitäten auf der Website zu speichern, wie z.B. deine Login-Daten, deine bevorzugte Sprache oder Artikel in deinem Warenkorb. Cookies können auch von Dritten, wie z.B. Werbetreibenden, genutzt werden, um dein Nutzerverhalten im Internet zu verfolgen und gezielt Werbung auszuspielen. Du kannst Cookies in deinen Browser-Einstellungen verwalten oder löschen.&lt;br /&gt;
&lt;br /&gt;
Cookies sind also kleine Dateien, die von Webseiten genutzt werden, um bestimmte Informationen über deinen Besuch auf der Webseite zu speichern. Die meisten Websites setzen Cookies ein, um deine Nutzungserfahrung zu verbessern, indem sie beispielsweise deine bevorzugten Spracheinstellungen speichern oder dich automatisch anmelden, wenn du die Website erneut besuchst.&lt;br /&gt;
&lt;br /&gt;
Cookies können jedoch auch von Dritten, wie z.B. Werbetreibenden, eingesetzt werden, um deine Internetnutzung zu verfolgen und dir gezielte Werbung zu präsentieren. Diese Cookies werden oft als &amp;quot;Tracking-Cookies&amp;quot; bezeichnet.&lt;br /&gt;
&lt;br /&gt;
Es gibt verschiedene Arten von Cookies, darunter &amp;quot;Session-Cookies&amp;quot;, die nur während deines Besuchs auf der Website gespeichert werden und danach gelöscht werden, sowie &amp;quot;Persistent-Cookies&amp;quot;, die längerfristig auf deinem Gerät gespeichert bleiben. Cookies können auch auf verschiedene Weise klassifiziert werden, je nachdem, wer sie setzt oder wie sie genutzt werden.&lt;br /&gt;
&lt;br /&gt;
Obwohl Cookies hilfreich sein können, um deine Nutzungserfahrung zu verbessern, gibt es auch Bedenken hinsichtlich des Datenschutzes und der Privatsphäre. Aus diesem Grund gibt es heute strengere Vorschriften für die Verwendung von Cookies, insbesondere in der EU, und Websites müssen ihre Nutzer transparent darüber informieren, welche Arten von Cookies sie setzen und warum.&lt;br /&gt;
&lt;br /&gt;
Cookies von Dritten werden normalerweise von Werbenetzwerken oder Analyse-Tools genutzt, die auf vielen Websites präsent sind. Wenn du eine Website besuchst, die Cookies von Dritten verwendet, können diese Cookies Informationen über deine Internetnutzung sammeln, wie z.B. welche Seiten du besucht hast, welche Produkte du angesehen hast oder welche Suchanfragen du gestellt hast. Diese Informationen werden dann genutzt, um dir gezielte Werbung auf anderen Websites zu präsentieren oder um Erkenntnisse über das Nutzerverhalten zu gewinnen.&lt;br /&gt;
&lt;br /&gt;
Ein Beispiel: Wenn du eine Website besuchst, die Produkte zum Thema Fitness verkauft, kann ein Werbenetzwerk, das Cookies von Dritten nutzt, diese Informationen sammeln und dir anschließend gezielte Werbung für Fitnessprodukte auf anderen Websites präsentieren, die dieses Netzwerk unterstützt.&lt;br /&gt;
&lt;br /&gt;
Es ist wichtig zu beachten, dass die Verwendung von Cookies von Dritten auch Bedenken hinsichtlich der Privatsphäre aufwirft. Wenn du jedoch deine Cookies regelmäßig löschst oder einen Ad-Blocker verwendest, kannst du die Verwendung von Cookies von Dritten einschränken oder verhindern.&lt;br /&gt;
&lt;br /&gt;
Es gibt verschiedene Arten von Cookies, die für unterschiedliche Zwecke eingesetzt werden. Hier sind einige der häufigsten Arten von Cookies:&lt;br /&gt;
&lt;br /&gt;
 '''Session-Cookies:''' &lt;br /&gt;
 Diese werden nur für die Dauer deines Besuchs auf einer Website gespeichert und automatisch gelöscht, sobald du den Browser schließt.&lt;br /&gt;
&lt;br /&gt;
 '''Persistent-Cookies:''' &lt;br /&gt;
 Diese bleiben auf deinem Gerät gespeichert, auch nachdem du den Browser geschlossen hast. Sie können für verschiedene Zwecke verwendet werden, wie z.B. um dich bei einem nächsten Besuch automatisch anzumelden oder um deine Präferenzen zu speichern.&lt;br /&gt;
&lt;br /&gt;
 '''Erstanbieter-Cookies:''' &lt;br /&gt;
 Diese werden von der Website gesetzt, die du besuchst, und werden für verschiedene Zwecke verwendet, wie z.B. um deine Einstellungen oder deine Einkaufswageninformationen zu speichern.&lt;br /&gt;
&lt;br /&gt;
 '''Drittanbieter-Cookies:'''&lt;br /&gt;
 Diese werden von anderen Websites oder Dienstleistungen gesetzt, die mit der von dir besuchten Website zusammenarbeiten, um Informationen zu sammeln oder Werbung zu schalten.&lt;br /&gt;
&lt;br /&gt;
 '''Analyse-Cookies:''' &lt;br /&gt;
 Diese werden verwendet, um Informationen über die Nutzung einer Website zu sammeln, wie z.B. welche Seiten besucht wurden und wie lange du auf einer bestimmten Seite verweilt hast.&lt;br /&gt;
&lt;br /&gt;
 '''Werbe-Cookies:''' &lt;br /&gt;
 Diese werden verwendet, um gezielte Werbung auf der Grundlage deiner Interessen und deines Nutzungsverhaltens zu schalten.&lt;br /&gt;
&lt;br /&gt;
Es ist wichtig zu beachten, dass einige Cookies für das ordnungsgemäße Funktionieren einer Website notwendig sind, während andere optional sind und in einigen Fällen deaktiviert werden können.&lt;br /&gt;
&lt;br /&gt;
Cookies können auch in verschiedene Kategorien eingeteilt werden, je nach ihrem Zweck oder ihrer Funktionsweise. Hier sind einige weitere Arten von Cookies:&lt;br /&gt;
&lt;br /&gt;
 '''Authentifizierungs-Cookies: '''&lt;br /&gt;
 Diese werden verwendet, um Benutzer bei der Anmeldung auf einer Website zu identifizieren und zu authentifizieren.&lt;br /&gt;
&lt;br /&gt;
 '''Sicherheits-Cookies: '''&lt;br /&gt;
 Diese werden verwendet, um die Sicherheit einer Website zu verbessern, indem sie bösartige Aktivitäten oder unbefugte Zugriffe erkennen und verhindern.&lt;br /&gt;
&lt;br /&gt;
 '''Personalisierungs-Cookies: '''&lt;br /&gt;
 Diese werden verwendet, um deine Präferenzen auf einer Website zu speichern, wie z.B. deine bevorzugte Sprache oder das Aussehen der Website.&lt;br /&gt;
&lt;br /&gt;
 '''Social-Media-Cookies: '''&lt;br /&gt;
 Diese werden von Social-Media-Websites wie Facebook oder Twitter gesetzt, um es dir zu ermöglichen, Inhalte auf diesen Plattformen zu teilen oder dich anzumelden.&lt;br /&gt;
&lt;br /&gt;
 '''Performance-Cookies:''' &lt;br /&gt;
 Diese werden verwendet, um die Leistung einer Website zu verbessern, indem sie Informationen über die Geschwindigkeit und Stabilität der Website sammeln.&lt;br /&gt;
&lt;br /&gt;
 '''Pixel-Tags:''' &lt;br /&gt;
 Diese sind winzige Bilder oder Codeschnipsel, die in einer Website eingebettet sind und ähnlich wie Cookies verwendet werden, um Informationen über die Besucher zu sammeln.&lt;br /&gt;
&lt;br /&gt;
Es ist wichtig zu betonen, dass Cookies zwar nützlich sein können, aber auch Datenschutzbedenken aufwerfen können. Aus diesem Grund haben viele Länder und Regionen, wie die Europäische Union, Gesetze und Vorschriften zum Schutz der Privatsphäre der Nutzer erlassen, die die Verwendung von Cookies regulieren.&lt;br /&gt;
&lt;br /&gt;
Das Vermeiden von Cross-Site-Scripting-Angriffen oder das Verhindern von Session-Fixation-Angriffen in PHP-Cookies kann durch folgende Maßnahmen erreicht werden:&lt;br /&gt;
&lt;br /&gt;
 Verwendung von HTTP-Only-Cookies: Durch das Setzen des HTTP-Only-Flags beim Erstellen von Cookies kann verhindert werden, dass Cookies von JavaScript ausgelesen oder manipuliert werden. Dies kann Cross-Site-Scripting-Angriffe verhindern&lt;br /&gt;
&lt;br /&gt;
Hier sind alle Parameter, die Sie mit der setcookie()-Funktion in PHP setzen können:&lt;br /&gt;
    $name (erforderlich): Der Name des Cookies.&lt;br /&gt;
    $value (optional): Der Wert des Cookies. Standardmäßig ist dieser Parameter auf einen leeren String gesetzt.&lt;br /&gt;
    $expires (optional): Das Ablaufdatum des Cookies als Unix-Zeitstempel (Anzahl der Sekunden seit dem 1. Januar 1970 00:00:00 UTC). Wenn dieser Parameter nicht angegeben wird oder auf 0 gesetzt ist, wird das Cookie beim Schließen des Browsers gelöscht.&lt;br /&gt;
    $path (optional): Der Pfad, auf dem das Cookie verfügbar sein soll. Wenn dieser Parameter nicht angegeben wird, wird der Pfad des aktuellen Skripts verwendet.&lt;br /&gt;
    $domain (optional): Die Domain, auf der das Cookie verfügbar sein soll. Wenn dieser Parameter nicht angegeben wird, wird die Domain des aktuellen Servers verwendet.&lt;br /&gt;
    $secure (optional): Gibt an, ob das Cookie nur über eine sichere Verbindung (HTTPS) übertragen werden soll. Standardmäßig ist dieser Parameter auf false gesetzt.&lt;br /&gt;
    $httponly (optional): Gibt an, ob das Cookie nur über HTTP(S) und nicht von JavaScript oder anderen Skripten ausgelesen werden kann. Standardmäßig ist dieser Parameter auf false gesetzt. Beachten Sie, dass einige ältere Browser dieses Flag nicht unterstützen.&lt;br /&gt;
    $samesite (optional): Steuert, ob das Cookie beim Aufruf einer Seite von einer anderen Website aus gesendet werden soll, um Cross-Site-Request-Forgery (CSRF) Angriffe zu verhindern. $samesite kann die Werte &amp;quot;None&amp;quot;, &amp;quot;Lax&amp;quot; oder &amp;quot;Strict&amp;quot; annehmen. Wenn dieser Parameter nicht angegeben wird, wird das Cookie standardmäßig im Lax-Modus gesendet.&lt;br /&gt;
&lt;br /&gt;
Hinweis: Die setcookie()-Funktion sollte immer vor jeglicher Ausgabe von Inhalten an den Browser aufgerufen werden, da sonst ein &amp;quot;headers already sent&amp;quot; - Fehler auftreten kann.&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Cookie&amp;diff=1134</id>
		<title>Cookie</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Cookie&amp;diff=1134"/>
		<updated>2023-06-27T16:25:03Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Cookies sind kleine Textdateien, die von einer Website auf deinem Computer oder Mobilgerät gespeichert werden, wenn du die Website besuchst. Sie dienen dazu, Informationen über deine Aktivitäten auf der Website zu speichern, wie z.B. deine Login-Daten, deine bevorzugte Sprache oder Artikel in deinem Warenkorb. Cookies können auch von Dritten, wie z.B. Werbetreibenden, genutzt werden, um dein Nutzerverhalten im Internet zu verfolgen und gezielt Werbung auszuspielen. Du kannst Cookies in deinen Browser-Einstellungen verwalten oder löschen.&lt;br /&gt;
&lt;br /&gt;
Cookies sind also kleine Dateien, die von Webseiten genutzt werden, um bestimmte Informationen über deinen Besuch auf der Webseite zu speichern. Die meisten Websites setzen Cookies ein, um deine Nutzungserfahrung zu verbessern, indem sie beispielsweise deine bevorzugten Spracheinstellungen speichern oder dich automatisch anmelden, wenn du die Website erneut besuchst.&lt;br /&gt;
&lt;br /&gt;
Cookies können jedoch auch von Dritten, wie z.B. Werbetreibenden, eingesetzt werden, um deine Internetnutzung zu verfolgen und dir gezielte Werbung zu präsentieren. Diese Cookies werden oft als &amp;quot;Tracking-Cookies&amp;quot; bezeichnet.&lt;br /&gt;
&lt;br /&gt;
Es gibt verschiedene Arten von Cookies, darunter &amp;quot;Session-Cookies&amp;quot;, die nur während deines Besuchs auf der Website gespeichert werden und danach gelöscht werden, sowie &amp;quot;Persistent-Cookies&amp;quot;, die längerfristig auf deinem Gerät gespeichert bleiben. Cookies können auch auf verschiedene Weise klassifiziert werden, je nachdem, wer sie setzt oder wie sie genutzt werden.&lt;br /&gt;
&lt;br /&gt;
Obwohl Cookies hilfreich sein können, um deine Nutzungserfahrung zu verbessern, gibt es auch Bedenken hinsichtlich des Datenschutzes und der Privatsphäre. Aus diesem Grund gibt es heute strengere Vorschriften für die Verwendung von Cookies, insbesondere in der EU, und Websites müssen ihre Nutzer transparent darüber informieren, welche Arten von Cookies sie setzen und warum.&lt;br /&gt;
&lt;br /&gt;
Cookies von Dritten werden normalerweise von Werbenetzwerken oder Analyse-Tools genutzt, die auf vielen Websites präsent sind. Wenn du eine Website besuchst, die Cookies von Dritten verwendet, können diese Cookies Informationen über deine Internetnutzung sammeln, wie z.B. welche Seiten du besucht hast, welche Produkte du angesehen hast oder welche Suchanfragen du gestellt hast. Diese Informationen werden dann genutzt, um dir gezielte Werbung auf anderen Websites zu präsentieren oder um Erkenntnisse über das Nutzerverhalten zu gewinnen.&lt;br /&gt;
&lt;br /&gt;
Ein Beispiel: Wenn du eine Website besuchst, die Produkte zum Thema Fitness verkauft, kann ein Werbenetzwerk, das Cookies von Dritten nutzt, diese Informationen sammeln und dir anschließend gezielte Werbung für Fitnessprodukte auf anderen Websites präsentieren, die dieses Netzwerk unterstützt.&lt;br /&gt;
&lt;br /&gt;
Es ist wichtig zu beachten, dass die Verwendung von Cookies von Dritten auch Bedenken hinsichtlich der Privatsphäre aufwirft. Wenn du jedoch deine Cookies regelmäßig löschst oder einen Ad-Blocker verwendest, kannst du die Verwendung von Cookies von Dritten einschränken oder verhindern.&lt;br /&gt;
&lt;br /&gt;
Es gibt verschiedene Arten von Cookies, die für unterschiedliche Zwecke eingesetzt werden. Hier sind einige der häufigsten Arten von Cookies:&lt;br /&gt;
&lt;br /&gt;
 '''Session-Cookies:''' &lt;br /&gt;
 Diese werden nur für die Dauer deines Besuchs auf einer Website gespeichert und automatisch gelöscht, sobald du den Browser schließt.&lt;br /&gt;
&lt;br /&gt;
 '''Persistent-Cookies:''' &lt;br /&gt;
 Diese bleiben auf deinem Gerät gespeichert, auch nachdem du den Browser geschlossen hast. Sie können für verschiedene Zwecke verwendet werden, wie z.B. um dich bei einem nächsten Besuch automatisch anzumelden oder um deine Präferenzen zu speichern.&lt;br /&gt;
&lt;br /&gt;
 '''Erstanbieter-Cookies:''' &lt;br /&gt;
 Diese werden von der Website gesetzt, die du besuchst, und werden für verschiedene Zwecke verwendet, wie z.B. um deine Einstellungen oder deine Einkaufswageninformationen zu speichern.&lt;br /&gt;
&lt;br /&gt;
 '''Drittanbieter-Cookies:'''&lt;br /&gt;
 Diese werden von anderen Websites oder Dienstleistungen gesetzt, die mit der von dir besuchten Website zusammenarbeiten, um Informationen zu sammeln oder Werbung zu schalten.&lt;br /&gt;
&lt;br /&gt;
 '''Analyse-Cookies:''' &lt;br /&gt;
 Diese werden verwendet, um Informationen über die Nutzung einer Website zu sammeln, wie z.B. welche Seiten besucht wurden und wie lange du auf einer bestimmten Seite verweilt hast.&lt;br /&gt;
&lt;br /&gt;
 '''Werbe-Cookies:''' &lt;br /&gt;
 Diese werden verwendet, um gezielte Werbung auf der Grundlage deiner Interessen und deines Nutzungsverhaltens zu schalten.&lt;br /&gt;
&lt;br /&gt;
Es ist wichtig zu beachten, dass einige Cookies für das ordnungsgemäße Funktionieren einer Website notwendig sind, während andere optional sind und in einigen Fällen deaktiviert werden können.&lt;br /&gt;
&lt;br /&gt;
Cookies können auch in verschiedene Kategorien eingeteilt werden, je nach ihrem Zweck oder ihrer Funktionsweise. Hier sind einige weitere Arten von Cookies:&lt;br /&gt;
&lt;br /&gt;
 '''Authentifizierungs-Cookies: '''&lt;br /&gt;
 Diese werden verwendet, um Benutzer bei der Anmeldung auf einer Website zu identifizieren und zu authentifizieren.&lt;br /&gt;
&lt;br /&gt;
 '''Sicherheits-Cookies: '''&lt;br /&gt;
 Diese werden verwendet, um die Sicherheit einer Website zu verbessern, indem sie bösartige Aktivitäten oder unbefugte Zugriffe erkennen und verhindern.&lt;br /&gt;
&lt;br /&gt;
 '''Personalisierungs-Cookies: '''&lt;br /&gt;
 Diese werden verwendet, um deine Präferenzen auf einer Website zu speichern, wie z.B. deine bevorzugte Sprache oder das Aussehen der Website.&lt;br /&gt;
&lt;br /&gt;
 '''Social-Media-Cookies: '''&lt;br /&gt;
 Diese werden von Social-Media-Websites wie Facebook oder Twitter gesetzt, um es dir zu ermöglichen, Inhalte auf diesen Plattformen zu teilen oder dich anzumelden.&lt;br /&gt;
&lt;br /&gt;
 '''Performance-Cookies:''' &lt;br /&gt;
 Diese werden verwendet, um die Leistung einer Website zu verbessern, indem sie Informationen über die Geschwindigkeit und Stabilität der Website sammeln.&lt;br /&gt;
&lt;br /&gt;
 '''Pixel-Tags:''' &lt;br /&gt;
 Diese sind winzige Bilder oder Codeschnipsel, die in einer Website eingebettet sind und ähnlich wie Cookies verwendet werden, um Informationen über die Besucher zu sammeln.&lt;br /&gt;
&lt;br /&gt;
Es ist wichtig zu betonen, dass Cookies zwar nützlich sein können, aber auch Datenschutzbedenken aufwerfen können. Aus diesem Grund haben viele Länder und Regionen, wie die Europäische Union, Gesetze und Vorschriften zum Schutz der Privatsphäre der Nutzer erlassen, die die Verwendung von Cookies regulieren.&lt;br /&gt;
&lt;br /&gt;
Das Vermeiden von Cross-Site-Scripting-Angriffen oder das Verhindern von Session-Fixation-Angriffen in PHP-Cookies kann durch folgende Maßnahmen erreicht werden:&lt;br /&gt;
&lt;br /&gt;
 Verwendung von HTTP-Only-Cookies: Durch das Setzen des HTTP-Only-Flags beim Erstellen von Cookies kann verhindert werden, dass Cookies von JavaScript ausgelesen oder manipuliert werden. Dies kann Cross-Site-Scripting-Angriffe verhindern&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Cookie&amp;diff=1133</id>
		<title>Cookie</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Cookie&amp;diff=1133"/>
		<updated>2023-06-27T16:20:01Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Cookies sind kleine Textdateien, die von einer Website auf deinem Computer oder Mobilgerät gespeichert werden, wenn du die Website besuchst. Sie dienen dazu, Informationen über deine Aktivitäten auf der Website zu speichern, wie z.B. deine Login-Daten, deine bevorzugte Sprache oder Artikel in deinem Warenkorb. Cookies können auch von Dritten, wie z.B. Werbetreibenden, genutzt werden, um dein Nutzerverhalten im Internet zu verfolgen und gezielt Werbung auszuspielen. Du kannst Cookies in deinen Browser-Einstellungen verwalten oder löschen.&lt;br /&gt;
&lt;br /&gt;
Cookies sind also kleine Dateien, die von Webseiten genutzt werden, um bestimmte Informationen über deinen Besuch auf der Webseite zu speichern. Die meisten Websites setzen Cookies ein, um deine Nutzungserfahrung zu verbessern, indem sie beispielsweise deine bevorzugten Spracheinstellungen speichern oder dich automatisch anmelden, wenn du die Website erneut besuchst.&lt;br /&gt;
&lt;br /&gt;
Cookies können jedoch auch von Dritten, wie z.B. Werbetreibenden, eingesetzt werden, um deine Internetnutzung zu verfolgen und dir gezielte Werbung zu präsentieren. Diese Cookies werden oft als &amp;quot;Tracking-Cookies&amp;quot; bezeichnet.&lt;br /&gt;
&lt;br /&gt;
Es gibt verschiedene Arten von Cookies, darunter &amp;quot;Session-Cookies&amp;quot;, die nur während deines Besuchs auf der Website gespeichert werden und danach gelöscht werden, sowie &amp;quot;Persistent-Cookies&amp;quot;, die längerfristig auf deinem Gerät gespeichert bleiben. Cookies können auch auf verschiedene Weise klassifiziert werden, je nachdem, wer sie setzt oder wie sie genutzt werden.&lt;br /&gt;
&lt;br /&gt;
Obwohl Cookies hilfreich sein können, um deine Nutzungserfahrung zu verbessern, gibt es auch Bedenken hinsichtlich des Datenschutzes und der Privatsphäre. Aus diesem Grund gibt es heute strengere Vorschriften für die Verwendung von Cookies, insbesondere in der EU, und Websites müssen ihre Nutzer transparent darüber informieren, welche Arten von Cookies sie setzen und warum.&lt;br /&gt;
&lt;br /&gt;
Cookies von Dritten werden normalerweise von Werbenetzwerken oder Analyse-Tools genutzt, die auf vielen Websites präsent sind. Wenn du eine Website besuchst, die Cookies von Dritten verwendet, können diese Cookies Informationen über deine Internetnutzung sammeln, wie z.B. welche Seiten du besucht hast, welche Produkte du angesehen hast oder welche Suchanfragen du gestellt hast. Diese Informationen werden dann genutzt, um dir gezielte Werbung auf anderen Websites zu präsentieren oder um Erkenntnisse über das Nutzerverhalten zu gewinnen.&lt;br /&gt;
&lt;br /&gt;
Ein Beispiel: Wenn du eine Website besuchst, die Produkte zum Thema Fitness verkauft, kann ein Werbenetzwerk, das Cookies von Dritten nutzt, diese Informationen sammeln und dir anschließend gezielte Werbung für Fitnessprodukte auf anderen Websites präsentieren, die dieses Netzwerk unterstützt.&lt;br /&gt;
&lt;br /&gt;
Es ist wichtig zu beachten, dass die Verwendung von Cookies von Dritten auch Bedenken hinsichtlich der Privatsphäre aufwirft. Wenn du jedoch deine Cookies regelmäßig löschst oder einen Ad-Blocker verwendest, kannst du die Verwendung von Cookies von Dritten einschränken oder verhindern.&lt;br /&gt;
&lt;br /&gt;
Es gibt verschiedene Arten von Cookies, die für unterschiedliche Zwecke eingesetzt werden. Hier sind einige der häufigsten Arten von Cookies:&lt;br /&gt;
&lt;br /&gt;
 '''Session-Cookies:''' &lt;br /&gt;
 Diese werden nur für die Dauer deines Besuchs auf einer Website gespeichert und automatisch gelöscht, sobald du den Browser schließt.&lt;br /&gt;
&lt;br /&gt;
 '''Persistent-Cookies:''' &lt;br /&gt;
 Diese bleiben auf deinem Gerät gespeichert, auch nachdem du den Browser geschlossen hast. Sie können für verschiedene Zwecke verwendet werden, wie z.B. um dich bei einem nächsten Besuch automatisch anzumelden oder um deine Präferenzen zu speichern.&lt;br /&gt;
&lt;br /&gt;
 '''Erstanbieter-Cookies:''' &lt;br /&gt;
 Diese werden von der Website gesetzt, die du besuchst, und werden für verschiedene Zwecke verwendet, wie z.B. um deine Einstellungen oder deine Einkaufswageninformationen zu speichern.&lt;br /&gt;
&lt;br /&gt;
 '''Drittanbieter-Cookies:'''&lt;br /&gt;
 Diese werden von anderen Websites oder Dienstleistungen gesetzt, die mit der von dir besuchten Website zusammenarbeiten, um Informationen zu sammeln oder Werbung zu schalten.&lt;br /&gt;
&lt;br /&gt;
 '''Analyse-Cookies:''' &lt;br /&gt;
 Diese werden verwendet, um Informationen über die Nutzung einer Website zu sammeln, wie z.B. welche Seiten besucht wurden und wie lange du auf einer bestimmten Seite verweilt hast.&lt;br /&gt;
&lt;br /&gt;
 '''Werbe-Cookies:''' &lt;br /&gt;
 Diese werden verwendet, um gezielte Werbung auf der Grundlage deiner Interessen und deines Nutzungsverhaltens zu schalten.&lt;br /&gt;
&lt;br /&gt;
Es ist wichtig zu beachten, dass einige Cookies für das ordnungsgemäße Funktionieren einer Website notwendig sind, während andere optional sind und in einigen Fällen deaktiviert werden können.&lt;br /&gt;
&lt;br /&gt;
Cookies können auch in verschiedene Kategorien eingeteilt werden, je nach ihrem Zweck oder ihrer Funktionsweise. Hier sind einige weitere Arten von Cookies:&lt;br /&gt;
&lt;br /&gt;
 '''Authentifizierungs-Cookies: '''&lt;br /&gt;
 Diese werden verwendet, um Benutzer bei der Anmeldung auf einer Website zu identifizieren und zu authentifizieren.&lt;br /&gt;
&lt;br /&gt;
 '''Sicherheits-Cookies: '''&lt;br /&gt;
 Diese werden verwendet, um die Sicherheit einer Website zu verbessern, indem sie bösartige Aktivitäten oder unbefugte Zugriffe erkennen und verhindern.&lt;br /&gt;
&lt;br /&gt;
 '''Personalisierungs-Cookies: '''&lt;br /&gt;
 Diese werden verwendet, um deine Präferenzen auf einer Website zu speichern, wie z.B. deine bevorzugte Sprache oder das Aussehen der Website.&lt;br /&gt;
&lt;br /&gt;
 '''Social-Media-Cookies: '''&lt;br /&gt;
 Diese werden von Social-Media-Websites wie Facebook oder Twitter gesetzt, um es dir zu ermöglichen, Inhalte auf diesen Plattformen zu teilen oder dich anzumelden.&lt;br /&gt;
&lt;br /&gt;
 '''Performance-Cookies:''' &lt;br /&gt;
 Diese werden verwendet, um die Leistung einer Website zu verbessern, indem sie Informationen über die Geschwindigkeit und Stabilität der Website sammeln.&lt;br /&gt;
&lt;br /&gt;
 '''Pixel-Tags:''' &lt;br /&gt;
 Diese sind winzige Bilder oder Codeschnipsel, die in einer Website eingebettet sind und ähnlich wie Cookies verwendet werden, um Informationen über die Besucher zu sammeln.&lt;br /&gt;
&lt;br /&gt;
Es ist wichtig zu betonen, dass Cookies zwar nützlich sein können, aber auch Datenschutzbedenken aufwerfen können. Aus diesem Grund haben viele Länder und Regionen, wie die Europäische Union, Gesetze und Vorschriften zum Schutz der Privatsphäre der Nutzer erlassen, die die Verwendung von Cookies regulieren.&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Cookie&amp;diff=1132</id>
		<title>Cookie</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Cookie&amp;diff=1132"/>
		<updated>2023-06-27T16:18:19Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Cookies sind kleine Textdateien, die von einer Website auf deinem Computer oder Mobilgerät gespeichert werden, wenn du die Website besuchst. Sie dienen dazu, Informationen über deine Aktivitäten auf der Website zu speichern, wie z.B. deine Login-Daten, deine bevorzugte Sprache oder Artikel in deinem Warenkorb. Cookies können auch von Dritten, wie z.B. Werbetreibenden, genutzt werden, um dein Nutzerverhalten im Internet zu verfolgen und gezielt Werbung auszuspielen. Du kannst Cookies in deinen Browser-Einstellungen verwalten oder löschen.&lt;br /&gt;
&lt;br /&gt;
Cookies sind also kleine Dateien, die von Webseiten genutzt werden, um bestimmte Informationen über deinen Besuch auf der Webseite zu speichern. Die meisten Websites setzen Cookies ein, um deine Nutzungserfahrung zu verbessern, indem sie beispielsweise deine bevorzugten Spracheinstellungen speichern oder dich automatisch anmelden, wenn du die Website erneut besuchst.&lt;br /&gt;
&lt;br /&gt;
Cookies können jedoch auch von Dritten, wie z.B. Werbetreibenden, eingesetzt werden, um deine Internetnutzung zu verfolgen und dir gezielte Werbung zu präsentieren. Diese Cookies werden oft als &amp;quot;Tracking-Cookies&amp;quot; bezeichnet.&lt;br /&gt;
&lt;br /&gt;
Es gibt verschiedene Arten von Cookies, darunter &amp;quot;Session-Cookies&amp;quot;, die nur während deines Besuchs auf der Website gespeichert werden und danach gelöscht werden, sowie &amp;quot;Persistent-Cookies&amp;quot;, die längerfristig auf deinem Gerät gespeichert bleiben. Cookies können auch auf verschiedene Weise klassifiziert werden, je nachdem, wer sie setzt oder wie sie genutzt werden.&lt;br /&gt;
&lt;br /&gt;
Obwohl Cookies hilfreich sein können, um deine Nutzungserfahrung zu verbessern, gibt es auch Bedenken hinsichtlich des Datenschutzes und der Privatsphäre. Aus diesem Grund gibt es heute strengere Vorschriften für die Verwendung von Cookies, insbesondere in der EU, und Websites müssen ihre Nutzer transparent darüber informieren, welche Arten von Cookies sie setzen und warum.&lt;br /&gt;
&lt;br /&gt;
Cookies von Dritten werden normalerweise von Werbenetzwerken oder Analyse-Tools genutzt, die auf vielen Websites präsent sind. Wenn du eine Website besuchst, die Cookies von Dritten verwendet, können diese Cookies Informationen über deine Internetnutzung sammeln, wie z.B. welche Seiten du besucht hast, welche Produkte du angesehen hast oder welche Suchanfragen du gestellt hast. Diese Informationen werden dann genutzt, um dir gezielte Werbung auf anderen Websites zu präsentieren oder um Erkenntnisse über das Nutzerverhalten zu gewinnen.&lt;br /&gt;
&lt;br /&gt;
Ein Beispiel: Wenn du eine Website besuchst, die Produkte zum Thema Fitness verkauft, kann ein Werbenetzwerk, das Cookies von Dritten nutzt, diese Informationen sammeln und dir anschließend gezielte Werbung für Fitnessprodukte auf anderen Websites präsentieren, die dieses Netzwerk unterstützt.&lt;br /&gt;
&lt;br /&gt;
Es ist wichtig zu beachten, dass die Verwendung von Cookies von Dritten auch Bedenken hinsichtlich der Privatsphäre aufwirft. Wenn du jedoch deine Cookies regelmäßig löschst oder einen Ad-Blocker verwendest, kannst du die Verwendung von Cookies von Dritten einschränken oder verhindern.&lt;br /&gt;
&lt;br /&gt;
Es gibt verschiedene Arten von Cookies, die für unterschiedliche Zwecke eingesetzt werden. Hier sind einige der häufigsten Arten von Cookies:&lt;br /&gt;
&lt;br /&gt;
 '''Session-Cookies:''' &lt;br /&gt;
 Diese werden nur für die Dauer deines Besuchs auf einer Website gespeichert und automatisch gelöscht, sobald du den Browser schließt.&lt;br /&gt;
&lt;br /&gt;
 '''Persistent-Cookies:''' &lt;br /&gt;
 Diese bleiben auf deinem Gerät gespeichert, auch nachdem du den Browser geschlossen hast. Sie können für verschiedene Zwecke verwendet werden, wie z.B. um dich bei einem nächsten Besuch automatisch anzumelden oder um deine Präferenzen zu speichern.&lt;br /&gt;
&lt;br /&gt;
 '''Erstanbieter-Cookies:''' &lt;br /&gt;
 Diese werden von der Website gesetzt, die du besuchst, und werden für verschiedene Zwecke verwendet, wie z.B. um deine Einstellungen oder deine Einkaufswageninformationen zu speichern.&lt;br /&gt;
&lt;br /&gt;
 '''Drittanbieter-Cookies:'''&lt;br /&gt;
 Diese werden von anderen Websites oder Dienstleistungen gesetzt, die mit der von dir besuchten Website zusammenarbeiten, um Informationen zu sammeln oder Werbung zu schalten.&lt;br /&gt;
&lt;br /&gt;
 '''Analyse-Cookies:''' &lt;br /&gt;
 Diese werden verwendet, um Informationen über die Nutzung einer Website zu sammeln, wie z.B. welche Seiten besucht wurden und wie lange du auf einer bestimmten Seite verweilt hast.&lt;br /&gt;
&lt;br /&gt;
 '''Werbe-Cookies:''' &lt;br /&gt;
 Diese werden verwendet, um gezielte Werbung auf der Grundlage deiner Interessen und deines Nutzungsverhaltens zu schalten.&lt;br /&gt;
&lt;br /&gt;
Es ist wichtig zu beachten, dass einige Cookies für das ordnungsgemäße Funktionieren einer Website notwendig sind, während andere optional sind und in einigen Fällen deaktiviert werden können.&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Cookie&amp;diff=1131</id>
		<title>Cookie</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Cookie&amp;diff=1131"/>
		<updated>2023-06-27T16:16:49Z</updated>

		<summary type="html">&lt;p&gt;Geist: Die Seite wurde neu angelegt: „Cookies sind kleine Textdateien, die von einer Website auf deinem Computer oder Mobilgerät gespeichert werden, wenn du die Website besuchst. Sie dienen dazu,…“&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Cookies sind kleine Textdateien, die von einer Website auf deinem Computer oder Mobilgerät gespeichert werden, wenn du die Website besuchst. Sie dienen dazu, Informationen über deine Aktivitäten auf der Website zu speichern, wie z.B. deine Login-Daten, deine bevorzugte Sprache oder Artikel in deinem Warenkorb. Cookies können auch von Dritten, wie z.B. Werbetreibenden, genutzt werden, um dein Nutzerverhalten im Internet zu verfolgen und gezielt Werbung auszuspielen. Du kannst Cookies in deinen Browser-Einstellungen verwalten oder löschen.&lt;br /&gt;
&lt;br /&gt;
Cookies sind also kleine Dateien, die von Webseiten genutzt werden, um bestimmte Informationen über deinen Besuch auf der Webseite zu speichern. Die meisten Websites setzen Cookies ein, um deine Nutzungserfahrung zu verbessern, indem sie beispielsweise deine bevorzugten Spracheinstellungen speichern oder dich automatisch anmelden, wenn du die Website erneut besuchst.&lt;br /&gt;
&lt;br /&gt;
Cookies können jedoch auch von Dritten, wie z.B. Werbetreibenden, eingesetzt werden, um deine Internetnutzung zu verfolgen und dir gezielte Werbung zu präsentieren. Diese Cookies werden oft als &amp;quot;Tracking-Cookies&amp;quot; bezeichnet.&lt;br /&gt;
&lt;br /&gt;
Es gibt verschiedene Arten von Cookies, darunter &amp;quot;Session-Cookies&amp;quot;, die nur während deines Besuchs auf der Website gespeichert werden und danach gelöscht werden, sowie &amp;quot;Persistent-Cookies&amp;quot;, die längerfristig auf deinem Gerät gespeichert bleiben. Cookies können auch auf verschiedene Weise klassifiziert werden, je nachdem, wer sie setzt oder wie sie genutzt werden.&lt;br /&gt;
&lt;br /&gt;
Obwohl Cookies hilfreich sein können, um deine Nutzungserfahrung zu verbessern, gibt es auch Bedenken hinsichtlich des Datenschutzes und der Privatsphäre. Aus diesem Grund gibt es heute strengere Vorschriften für die Verwendung von Cookies, insbesondere in der EU, und Websites müssen ihre Nutzer transparent darüber informieren, welche Arten von Cookies sie setzen und warum.&lt;br /&gt;
&lt;br /&gt;
Cookies von Dritten werden normalerweise von Werbenetzwerken oder Analyse-Tools genutzt, die auf vielen Websites präsent sind. Wenn du eine Website besuchst, die Cookies von Dritten verwendet, können diese Cookies Informationen über deine Internetnutzung sammeln, wie z.B. welche Seiten du besucht hast, welche Produkte du angesehen hast oder welche Suchanfragen du gestellt hast. Diese Informationen werden dann genutzt, um dir gezielte Werbung auf anderen Websites zu präsentieren oder um Erkenntnisse über das Nutzerverhalten zu gewinnen.&lt;br /&gt;
&lt;br /&gt;
Ein Beispiel: Wenn du eine Website besuchst, die Produkte zum Thema Fitness verkauft, kann ein Werbenetzwerk, das Cookies von Dritten nutzt, diese Informationen sammeln und dir anschließend gezielte Werbung für Fitnessprodukte auf anderen Websites präsentieren, die dieses Netzwerk unterstützt.&lt;br /&gt;
&lt;br /&gt;
Es ist wichtig zu beachten, dass die Verwendung von Cookies von Dritten auch Bedenken hinsichtlich der Privatsphäre aufwirft. Wenn du jedoch deine Cookies regelmäßig löschst oder einen Ad-Blocker verwendest, kannst du die Verwendung von Cookies von Dritten einschränken oder verhindern.&lt;br /&gt;
&lt;br /&gt;
Es gibt verschiedene Arten von Cookies, die für unterschiedliche Zwecke eingesetzt werden. Hier sind einige der häufigsten Arten von Cookies:&lt;br /&gt;
&lt;br /&gt;
    Session-Cookies: Diese werden nur für die Dauer deines Besuchs auf einer Website gespeichert und automatisch gelöscht, sobald du den Browser schließt.&lt;br /&gt;
&lt;br /&gt;
    Persistent-Cookies: Diese bleiben auf deinem Gerät gespeichert, auch nachdem du den Browser geschlossen hast. Sie können für verschiedene Zwecke verwendet werden, wie z.B. um dich bei einem nächsten Besuch automatisch anzumelden oder um deine Präferenzen zu speichern.&lt;br /&gt;
&lt;br /&gt;
    Erstanbieter-Cookies: Diese werden von der Website gesetzt, die du besuchst, und werden für verschiedene Zwecke verwendet, wie z.B. um deine Einstellungen oder deine Einkaufswageninformationen zu speichern.&lt;br /&gt;
&lt;br /&gt;
    Drittanbieter-Cookies: Diese werden von anderen Websites oder Dienstleistungen gesetzt, die mit der von dir besuchten Website zusammenarbeiten, um Informationen zu sammeln oder Werbung zu schalten.&lt;br /&gt;
&lt;br /&gt;
    Analyse-Cookies: Diese werden verwendet, um Informationen über die Nutzung einer Website zu sammeln, wie z.B. welche Seiten besucht wurden und wie lange du auf einer bestimmten Seite verweilt hast.&lt;br /&gt;
&lt;br /&gt;
    Werbe-Cookies: Diese werden verwendet, um gezielte Werbung auf der Grundlage deiner Interessen und deines Nutzungsverhaltens zu schalten.&lt;br /&gt;
&lt;br /&gt;
Es ist wichtig zu beachten, dass einige Cookies für das ordnungsgemäße Funktionieren einer Website notwendig sind, während andere optional sind und in einigen Fällen deaktiviert werden können.&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Hauptseite&amp;diff=1130</id>
		<title>Hauptseite</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Hauptseite&amp;diff=1130"/>
		<updated>2023-06-27T16:15:16Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' A ''' ==&lt;br /&gt;
==='''[[ADB]]'''===&lt;br /&gt;
==='''[[Agile]]'''===&lt;br /&gt;
==='''[[Alpine]]'''===&lt;br /&gt;
==='''[[Apache]]'''===&lt;br /&gt;
==='''[[Anacron]]'''===&lt;br /&gt;
==='''[[Android]]'''===&lt;br /&gt;
==='''[[apt sources.list]]'''===&lt;br /&gt;
==='''[[apt]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' B ''' ==&lt;br /&gt;
==='''[[Backup]]'''===&lt;br /&gt;
==='''[[bash]]'''===&lt;br /&gt;
==='''[[Bitcoin]]'''===&lt;br /&gt;
==='''[[blkid]]'''===&lt;br /&gt;
==='''[[Blockchain]]'''===&lt;br /&gt;
==='''[[Blockchain Office]]'''===&lt;br /&gt;
==='''[[Borg]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' C ''' ==&lt;br /&gt;
==='''[[Cookie]]'''===&lt;br /&gt;
==='''[[Cron]]'''===&lt;br /&gt;
==='''[[Crypto]]'''===&lt;br /&gt;
==='''[[Cryptographic Hash Algorithm]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' D ''' ==&lt;br /&gt;
==='''[[Debian]]'''===&lt;br /&gt;
==='''[[DevOps]]'''===&lt;br /&gt;
==='''[[Docker]]'''===&lt;br /&gt;
==='''[[Dockerfile]]===&lt;br /&gt;
==='''[[Dolphin KDE]]===&lt;br /&gt;
&lt;br /&gt;
== ''' F ''' ==&lt;br /&gt;
==='''[[Fail2Ban]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' G ''' ==&lt;br /&gt;
==='''[[Git]]'''===&lt;br /&gt;
==='''[[GNU/LINUX]]'''===&lt;br /&gt;
==='''[[ GnuPG/OpenPGP/PGP ]]'''===&lt;br /&gt;
==='''[[GRUB]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' H ''' ==&lt;br /&gt;
==='''[[Hacking-Methoden]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' I ''' ==&lt;br /&gt;
==='''[[Image mount]]'''===&lt;br /&gt;
==='''[[IP]]'''===&lt;br /&gt;
==='''[[IT Berufstitel]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' J ''' ==&lt;br /&gt;
==='''[[Jenkins]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' K ''' ==&lt;br /&gt;
==='''[[KanBoard]]'''===&lt;br /&gt;
==='''[[Kate]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' L ''' ==&lt;br /&gt;
==='''[[Linux Build]]'''===&lt;br /&gt;
==='''[[Luks]]'''===&lt;br /&gt;
==='''[[LXC LXD]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' M ''' ==&lt;br /&gt;
==='''[[MariaDB]]'''===&lt;br /&gt;
==='''[[MediaWiki]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' N ''' ==&lt;br /&gt;
==='''[[NFT]]'''===&lt;br /&gt;
==='''[[NMAP]]'''===&lt;br /&gt;
==='''[[NTFS]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' O ''' ==&lt;br /&gt;
==='''[[OpSec]]'''===&lt;br /&gt;
==='''[[OpenSSL]]'''===&lt;br /&gt;
==='''[[Oracle]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' P ''' ==&lt;br /&gt;
==='''[[PHP]]'''===&lt;br /&gt;
==='''[[Prometheus]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Q ''' ==&lt;br /&gt;
==='''[[quantum attacks]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' R ''' ==&lt;br /&gt;
==='''[[RSYNC]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' S ''' ==&lt;br /&gt;
==='''[[Scrum]]'''===&lt;br /&gt;
==='''[[Secure-Hash-Cookie]]'''===&lt;br /&gt;
==='''[[snap-snapd-snappy]]'''===&lt;br /&gt;
==='''[[SQL]]'''===&lt;br /&gt;
==='''[[ssh]]'''===&lt;br /&gt;
==='''[[SQL TUNING]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' T ''' ==&lt;br /&gt;
==='''[[TAR]]'''===&lt;br /&gt;
==='''[[TCPIP]]'''===&lt;br /&gt;
==='''[[TWRP]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' U ''' ==&lt;br /&gt;
==='''[[UUID]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' V ''' ==&lt;br /&gt;
==='''[[Vagrant]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' W ''' ==&lt;br /&gt;
==='''[[WEBRTC]]'''===&lt;br /&gt;
==='''[[Wireshark]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Y ''' ==&lt;br /&gt;
==='''[[Youtube]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Z ''' ==&lt;br /&gt;
==='''[[z4o]]'''===&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=IT_Berufstitel&amp;diff=1129</id>
		<title>IT Berufstitel</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=IT_Berufstitel&amp;diff=1129"/>
		<updated>2023-06-16T11:13:10Z</updated>

		<summary type="html">&lt;p&gt;Geist: Die Seite wurde neu angelegt: „Chief Architect (Hauptarchitekt)  Chief Technology Officer (CTO) (Technologiechef)  Chief Information Officer (CIO) (Informationschef)  Chief Enterprise Archit…“&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Chief Architect (Hauptarchitekt)&lt;br /&gt;
&lt;br /&gt;
Chief Technology Officer (CTO) (Technologiechef)&lt;br /&gt;
&lt;br /&gt;
Chief Information Officer (CIO) (Informationschef)&lt;br /&gt;
&lt;br /&gt;
Chief Enterprise Architect (Hauptunternehmensarchitekt)&lt;br /&gt;
&lt;br /&gt;
Chief Solution Architect (Hauptlösungsarchitekt)&lt;br /&gt;
&lt;br /&gt;
Chief Systems Architect (Hauptsystemarchitekt)&lt;br /&gt;
&lt;br /&gt;
Systemarchitekt&lt;br /&gt;
&lt;br /&gt;
Senior Systemarchitekt&lt;br /&gt;
&lt;br /&gt;
Lead Systemarchitekt&lt;br /&gt;
&lt;br /&gt;
Principal Systemarchitekt&lt;br /&gt;
&lt;br /&gt;
Solutions Architect&lt;br /&gt;
&lt;br /&gt;
Enterprise Architect&lt;br /&gt;
&lt;br /&gt;
Technischer Architekt&lt;br /&gt;
&lt;br /&gt;
Cloud-Architekt&lt;br /&gt;
&lt;br /&gt;
IT-Architekt&lt;br /&gt;
&lt;br /&gt;
Softwarearchitekt&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Hauptseite&amp;diff=1128</id>
		<title>Hauptseite</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Hauptseite&amp;diff=1128"/>
		<updated>2023-06-16T11:12:47Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' A ''' ==&lt;br /&gt;
==='''[[ADB]]'''===&lt;br /&gt;
==='''[[Agile]]'''===&lt;br /&gt;
==='''[[Alpine]]'''===&lt;br /&gt;
==='''[[Apache]]'''===&lt;br /&gt;
==='''[[Anacron]]'''===&lt;br /&gt;
==='''[[Android]]'''===&lt;br /&gt;
==='''[[apt sources.list]]'''===&lt;br /&gt;
==='''[[apt]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' B ''' ==&lt;br /&gt;
==='''[[Backup]]'''===&lt;br /&gt;
==='''[[bash]]'''===&lt;br /&gt;
==='''[[Bitcoin]]'''===&lt;br /&gt;
==='''[[blkid]]'''===&lt;br /&gt;
==='''[[Blockchain]]'''===&lt;br /&gt;
==='''[[Blockchain Office]]'''===&lt;br /&gt;
==='''[[Borg]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' C ''' ==&lt;br /&gt;
==='''[[Cron]]'''===&lt;br /&gt;
==='''[[Crypto]]'''===&lt;br /&gt;
==='''[[Cryptographic Hash Algorithm]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' D ''' ==&lt;br /&gt;
==='''[[Debian]]'''===&lt;br /&gt;
==='''[[DevOps]]'''===&lt;br /&gt;
==='''[[Docker]]'''===&lt;br /&gt;
==='''[[Dockerfile]]===&lt;br /&gt;
==='''[[Dolphin KDE]]===&lt;br /&gt;
&lt;br /&gt;
== ''' F ''' ==&lt;br /&gt;
==='''[[Fail2Ban]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' G ''' ==&lt;br /&gt;
==='''[[Git]]'''===&lt;br /&gt;
==='''[[GNU/LINUX]]'''===&lt;br /&gt;
==='''[[ GnuPG/OpenPGP/PGP ]]'''===&lt;br /&gt;
==='''[[GRUB]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' H ''' ==&lt;br /&gt;
==='''[[Hacking-Methoden]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' I ''' ==&lt;br /&gt;
==='''[[Image mount]]'''===&lt;br /&gt;
==='''[[IP]]'''===&lt;br /&gt;
==='''[[IT Berufstitel]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' J ''' ==&lt;br /&gt;
==='''[[Jenkins]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' K ''' ==&lt;br /&gt;
==='''[[KanBoard]]'''===&lt;br /&gt;
==='''[[Kate]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' L ''' ==&lt;br /&gt;
==='''[[Linux Build]]'''===&lt;br /&gt;
==='''[[Luks]]'''===&lt;br /&gt;
==='''[[LXC LXD]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' M ''' ==&lt;br /&gt;
==='''[[MariaDB]]'''===&lt;br /&gt;
==='''[[MediaWiki]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' N ''' ==&lt;br /&gt;
==='''[[NFT]]'''===&lt;br /&gt;
==='''[[NMAP]]'''===&lt;br /&gt;
==='''[[NTFS]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' O ''' ==&lt;br /&gt;
==='''[[OpSec]]'''===&lt;br /&gt;
==='''[[OpenSSL]]'''===&lt;br /&gt;
==='''[[Oracle]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' P ''' ==&lt;br /&gt;
==='''[[PHP]]'''===&lt;br /&gt;
==='''[[Prometheus]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Q ''' ==&lt;br /&gt;
==='''[[quantum attacks]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' R ''' ==&lt;br /&gt;
==='''[[RSYNC]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' S ''' ==&lt;br /&gt;
==='''[[Scrum]]'''===&lt;br /&gt;
==='''[[Secure-Hash-Cookie]]'''===&lt;br /&gt;
==='''[[snap-snapd-snappy]]'''===&lt;br /&gt;
==='''[[SQL]]'''===&lt;br /&gt;
==='''[[ssh]]'''===&lt;br /&gt;
==='''[[SQL TUNING]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' T ''' ==&lt;br /&gt;
==='''[[TAR]]'''===&lt;br /&gt;
==='''[[TCPIP]]'''===&lt;br /&gt;
==='''[[TWRP]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' U ''' ==&lt;br /&gt;
==='''[[UUID]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' V ''' ==&lt;br /&gt;
==='''[[Vagrant]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' W ''' ==&lt;br /&gt;
==='''[[WEBRTC]]'''===&lt;br /&gt;
==='''[[Wireshark]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Y ''' ==&lt;br /&gt;
==='''[[Youtube]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Z ''' ==&lt;br /&gt;
==='''[[z4o]]'''===&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=IT_Berufstitle&amp;diff=1127</id>
		<title>IT Berufstitle</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=IT_Berufstitle&amp;diff=1127"/>
		<updated>2023-06-16T11:12:09Z</updated>

		<summary type="html">&lt;p&gt;Geist: Die Seite wurde neu angelegt: „Chief Architect (Hauptarchitekt)  Chief Technology Officer (CTO) (Technologiechef)  Chief Information Officer (CIO) (Informationschef)  Chief Enterprise Archit…“&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Chief Architect (Hauptarchitekt)&lt;br /&gt;
&lt;br /&gt;
Chief Technology Officer (CTO) (Technologiechef)&lt;br /&gt;
&lt;br /&gt;
Chief Information Officer (CIO) (Informationschef)&lt;br /&gt;
&lt;br /&gt;
Chief Enterprise Architect (Hauptunternehmensarchitekt)&lt;br /&gt;
&lt;br /&gt;
Chief Solution Architect (Hauptlösungsarchitekt)&lt;br /&gt;
&lt;br /&gt;
Chief Systems Architect (Hauptsystemarchitekt)&lt;br /&gt;
&lt;br /&gt;
Systemarchitekt&lt;br /&gt;
&lt;br /&gt;
Senior Systemarchitekt&lt;br /&gt;
&lt;br /&gt;
Lead Systemarchitekt&lt;br /&gt;
&lt;br /&gt;
Principal Systemarchitekt&lt;br /&gt;
&lt;br /&gt;
Solutions Architect&lt;br /&gt;
&lt;br /&gt;
Enterprise Architect&lt;br /&gt;
&lt;br /&gt;
Technischer Architekt&lt;br /&gt;
&lt;br /&gt;
Cloud-Architekt&lt;br /&gt;
&lt;br /&gt;
IT-Architekt&lt;br /&gt;
Softwarearchitekt&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Hauptseite&amp;diff=1126</id>
		<title>Hauptseite</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Hauptseite&amp;diff=1126"/>
		<updated>2023-06-16T11:11:33Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''' A ''' ==&lt;br /&gt;
==='''[[ADB]]'''===&lt;br /&gt;
==='''[[Agile]]'''===&lt;br /&gt;
==='''[[Alpine]]'''===&lt;br /&gt;
==='''[[Apache]]'''===&lt;br /&gt;
==='''[[Anacron]]'''===&lt;br /&gt;
==='''[[Android]]'''===&lt;br /&gt;
==='''[[apt sources.list]]'''===&lt;br /&gt;
==='''[[apt]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' B ''' ==&lt;br /&gt;
==='''[[Backup]]'''===&lt;br /&gt;
==='''[[bash]]'''===&lt;br /&gt;
==='''[[Bitcoin]]'''===&lt;br /&gt;
==='''[[blkid]]'''===&lt;br /&gt;
==='''[[Blockchain]]'''===&lt;br /&gt;
==='''[[Blockchain Office]]'''===&lt;br /&gt;
==='''[[Borg]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' C ''' ==&lt;br /&gt;
==='''[[Cron]]'''===&lt;br /&gt;
==='''[[Crypto]]'''===&lt;br /&gt;
==='''[[Cryptographic Hash Algorithm]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' D ''' ==&lt;br /&gt;
==='''[[Debian]]'''===&lt;br /&gt;
==='''[[DevOps]]'''===&lt;br /&gt;
==='''[[Docker]]'''===&lt;br /&gt;
==='''[[Dockerfile]]===&lt;br /&gt;
==='''[[Dolphin KDE]]===&lt;br /&gt;
&lt;br /&gt;
== ''' F ''' ==&lt;br /&gt;
==='''[[Fail2Ban]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' G ''' ==&lt;br /&gt;
==='''[[Git]]'''===&lt;br /&gt;
==='''[[GNU/LINUX]]'''===&lt;br /&gt;
==='''[[ GnuPG/OpenPGP/PGP ]]'''===&lt;br /&gt;
==='''[[GRUB]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' H ''' ==&lt;br /&gt;
==='''[[Hacking-Methoden]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' I ''' ==&lt;br /&gt;
==='''[[Image mount]]'''===&lt;br /&gt;
==='''[[IP]]'''===&lt;br /&gt;
==='''[[IT Berufstitle]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' J ''' ==&lt;br /&gt;
==='''[[Jenkins]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' K ''' ==&lt;br /&gt;
==='''[[KanBoard]]'''===&lt;br /&gt;
==='''[[Kate]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' L ''' ==&lt;br /&gt;
==='''[[Linux Build]]'''===&lt;br /&gt;
==='''[[Luks]]'''===&lt;br /&gt;
==='''[[LXC LXD]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' M ''' ==&lt;br /&gt;
==='''[[MariaDB]]'''===&lt;br /&gt;
==='''[[MediaWiki]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' N ''' ==&lt;br /&gt;
==='''[[NFT]]'''===&lt;br /&gt;
==='''[[NMAP]]'''===&lt;br /&gt;
==='''[[NTFS]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' O ''' ==&lt;br /&gt;
==='''[[OpSec]]'''===&lt;br /&gt;
==='''[[OpenSSL]]'''===&lt;br /&gt;
==='''[[Oracle]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' P ''' ==&lt;br /&gt;
==='''[[PHP]]'''===&lt;br /&gt;
==='''[[Prometheus]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Q ''' ==&lt;br /&gt;
==='''[[quantum attacks]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' R ''' ==&lt;br /&gt;
==='''[[RSYNC]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' S ''' ==&lt;br /&gt;
==='''[[Scrum]]'''===&lt;br /&gt;
==='''[[Secure-Hash-Cookie]]'''===&lt;br /&gt;
==='''[[snap-snapd-snappy]]'''===&lt;br /&gt;
==='''[[SQL]]'''===&lt;br /&gt;
==='''[[ssh]]'''===&lt;br /&gt;
==='''[[SQL TUNING]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' T ''' ==&lt;br /&gt;
==='''[[TAR]]'''===&lt;br /&gt;
==='''[[TCPIP]]'''===&lt;br /&gt;
==='''[[TWRP]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' U ''' ==&lt;br /&gt;
==='''[[UUID]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' V ''' ==&lt;br /&gt;
==='''[[Vagrant]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' W ''' ==&lt;br /&gt;
==='''[[WEBRTC]]'''===&lt;br /&gt;
==='''[[Wireshark]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Y ''' ==&lt;br /&gt;
==='''[[Youtube]]'''===&lt;br /&gt;
&lt;br /&gt;
== ''' Z ''' ==&lt;br /&gt;
==='''[[z4o]]'''===&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Ssh&amp;diff=1125</id>
		<title>Ssh</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Ssh&amp;diff=1125"/>
		<updated>2023-06-14T08:53:02Z</updated>

		<summary type="html">&lt;p&gt;Geist: /* Login with SSH Key */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==== ''' AUTHOR | HACKBUGZ ''' ====&lt;br /&gt;
 [https://stackexchange.com/users/23684174/hackbugz?tab=accounts StackExchange | HACKBUGZ]&lt;br /&gt;
 [https://www.tiktok.com/@hackbugz? TIKTOK | HACKBUGZ]&lt;br /&gt;
&lt;br /&gt;
==== ''' Links ''' ====&lt;br /&gt;
 [https://linux.die.net/man/1/sshfs sshfs(1) - Linux man page]&lt;br /&gt;
 [https://wiki.ubuntuusers.de/FUSE/sshfs/ wiki.ubuntuusers.de FUSE/SSHFS]&lt;br /&gt;
 [https://wiki.ubuntuusers.de/FUSE/ wiki.ubuntuusers.de FUSE]  &lt;br /&gt;
&lt;br /&gt;
 [https://www.ssh.com/iam/ssh-key-management/ SSH Key Management]&lt;br /&gt;
 [https://www.ssh.com/ssh/authorized_keys/ Authorized_keys file in SSH]&lt;br /&gt;
 [https://unix.stackexchange.com/questions/208960/how-to-restrict-a-user-to-one-folder-and-not-allow-them-to-move-out-his-folder How to restrict a user to one folder and not allow them to move out his folder - Unix &amp;amp; Linux Stack Exchange]&lt;br /&gt;
 [https://www.tecmint.com/restrict-ssh-user-to-directory-using-chrooted-jail/ Restrict SSH User Access to Certain Directory Using Chrooted Jail]&lt;br /&gt;
 [https://www.cyberciti.biz/faq/debian-ubuntu-restricting-ssh-user-session-to-a-directory-chrooted-jail/ Debian/Ubuntu Linux: Restrict an SSH user session to a specific directory by setting chrooted jail - nixCraft]&lt;br /&gt;
 [https://wiki.archlinux.org/index.php/SSHFS SSHFS - ArchWiki]&lt;br /&gt;
&lt;br /&gt;
 [https://askubuntu.com/questions/48129/how-to-create-a-restricted-ssh-user-for-port-forwarding security - How to create a restricted SSH user for port forwarding? - Ask Ubuntu]&lt;br /&gt;
 [https://www.linux-magazin.de/ausgaben/2018/08/einfuehrung-2-5/ Aus dem Alltag eines Sysadmin: Reverse-SSH-Tunnel und Autossh]&lt;br /&gt;
 [https://www.howtogeek.com/428413/what-is-reverse-ssh-tunneling-and-how-to-use-it/ What Is Reverse SSH Tunneling? (and How to Use It)]&lt;br /&gt;
 [https://unix.stackexchange.com/questions/100859/ssh-tunnel-without-shell-on-ssh-server ssh tunneling - SSH: tunnel without shell on ssh server - Unix &amp;amp; Linux Stack Exchange]&lt;br /&gt;
 [https://serverfault.com/questions/56566/ssh-tunneling-only-access linux - ssh tunneling only access - Server Fault]&lt;br /&gt;
 [https://www.it-react.com/index.php/2020/01/06/how-to-setup-reverse-ssh-tunnel-on-linux/ How to Setup Reverse SSH Tunnel on Raspberry Pi behind a 3G USB stick modem - IT-REACT]&lt;br /&gt;
 [https://dev.to/bulletmark/create-a-reverse-ssh-tunnel-for-remote-access-to-a-restricted-machine-1ma0 Create a reverse SSH tunnel for remote access to a restricted Linux machine - DEV Community]&lt;br /&gt;
 [https://unix.stackexchange.com/questions/55106/disable-user-shell-for-security-reasons https://unix.stackexchange.com/questions/55106/disable-user-shell-for-security-reasons]&lt;br /&gt;
 [https://www.everythingcli.org/ssh-tunnelling-for-fun-and-profit-autossh/ SSH tunnelling for fun and profit: Autossh]&lt;br /&gt;
 [https://man7.org/linux/man-pages/man1/ssh-keygen.1.html ssh-keygen(1) - Linux manual page]&lt;br /&gt;
 [https://unix.stackexchange.com/questions/128894/ssh-exchange-identification-connection-closed-by-remote-host-not-using-hosts-d linux - ssh_exchange_identification: Connection closed by remote host (not using hosts.deny) - Unix &amp;amp; Linux Stack Exchange]&lt;br /&gt;
&lt;br /&gt;
 [https://github.com/szmi Miklos Szeredi | github]&lt;br /&gt;
 [https://indico.cern.ch/event/608592/contributions/2830117/attachments/1592339/2520491/Evolution_of_FUSE_and_OverlayFS.pdf  Evolution of FUSE and OverlayFS | Miklos Szeredi]&lt;br /&gt;
&lt;br /&gt;
 [https://explainshell.com/explain?cmd=ssh+-L+-N+-f+-l+-R+-i+-1 explainshell]&lt;br /&gt;
 [https://wiki.ubuntuusers.de/Screen/ Screen]&lt;br /&gt;
 [https://wiki.ubuntuusers.de/nohup/ nohup]&lt;br /&gt;
 [https://linuxcommand.org/lc3_man_pages/ssh1.html linuxcommand ssh1]&lt;br /&gt;
 open ip&lt;br /&gt;
&lt;br /&gt;
SSHFS und FUSE sind zwei verschiedene Dinge, die jedoch eng miteinander verwandt sind.&lt;br /&gt;
&lt;br /&gt;
FUSE (Filesystem in Userspace) ist ein Framework für das Betriebssystem Linux, das es ermöglicht, Dateisysteme in Benutzermodus-Programmen zu implementieren, anstatt diese im Kernelmodus implementieren zu müssen. Durch die Verwendung von FUSE können Benutzermodus-Programme wie SSHFS auf einfache Weise ein Dateisystem erstellen, das wie ein herkömmliches Dateisystem gemountet werden kann.&lt;br /&gt;
&lt;br /&gt;
SSHFS (SSH Filesystem) ist eine Erweiterung des FUSE-Frameworks, mit der man ein Dateisystem über SSH mounten kann. Das bedeutet, dass man über eine sichere Verbindung (SSH) auf Dateien und Verzeichnisse auf einem entfernten System zugreifen kann, als wären sie auf dem eigenen Computer vorhanden.&lt;br /&gt;
&lt;br /&gt;
Zusammenfassend kann man sagen, dass FUSE ein Framework ist, das es ermöglicht, Dateisysteme in Benutzermodus-Programmen zu implementieren, während SSHFS eine Anwendung ist, die FUSE verwendet, um ein Dateisystem über SSH zu mounten.&lt;br /&gt;
&lt;br /&gt;
SFTP und SSHFS sind ähnliche Technologien, die beide eine sichere Möglichkeit bieten, auf entfernte Dateien und Verzeichnisse zuzugreifen. Beide basieren auf dem SSH-Protokoll, das eine sichere Verschlüsselung der Datenübertragung ermöglicht. Der Hauptunterschied zwischen SFTP und SSHFS liegt jedoch in der Art und Weise, wie sie die Remote-Dateisysteme bereitstellen.&lt;br /&gt;
&lt;br /&gt;
SFTP (Secure File Transfer Protocol) ist ein Dateiübertragungsprotokoll, das auf dem SSH-Protokoll basiert und es ermöglicht, Dateien zwischen lokalen und entfernten Systemen zu übertragen. SFTP bietet jedoch keine Möglichkeit, ein entferntes Dateisystem zu mounten. Stattdessen bietet SFTP einen Dateizugriff über eine sichere Verbindung, ähnlich wie beim FTP-Protokoll.&lt;br /&gt;
&lt;br /&gt;
SSHFS (SSH Filesystem) hingegen ist ein FUSE (Filesystem in Userspace)-basiertes Dateisystem, das es ermöglicht, ein entferntes Dateisystem als lokales Dateisystem zu mounten. SSHFS verwendet das SSH-Protokoll, um eine sichere Verbindung zu einem entfernten System herzustellen und ein entferntes Dateisystem als lokales Dateisystem zu mounten. Dadurch können Sie auf entfernte Dateien und Verzeichnisse zugreifen, als wären sie auf Ihrem lokalen Computer vorhanden.&lt;br /&gt;
&lt;br /&gt;
Wenn es darum geht, auf entfernte Dateien und Verzeichnisse zuzugreifen, ist SSHFS in der Regel die bessere Option, da es die Möglichkeit bietet, ein entferntes Dateisystem als lokales Dateisystem zu mounten, was die Arbeit mit entfernten Dateien und Verzeichnissen erleichtert. SFTP ist jedoch eine gute Option, wenn Sie nur Dateien übertragen müssen, ohne das gesamte Dateisystem mounten zu müssen.&lt;br /&gt;
&lt;br /&gt;
=== '''SSH|SCP|SFTP FUSE, SSHFS''' ===&lt;br /&gt;
 '''Mit dem SSH-Clients SSHSSH|SCP|SFTP kann man sich über ein Terminal auf entfernte Rechner anmelden.'''&lt;br /&gt;
 '''Die Kommunikation und die Authentifizierung findet dabei verschlüsselt statt.'''&lt;br /&gt;
 '''SSH kann dabei interaktiv oder nicht interaktiv genutzt werden'''&lt;br /&gt;
&lt;br /&gt;
=== '''RANKING DER REMOTE CLIENTS|TOOLS NACH SICHERHEIT''' ===&lt;br /&gt;
 # '''SSH'''&lt;br /&gt;
 # '''SCP'''&lt;br /&gt;
 # '''SFTP'''&lt;br /&gt;
 # '''RLOGIN'''&lt;br /&gt;
 # '''TELNET'''&lt;br /&gt;
 # '''FTP'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSH STATUS''' ====&lt;br /&gt;
 '''$ systemctl status ssh '''&lt;br /&gt;
&lt;br /&gt;
 '''$ whoami'''&lt;br /&gt;
 '''$ who'''&lt;br /&gt;
 '''$ w'''&lt;br /&gt;
&lt;br /&gt;
 '''$ ps'''&lt;br /&gt;
 '''$ ps aux'''&lt;br /&gt;
 '''$ ps aux | grep ssh '''&lt;br /&gt;
 '''$ ps aux | grep sshd '''&lt;br /&gt;
&lt;br /&gt;
 '''$ lsof -i -n | egrep 'ssh' '''&lt;br /&gt;
 '''$ lsof -i -n | egrep 'sshd' '''&lt;br /&gt;
&lt;br /&gt;
 '''$ ss '''&lt;br /&gt;
 '''$ ss -l'''&lt;br /&gt;
 '''$ ss | grep tcp'''&lt;br /&gt;
 '''$ ss | grep -i ssh'''&lt;br /&gt;
 '''$ ss -u -a'''&lt;br /&gt;
&lt;br /&gt;
 '''$ last -a | grep -i still'''&lt;br /&gt;
&lt;br /&gt;
 '''apk*error'''&lt;br /&gt;
 ''$ service ssh status ''&lt;br /&gt;
 ''$ netstat -tanup | grep ssh ''&lt;br /&gt;
 ''$ netstat -tnpa | grep 'ESTABLISHED.*sshd''&lt;br /&gt;
 ''$ netstat -an | grep 8090/port''&lt;br /&gt;
 ''$ firewall-cmd --list-all-zones ''&lt;br /&gt;
&lt;br /&gt;
==== '''SSH tools''' ====&lt;br /&gt;
 '''ssh-keygen'''&lt;br /&gt;
 '''$ ssh-keyscan ip &amp;gt; known_hosts'''&lt;br /&gt;
 '''$ ssh-keyscan -f txtwithhosts'''&lt;br /&gt;
&lt;br /&gt;
 '''ssh-keyscan'''&lt;br /&gt;
&lt;br /&gt;
 '''ssh-copy-id'''&lt;br /&gt;
&lt;br /&gt;
 '''ssh-add'''&lt;br /&gt;
 '''$ ssh-add -l '''&lt;br /&gt;
 '''$ ssh-add KEY '''&lt;br /&gt;
&lt;br /&gt;
 '''ssh-agent'''&lt;br /&gt;
 '''$ pgrep ssh-agent '''&lt;br /&gt;
 '''$ ps aux | grep ssh-agent'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSH|SSHFS|FUSE CONFIG FILES''' ====&lt;br /&gt;
 '''$ cat /etc/ssh/sshd_config'''&lt;br /&gt;
 '''$ cat /etc/ssh/ssh_config'''&lt;br /&gt;
 '''$ /etc/fuse.conf'''&lt;br /&gt;
 '''$ /etc/modules'''&lt;br /&gt;
''&lt;br /&gt;
 '''''IN LAB'''''&lt;br /&gt;
 '''AllowHosts'''&lt;br /&gt;
 '''AllowUsers'''&lt;br /&gt;
 '''AllowGroups'''&lt;br /&gt;
 '''ChRootGroups(Syntax: AllowGroups)'''&lt;br /&gt;
 '''ChRootUsers(Syntax: AllowUsers)'''&lt;br /&gt;
&lt;br /&gt;
==== '''Create SSH Key''' ====&lt;br /&gt;
 '''$ ssh-keygen -t ed25519 -b 4096'''&lt;br /&gt;
&lt;br /&gt;
==== '''Copy SSH Key''' ====&lt;br /&gt;
 '''$ ssh-copy-id  -i KEY user@IP'''&lt;br /&gt;
 '''$ ssh-copy-id  -i ~/.ssh/KEY user@IP'''&lt;br /&gt;
&lt;br /&gt;
 ''copy key while login with key''&lt;br /&gt;
 '''$ ssh-copy-id -i KEYTOCOPY -f -o 'IdentityFile KEYTOLOGIN' -p 5000 USER@IP'''&lt;br /&gt;
&lt;br /&gt;
==== '''Login with SSH Key''' ====&lt;br /&gt;
 '''$ ssh -i ~/.ssh/KEY user@IP -p 5001'''&lt;br /&gt;
&lt;br /&gt;
==== '''Login SSH Password automation''' ====&lt;br /&gt;
 '''install sshpass '''&lt;br /&gt;
 '''#!/bin/bash '''&lt;br /&gt;
 '''read -s -p &amp;quot;Enter your password: &amp;quot; password '''&lt;br /&gt;
 '''echo '''&lt;br /&gt;
 '''sshpass -p &amp;quot;$password&amp;quot; ssh username@remote_server'''&lt;br /&gt;
&lt;br /&gt;
==== '''ssh config files &amp;amp; folders''' ====&lt;br /&gt;
 '''/etc/ssh/ssh_config'''&lt;br /&gt;
 '''/etc/ssh/sshd_config'''&lt;br /&gt;
 '''~/.ssh'''&lt;br /&gt;
 '''~/.ssh/authorized_keys '''&lt;br /&gt;
 '''~/.ssh/known_hosts'''&lt;br /&gt;
&lt;br /&gt;
==== '''ssh sshd_config file''' ====&lt;br /&gt;
 '''$ nano /etc/ssh/sshd_config'''&lt;br /&gt;
 ''' Port 5000'''&lt;br /&gt;
 ''' PubkeyAuthentication yes'''&lt;br /&gt;
 ''' PasswordAuthentication no'''&lt;br /&gt;
 ''' PermitEmptyPasswords no'''&lt;br /&gt;
 ''' X11Forwarding no'''&lt;br /&gt;
 ''' Banner /path/ (Message before login)'''&lt;br /&gt;
 ''''' ListenAddress (Strict/Diff Networks)'''''&lt;br /&gt;
 ''''' MaxSessions '''''&lt;br /&gt;
 [https://unix.stackexchange.com/questions/26170/sshd-config-maxsessions-parameter  MaxSessions parameter]&lt;br /&gt;
&lt;br /&gt;
==== '''ssh motd file''' ====&lt;br /&gt;
 '''$ nano /etc/motd (Message after Login)'''&lt;br /&gt;
&lt;br /&gt;
==== '''ssh known_hosts file''' ====&lt;br /&gt;
 '''$ nano ~/.ssh/known_hosts '''&lt;br /&gt;
&lt;br /&gt;
==== '''ssh authorized_keys file''' ====&lt;br /&gt;
 '''$ nano ~/.ssh/authorized_keys '''&lt;br /&gt;
&lt;br /&gt;
 '''How to manually copy SSH public keys to server:'''&lt;br /&gt;
 On the local machine&lt;br /&gt;
 '''$ cat ~/.ssh/id_rsa.pub'''&lt;br /&gt;
 copy&lt;br /&gt;
 ''ssh-rsa .STRING. USER@IP''&lt;br /&gt;
&lt;br /&gt;
 On the remote server paste the line to:&lt;br /&gt;
 '''~/.ssh/authorized_keys'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE''' ====&lt;br /&gt;
 '''$ sshfs user@host:/dir /dir -o IdentityFile=~/.ssh/KEY'''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs user@host:/dir /dir -o IdentityFile=~/.ssh/KEY -o idmap=user -o uid=$(id -u) -o gid=$(id -g)'''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs user@host:/dir /dir -C -p 5001'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE | USER MAPPING''' ====&lt;br /&gt;
 '''$ sshfs Benutzername@irgendEinRechner:/pfad_auf_dem_server/ ~/fusessh -o idmap=user -o uid=$(id -u) -o gid=$(id -g) '''&lt;br /&gt;
 '''$ sshfs user@host:/dir /dir -o IdentityFile=~/.ssh/KEY -o idmap=user -o uid=$(id -u) -o gid=$(id -g) -o nonempty -p 5001 '''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE | SYMLINKS''' ====&lt;br /&gt;
 '''$ sshfs -o follow_symlinks'''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs Benutzername@irgendEinRechner:/pfad_auf_dem_server/ ~/fusessh -o follow_symlinks '''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE | FUSERMOUNT''' ====&lt;br /&gt;
 '''$ fusermount -u /dir '''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE | Denied root access to user mounted FUSE file system''' ====&lt;br /&gt;
 This is by design in fuse as a security measure. &lt;br /&gt;
 Pass the '''-o allow_root''' or '''-o allow_other''' option when mounting the filesystem with sshfs.&lt;br /&gt;
 [https://serverfault.com/questions/188894/denied-root-access-to-user-mounted-fuse-file-system https://serverfault.com]&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS TIMEOUT''' ====&lt;br /&gt;
 '''1) In der Datei .ssh/config folgende Zeile hinzufügen (liegt im Homeverzeichnis des Anwenders, bzw. wenn man Automount beim Systemstart macht, ist die Datei /root/.ssh/config zu ändern):'''&lt;br /&gt;
 &lt;br /&gt;
  '''$ sshfs -o ServerAliveInterval=15'''&lt;br /&gt;
  '''$ sshfs-o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3  '''&lt;br /&gt;
  [https://serverfault.com/questions/6709/sshfs-mount-that-survives-disconnect SSHFS mount that survives disconnect| keep connection alive]&lt;br /&gt;
 The options ServerAliveInterval=5,ServerAliveCountMax=3 say that ssh checks every 5 seconds to see whether the remote server is still responding. &lt;br /&gt;
 If it does not receive a response after 3 of these checks, then it disconnects automatically. &lt;br /&gt;
 Thus any process waiting on this mount should hang about 15 seconds max.&lt;br /&gt;
 The options ConnectTimeout=3,ConnectionAttempts=1 are necessary because otherwise ssh will wait a very long time when attempting to reestablish connections, &lt;br /&gt;
 which again causes other processes to hang if they try to access the mount during this time.&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS SYSTEMSTART | /etc/fstab''' ====&lt;br /&gt;
 '''$ sshfs#Benutzername@irgendEinRechner:/pfad_auf_dem_server/ ~/fusessh fuse uid=1003,gid=100,umask=0,allow_other,_netdev 0 0'''&lt;br /&gt;
 &lt;br /&gt;
 '''$ sshfs#user@server:/remote/folder /local/mount/dir fuse IdentityFile=sshkeyfile,Port=XXX,allow_other,_netdev,ServerAliveInterval=45,ServerAliveCountMax=2,reconnect,noatime,auto 0 0 '''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs#user@server:/remote/folder /local/mount/dir fuse IdentityFile=sshkeyfile,Port=XXX,uid=1000,gid=1000,allow_other,_netdev,ServerAliveInterval=45,ServerAliveCountMax=2,reconnect,noatime,auto 0 0 '''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs#user@server:/remote/folder /local/mount/dir fuse delay_connect,IdentityFile=sshkeyfile,Port=XXX,uid=1000,gid=1000,allow_other,_netdev,ServerAliveInterval=45,ServerAliveCountMax=2,reconnect,noatime,auto 0 0 '''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS SHOW MOUNTS/CHECK MOUNTED | /etc/mtab''' ====&lt;br /&gt;
 '''$ mount'''&lt;br /&gt;
 '''$ cat /proc/mounts'''&lt;br /&gt;
 '''$ cat /etc/mtab'''&lt;br /&gt;
 '''$ cat /etc/mtab | grep fuse'''&lt;br /&gt;
 '''$ cat /etc/mtab | grep ssh'''&lt;br /&gt;
 '''$ findmnt'''&lt;br /&gt;
 '''$ findmnt | grep fuse'''&lt;br /&gt;
 '''$ findmnt | grep ssh'''&lt;br /&gt;
 '''$ df -h'''&lt;br /&gt;
 '''$ lsblk -f'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSH Port-Tunneling ''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''Local Forwarding'''===== &lt;br /&gt;
 '''$ ssh -i ~/.ssh/KEY -L 80:IP:80 user@IP -p 2000 '''&lt;br /&gt;
&lt;br /&gt;
===== '''Remote Forwarding'''===== &lt;br /&gt;
&lt;br /&gt;
===== '''Port Forwarding'''=====&lt;br /&gt;
&lt;br /&gt;
==== '''Reverse SSH Tunnel ''' ====&lt;br /&gt;
 ''Check for:''&lt;br /&gt;
 ''1. ServerAliveInterval(sshd_config)''&lt;br /&gt;
 ''2. autossh''&lt;br /&gt;
&lt;br /&gt;
 '''ssh -R 5001:localhost:22 -fN I'''P&lt;br /&gt;
&lt;br /&gt;
==== '''AutoSSH SSH Tunnel ''' ====&lt;br /&gt;
 '''$ autossh -NT -o &amp;quot;ExitOnForwardFailure=yes&amp;quot; -R 5001:localhost:6001 -l USER IP -p 7001 -i /home/USER/.ssh/KEY'''&lt;br /&gt;
&lt;br /&gt;
 '''$ autossh -N -f -i /home/&amp;lt;user&amp;gt;/.ssh/id_rsa -R 22222:localhost:22 &amp;lt;user&amp;gt;@&amp;lt;remote_host&amp;gt;'''&lt;br /&gt;
 '''-N:''' tell ssh to not execute any command, since we only use it for tunneling.&lt;br /&gt;
 '''-f:''' tell autossh to fall into background on start.&lt;br /&gt;
 '''-i:''' tell ssh to use the proper identity.&lt;br /&gt;
 '''-R''' 22222:localhost:22: &lt;br /&gt;
 reverse tunnel remote host's 22222 port to localhost's 22 port. &lt;br /&gt;
 So that we can use ssh -p 22222 localhost on remote host to ssh into local machine.&lt;br /&gt;
&lt;br /&gt;
 '''nano /etc/systemd/system/sshtunnel.service''' &lt;br /&gt;
&lt;br /&gt;
===== '''sshtunnel.service''' =====&lt;br /&gt;
&lt;br /&gt;
 '''[Unit]'''&lt;br /&gt;
 Description=AutoSSH tunnel service&lt;br /&gt;
 #After=network.target&lt;br /&gt;
 After=network-online.target ssh.service&lt;br /&gt;
 '''[Service]'''&lt;br /&gt;
 User=USER&lt;br /&gt;
 Environment=&amp;quot;AUTOSSH_GATETIME=0&amp;quot;&lt;br /&gt;
 RestartSec=30&lt;br /&gt;
 Restart=always&lt;br /&gt;
 ExecStart=/usr/bin/autossh -NT -o &amp;quot;ExitOnForwardFailure=yes&amp;quot; -R 5001:localhost:6000 -l USER IP -p 6001 -i /home/USER/.ssh/KEY&lt;br /&gt;
 ExecStop=pkill -s KILL autossh&lt;br /&gt;
 TimeoutStopSec=10&lt;br /&gt;
 '''[Install]'''&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
 '''systemctl status sshtunnel.service'''&lt;br /&gt;
 '''systemctl daemon-reload'''&lt;br /&gt;
 '''systemctl restart sshtunnel.service'''&lt;br /&gt;
 &lt;br /&gt;
 When using ssh multiplexing, killing the ssh process is often undesirable &lt;br /&gt;
 (it kills all open connections with that host), &lt;br /&gt;
 and you cannot easily access the escape because &amp;quot;escape not available to multiplexed sessions&amp;quot;. &lt;br /&gt;
 The right way is then to run the analogue of the forwarding command that you want to cancel, &lt;br /&gt;
 but adding -O cancel. For instance:&lt;br /&gt;
&lt;br /&gt;
 '''ssh -O cancel -L 5002:192.168.0.10:5002 192.168.178.100'''&lt;br /&gt;
&lt;br /&gt;
 This will disable this port forwarding without terminating the session. Again, this will only   &lt;br /&gt;
 work if ssh multiplexing is in use for the connection to 192.168.178.100&lt;br /&gt;
&lt;br /&gt;
 $ ssh -luser 192.xx.xxx.xx&lt;br /&gt;
&lt;br /&gt;
==== ''' ssh commands ''' ====&lt;br /&gt;
 $ ssh user@192.168.188.2 '[command]'&lt;br /&gt;
 $ ssh user@192.168.188.2 'ls -la /home/user'&lt;br /&gt;
 $ put&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== ''' ssh execute command ''' ====&lt;br /&gt;
 $ ssh user@ip 'ls -la'&lt;br /&gt;
&lt;br /&gt;
==== ''' ssh execute script ''' ====&lt;br /&gt;
&lt;br /&gt;
 $ ssh user@ip &amp;lt; script.sh&lt;br /&gt;
 $ ssh user@ip &amp;quot;bash -s&amp;quot; &amp;lt; script.sh&lt;br /&gt;
&lt;br /&gt;
==== ''' secure file transfer ''' ====&lt;br /&gt;
&lt;br /&gt;
===== ''' SCP file ''' =====&lt;br /&gt;
 $ pscp&lt;br /&gt;
&lt;br /&gt;
 # scp [source][destination]&lt;br /&gt;
 # destination ip:/path/&lt;br /&gt;
&lt;br /&gt;
 '''$ scp /test user@192.168.188.2:/home/user/test'''&lt;br /&gt;
 '''$ scp *.txt user@192.168.188.2:/home/user/txt'''&lt;br /&gt;
&lt;br /&gt;
 '''$ scp user@192.168.188.2:/home/user/txt.txt .'''&lt;br /&gt;
&lt;br /&gt;
[https://unix.stackexchange.com/a/748130/515538 How to copy files from one machine to another using ssh]&lt;br /&gt;
&lt;br /&gt;
===== ''' SCP folder ''' =====&lt;br /&gt;
&lt;br /&gt;
 '''$ scp -r /dir user@192.168.188.2:/home/user/dir '''&lt;br /&gt;
 '''$ scp -r /dir/* user@192.168.188.2:/home/user/dir '''&lt;br /&gt;
 '''$ scp -r user@192.168.188.2:/home/user/dir /home/dir'''&lt;br /&gt;
 '''$ scp -r user@192.168.188.2:/home/user/dir .'''&lt;br /&gt;
&lt;br /&gt;
===== ''' sftp ''' =====&lt;br /&gt;
 &lt;br /&gt;
===== ''' psftp ''' =====&lt;br /&gt;
&lt;br /&gt;
===== ''' ssh Jumphost ''' =====&lt;br /&gt;
#ssh jumphost&lt;br /&gt;
 PC-&amp;gt;Junphost-&amp;gt;IntServer&lt;br /&gt;
 PC-&amp;gt;Firewall-&amp;gt;IntServer&lt;br /&gt;
 ssh -J user@ip user@ip&lt;br /&gt;
&lt;br /&gt;
===== ''' ssh Multi-hop Tunnel ''' =====&lt;br /&gt;
 ssh -L8080:localhost:8080 user@host1&lt;br /&gt;
 SSH Tunnel with -t and -v (verbose)&lt;br /&gt;
&lt;br /&gt;
===== ''' ssh X11 Forwarding ''' =====&lt;br /&gt;
 '''$ ssh -X user@ip'''&lt;br /&gt;
 firefox &amp;amp; &lt;br /&gt;
&lt;br /&gt;
===== ''' ssh config file ''' =====&lt;br /&gt;
#ssh config file in .ssh/config&lt;br /&gt;
Host *&lt;br /&gt;
        User user&lt;br /&gt;
Host linuxhost&lt;br /&gt;
        HostName 192.168.188.2&lt;br /&gt;
        User user&lt;br /&gt;
        Port 2000&lt;br /&gt;
        IdentityFile ~/.ssh/mykey&lt;br /&gt;
&lt;br /&gt;
 ssh config file in /etc/ssh/ssh_config&lt;br /&gt;
&lt;br /&gt;
 debug modus&lt;br /&gt;
 $ ssh debianvm -v&lt;br /&gt;
&lt;br /&gt;
===== ''' ssh VNC|DISPLAY ''' =====&lt;br /&gt;
 ssh user @&amp;lt;ipadresse&amp;gt; &amp;quot;DISPLAY =:0 nohup firefox&amp;quot;&lt;br /&gt;
 ssh -i KEY -p XXXX user@x.x.x.x &amp;quot;DIS1PLAY =:0 nohup firefox&amp;quot;&lt;br /&gt;
 ssh -i KEY -p XXXX -X user@x.x.x.x&lt;br /&gt;
 ssh -i KEY -L 5901:127.0.0.1:5901 -C -N -l -p XXXX user@x.x.x.x&lt;br /&gt;
 ssh -i KEY -p XXXX -L 5901:127.0.0.1:5901 -C -N -l user x.x.x.x&lt;br /&gt;
&lt;br /&gt;
===== '''  socks proxy with google-authenticator!?  ''' =====&lt;br /&gt;
 # in SSHD FILE&lt;br /&gt;
 $ AuthenticationMethods publickey,keyboard-interactive&lt;br /&gt;
 $ nano /etc/pam.d/sshd 	&lt;br /&gt;
&lt;br /&gt;
 # google auth&lt;br /&gt;
 $auth required pam_google_authenticator.so &lt;br /&gt;
 $auth required pam_google_authenticator.so nullok&lt;br /&gt;
&lt;br /&gt;
ssh socks reverse&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Android&amp;diff=1124</id>
		<title>Android</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Android&amp;diff=1124"/>
		<updated>2023-06-14T08:40:18Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==== Custom Recovery ====&lt;br /&gt;
 [https://twrp.me/Devices/ TeamWin - TWRP]&lt;br /&gt;
&lt;br /&gt;
==== Root ====&lt;br /&gt;
 [https://supersuroot.org/ SuperSU Root]&lt;br /&gt;
 [https://magiskmanager.com/ Magisk Manager]&lt;br /&gt;
&lt;br /&gt;
==== OS ====&lt;br /&gt;
 [https://maruos.com/ maru os]&lt;br /&gt;
 [https://ubuntu-touch.io/de/ Ubuntu Touch | ubports]&lt;br /&gt;
&lt;br /&gt;
==== APK Cleaner ====&lt;br /&gt;
[https://www.titaniumtrack.com/titanium-backup.html Titanium Backup ]&lt;br /&gt;
&lt;br /&gt;
==== Bootanimation ====&lt;br /&gt;
 /system/media/bootanimation.zip&lt;br /&gt;
 1080x1920&lt;br /&gt;
 720x1280&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Ssh&amp;diff=1123</id>
		<title>Ssh</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Ssh&amp;diff=1123"/>
		<updated>2023-06-14T08:27:48Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==== ''' AUTHOR | HACKBUGZ ''' ====&lt;br /&gt;
 [https://stackexchange.com/users/23684174/hackbugz?tab=accounts StackExchange | HACKBUGZ]&lt;br /&gt;
 [https://www.tiktok.com/@hackbugz? TIKTOK | HACKBUGZ]&lt;br /&gt;
&lt;br /&gt;
==== ''' Links ''' ====&lt;br /&gt;
 [https://linux.die.net/man/1/sshfs sshfs(1) - Linux man page]&lt;br /&gt;
 [https://wiki.ubuntuusers.de/FUSE/sshfs/ wiki.ubuntuusers.de FUSE/SSHFS]&lt;br /&gt;
 [https://wiki.ubuntuusers.de/FUSE/ wiki.ubuntuusers.de FUSE]  &lt;br /&gt;
&lt;br /&gt;
 [https://www.ssh.com/iam/ssh-key-management/ SSH Key Management]&lt;br /&gt;
 [https://www.ssh.com/ssh/authorized_keys/ Authorized_keys file in SSH]&lt;br /&gt;
 [https://unix.stackexchange.com/questions/208960/how-to-restrict-a-user-to-one-folder-and-not-allow-them-to-move-out-his-folder How to restrict a user to one folder and not allow them to move out his folder - Unix &amp;amp; Linux Stack Exchange]&lt;br /&gt;
 [https://www.tecmint.com/restrict-ssh-user-to-directory-using-chrooted-jail/ Restrict SSH User Access to Certain Directory Using Chrooted Jail]&lt;br /&gt;
 [https://www.cyberciti.biz/faq/debian-ubuntu-restricting-ssh-user-session-to-a-directory-chrooted-jail/ Debian/Ubuntu Linux: Restrict an SSH user session to a specific directory by setting chrooted jail - nixCraft]&lt;br /&gt;
 [https://wiki.archlinux.org/index.php/SSHFS SSHFS - ArchWiki]&lt;br /&gt;
&lt;br /&gt;
 [https://askubuntu.com/questions/48129/how-to-create-a-restricted-ssh-user-for-port-forwarding security - How to create a restricted SSH user for port forwarding? - Ask Ubuntu]&lt;br /&gt;
 [https://www.linux-magazin.de/ausgaben/2018/08/einfuehrung-2-5/ Aus dem Alltag eines Sysadmin: Reverse-SSH-Tunnel und Autossh]&lt;br /&gt;
 [https://www.howtogeek.com/428413/what-is-reverse-ssh-tunneling-and-how-to-use-it/ What Is Reverse SSH Tunneling? (and How to Use It)]&lt;br /&gt;
 [https://unix.stackexchange.com/questions/100859/ssh-tunnel-without-shell-on-ssh-server ssh tunneling - SSH: tunnel without shell on ssh server - Unix &amp;amp; Linux Stack Exchange]&lt;br /&gt;
 [https://serverfault.com/questions/56566/ssh-tunneling-only-access linux - ssh tunneling only access - Server Fault]&lt;br /&gt;
 [https://www.it-react.com/index.php/2020/01/06/how-to-setup-reverse-ssh-tunnel-on-linux/ How to Setup Reverse SSH Tunnel on Raspberry Pi behind a 3G USB stick modem - IT-REACT]&lt;br /&gt;
 [https://dev.to/bulletmark/create-a-reverse-ssh-tunnel-for-remote-access-to-a-restricted-machine-1ma0 Create a reverse SSH tunnel for remote access to a restricted Linux machine - DEV Community]&lt;br /&gt;
 [https://unix.stackexchange.com/questions/55106/disable-user-shell-for-security-reasons https://unix.stackexchange.com/questions/55106/disable-user-shell-for-security-reasons]&lt;br /&gt;
 [https://www.everythingcli.org/ssh-tunnelling-for-fun-and-profit-autossh/ SSH tunnelling for fun and profit: Autossh]&lt;br /&gt;
 [https://man7.org/linux/man-pages/man1/ssh-keygen.1.html ssh-keygen(1) - Linux manual page]&lt;br /&gt;
 [https://unix.stackexchange.com/questions/128894/ssh-exchange-identification-connection-closed-by-remote-host-not-using-hosts-d linux - ssh_exchange_identification: Connection closed by remote host (not using hosts.deny) - Unix &amp;amp; Linux Stack Exchange]&lt;br /&gt;
&lt;br /&gt;
 [https://github.com/szmi Miklos Szeredi | github]&lt;br /&gt;
 [https://indico.cern.ch/event/608592/contributions/2830117/attachments/1592339/2520491/Evolution_of_FUSE_and_OverlayFS.pdf  Evolution of FUSE and OverlayFS | Miklos Szeredi]&lt;br /&gt;
&lt;br /&gt;
 [https://explainshell.com/explain?cmd=ssh+-L+-N+-f+-l+-R+-i+-1 explainshell]&lt;br /&gt;
 [https://wiki.ubuntuusers.de/Screen/ Screen]&lt;br /&gt;
 [https://wiki.ubuntuusers.de/nohup/ nohup]&lt;br /&gt;
 [https://linuxcommand.org/lc3_man_pages/ssh1.html linuxcommand ssh1]&lt;br /&gt;
 open ip&lt;br /&gt;
&lt;br /&gt;
SSHFS und FUSE sind zwei verschiedene Dinge, die jedoch eng miteinander verwandt sind.&lt;br /&gt;
&lt;br /&gt;
FUSE (Filesystem in Userspace) ist ein Framework für das Betriebssystem Linux, das es ermöglicht, Dateisysteme in Benutzermodus-Programmen zu implementieren, anstatt diese im Kernelmodus implementieren zu müssen. Durch die Verwendung von FUSE können Benutzermodus-Programme wie SSHFS auf einfache Weise ein Dateisystem erstellen, das wie ein herkömmliches Dateisystem gemountet werden kann.&lt;br /&gt;
&lt;br /&gt;
SSHFS (SSH Filesystem) ist eine Erweiterung des FUSE-Frameworks, mit der man ein Dateisystem über SSH mounten kann. Das bedeutet, dass man über eine sichere Verbindung (SSH) auf Dateien und Verzeichnisse auf einem entfernten System zugreifen kann, als wären sie auf dem eigenen Computer vorhanden.&lt;br /&gt;
&lt;br /&gt;
Zusammenfassend kann man sagen, dass FUSE ein Framework ist, das es ermöglicht, Dateisysteme in Benutzermodus-Programmen zu implementieren, während SSHFS eine Anwendung ist, die FUSE verwendet, um ein Dateisystem über SSH zu mounten.&lt;br /&gt;
&lt;br /&gt;
SFTP und SSHFS sind ähnliche Technologien, die beide eine sichere Möglichkeit bieten, auf entfernte Dateien und Verzeichnisse zuzugreifen. Beide basieren auf dem SSH-Protokoll, das eine sichere Verschlüsselung der Datenübertragung ermöglicht. Der Hauptunterschied zwischen SFTP und SSHFS liegt jedoch in der Art und Weise, wie sie die Remote-Dateisysteme bereitstellen.&lt;br /&gt;
&lt;br /&gt;
SFTP (Secure File Transfer Protocol) ist ein Dateiübertragungsprotokoll, das auf dem SSH-Protokoll basiert und es ermöglicht, Dateien zwischen lokalen und entfernten Systemen zu übertragen. SFTP bietet jedoch keine Möglichkeit, ein entferntes Dateisystem zu mounten. Stattdessen bietet SFTP einen Dateizugriff über eine sichere Verbindung, ähnlich wie beim FTP-Protokoll.&lt;br /&gt;
&lt;br /&gt;
SSHFS (SSH Filesystem) hingegen ist ein FUSE (Filesystem in Userspace)-basiertes Dateisystem, das es ermöglicht, ein entferntes Dateisystem als lokales Dateisystem zu mounten. SSHFS verwendet das SSH-Protokoll, um eine sichere Verbindung zu einem entfernten System herzustellen und ein entferntes Dateisystem als lokales Dateisystem zu mounten. Dadurch können Sie auf entfernte Dateien und Verzeichnisse zugreifen, als wären sie auf Ihrem lokalen Computer vorhanden.&lt;br /&gt;
&lt;br /&gt;
Wenn es darum geht, auf entfernte Dateien und Verzeichnisse zuzugreifen, ist SSHFS in der Regel die bessere Option, da es die Möglichkeit bietet, ein entferntes Dateisystem als lokales Dateisystem zu mounten, was die Arbeit mit entfernten Dateien und Verzeichnissen erleichtert. SFTP ist jedoch eine gute Option, wenn Sie nur Dateien übertragen müssen, ohne das gesamte Dateisystem mounten zu müssen.&lt;br /&gt;
&lt;br /&gt;
=== '''SSH|SCP|SFTP FUSE, SSHFS''' ===&lt;br /&gt;
 '''Mit dem SSH-Clients SSHSSH|SCP|SFTP kann man sich über ein Terminal auf entfernte Rechner anmelden.'''&lt;br /&gt;
 '''Die Kommunikation und die Authentifizierung findet dabei verschlüsselt statt.'''&lt;br /&gt;
 '''SSH kann dabei interaktiv oder nicht interaktiv genutzt werden'''&lt;br /&gt;
&lt;br /&gt;
=== '''RANKING DER REMOTE CLIENTS|TOOLS NACH SICHERHEIT''' ===&lt;br /&gt;
 # '''SSH'''&lt;br /&gt;
 # '''SCP'''&lt;br /&gt;
 # '''SFTP'''&lt;br /&gt;
 # '''RLOGIN'''&lt;br /&gt;
 # '''TELNET'''&lt;br /&gt;
 # '''FTP'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSH STATUS''' ====&lt;br /&gt;
 '''$ systemctl status ssh '''&lt;br /&gt;
&lt;br /&gt;
 '''$ whoami'''&lt;br /&gt;
 '''$ who'''&lt;br /&gt;
 '''$ w'''&lt;br /&gt;
&lt;br /&gt;
 '''$ ps'''&lt;br /&gt;
 '''$ ps aux'''&lt;br /&gt;
 '''$ ps aux | grep ssh '''&lt;br /&gt;
 '''$ ps aux | grep sshd '''&lt;br /&gt;
&lt;br /&gt;
 '''$ lsof -i -n | egrep 'ssh' '''&lt;br /&gt;
 '''$ lsof -i -n | egrep 'sshd' '''&lt;br /&gt;
&lt;br /&gt;
 '''$ ss '''&lt;br /&gt;
 '''$ ss -l'''&lt;br /&gt;
 '''$ ss | grep tcp'''&lt;br /&gt;
 '''$ ss | grep -i ssh'''&lt;br /&gt;
 '''$ ss -u -a'''&lt;br /&gt;
&lt;br /&gt;
 '''$ last -a | grep -i still'''&lt;br /&gt;
&lt;br /&gt;
 '''apk*error'''&lt;br /&gt;
 ''$ service ssh status ''&lt;br /&gt;
 ''$ netstat -tanup | grep ssh ''&lt;br /&gt;
 ''$ netstat -tnpa | grep 'ESTABLISHED.*sshd''&lt;br /&gt;
 ''$ netstat -an | grep 8090/port''&lt;br /&gt;
 ''$ firewall-cmd --list-all-zones ''&lt;br /&gt;
&lt;br /&gt;
==== '''SSH tools''' ====&lt;br /&gt;
 '''ssh-keygen'''&lt;br /&gt;
 '''$ ssh-keyscan ip &amp;gt; known_hosts'''&lt;br /&gt;
 '''$ ssh-keyscan -f txtwithhosts'''&lt;br /&gt;
&lt;br /&gt;
 '''ssh-keyscan'''&lt;br /&gt;
&lt;br /&gt;
 '''ssh-copy-id'''&lt;br /&gt;
&lt;br /&gt;
 '''ssh-add'''&lt;br /&gt;
 '''$ ssh-add -l '''&lt;br /&gt;
 '''$ ssh-add KEY '''&lt;br /&gt;
&lt;br /&gt;
 '''ssh-agent'''&lt;br /&gt;
 '''$ pgrep ssh-agent '''&lt;br /&gt;
 '''$ ps aux | grep ssh-agent'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSH|SSHFS|FUSE CONFIG FILES''' ====&lt;br /&gt;
 '''$ cat /etc/ssh/sshd_config'''&lt;br /&gt;
 '''$ cat /etc/ssh/ssh_config'''&lt;br /&gt;
 '''$ /etc/fuse.conf'''&lt;br /&gt;
 '''$ /etc/modules'''&lt;br /&gt;
''&lt;br /&gt;
 '''''IN LAB'''''&lt;br /&gt;
 '''AllowHosts'''&lt;br /&gt;
 '''AllowUsers'''&lt;br /&gt;
 '''AllowGroups'''&lt;br /&gt;
 '''ChRootGroups(Syntax: AllowGroups)'''&lt;br /&gt;
 '''ChRootUsers(Syntax: AllowUsers)'''&lt;br /&gt;
&lt;br /&gt;
==== '''Create SSH Key''' ====&lt;br /&gt;
 '''$ ssh-keygen -t ed25519 -b 4096'''&lt;br /&gt;
&lt;br /&gt;
==== '''Copy SSH Key''' ====&lt;br /&gt;
 '''$ ssh-copy-id  -i KEY user@IP'''&lt;br /&gt;
 '''$ ssh-copy-id  -i ~/.ssh/KEY user@IP'''&lt;br /&gt;
&lt;br /&gt;
 ''copy key while login with key''&lt;br /&gt;
 '''$ ssh-copy-id -i KEYTOCOPY -f -o 'IdentityFile KEYTOLOGIN' -p 5000 USER@IP'''&lt;br /&gt;
&lt;br /&gt;
==== '''Login with SSH Key''' ====&lt;br /&gt;
 '''$ ssh -i ~/.ssh/KEY user@IP -p 5001'''&lt;br /&gt;
&lt;br /&gt;
==== '''ssh config files &amp;amp; folders''' ====&lt;br /&gt;
 '''/etc/ssh/ssh_config'''&lt;br /&gt;
 '''/etc/ssh/sshd_config'''&lt;br /&gt;
 '''~/.ssh'''&lt;br /&gt;
 '''~/.ssh/authorized_keys '''&lt;br /&gt;
 '''~/.ssh/known_hosts'''&lt;br /&gt;
&lt;br /&gt;
==== '''ssh sshd_config file''' ====&lt;br /&gt;
 '''$ nano /etc/ssh/sshd_config'''&lt;br /&gt;
 ''' Port 5000'''&lt;br /&gt;
 ''' PubkeyAuthentication yes'''&lt;br /&gt;
 ''' PasswordAuthentication no'''&lt;br /&gt;
 ''' PermitEmptyPasswords no'''&lt;br /&gt;
 ''' X11Forwarding no'''&lt;br /&gt;
 ''' Banner /path/ (Message before login)'''&lt;br /&gt;
 ''''' ListenAddress (Strict/Diff Networks)'''''&lt;br /&gt;
 ''''' MaxSessions '''''&lt;br /&gt;
 [https://unix.stackexchange.com/questions/26170/sshd-config-maxsessions-parameter  MaxSessions parameter]&lt;br /&gt;
&lt;br /&gt;
==== '''ssh motd file''' ====&lt;br /&gt;
 '''$ nano /etc/motd (Message after Login)'''&lt;br /&gt;
&lt;br /&gt;
==== '''ssh known_hosts file''' ====&lt;br /&gt;
 '''$ nano ~/.ssh/known_hosts '''&lt;br /&gt;
&lt;br /&gt;
==== '''ssh authorized_keys file''' ====&lt;br /&gt;
 '''$ nano ~/.ssh/authorized_keys '''&lt;br /&gt;
&lt;br /&gt;
 '''How to manually copy SSH public keys to server:'''&lt;br /&gt;
 On the local machine&lt;br /&gt;
 '''$ cat ~/.ssh/id_rsa.pub'''&lt;br /&gt;
 copy&lt;br /&gt;
 ''ssh-rsa .STRING. USER@IP''&lt;br /&gt;
&lt;br /&gt;
 On the remote server paste the line to:&lt;br /&gt;
 '''~/.ssh/authorized_keys'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE''' ====&lt;br /&gt;
 '''$ sshfs user@host:/dir /dir -o IdentityFile=~/.ssh/KEY'''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs user@host:/dir /dir -o IdentityFile=~/.ssh/KEY -o idmap=user -o uid=$(id -u) -o gid=$(id -g)'''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs user@host:/dir /dir -C -p 5001'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE | USER MAPPING''' ====&lt;br /&gt;
 '''$ sshfs Benutzername@irgendEinRechner:/pfad_auf_dem_server/ ~/fusessh -o idmap=user -o uid=$(id -u) -o gid=$(id -g) '''&lt;br /&gt;
 '''$ sshfs user@host:/dir /dir -o IdentityFile=~/.ssh/KEY -o idmap=user -o uid=$(id -u) -o gid=$(id -g) -o nonempty -p 5001 '''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE | SYMLINKS''' ====&lt;br /&gt;
 '''$ sshfs -o follow_symlinks'''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs Benutzername@irgendEinRechner:/pfad_auf_dem_server/ ~/fusessh -o follow_symlinks '''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE | FUSERMOUNT''' ====&lt;br /&gt;
 '''$ fusermount -u /dir '''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE | Denied root access to user mounted FUSE file system''' ====&lt;br /&gt;
 This is by design in fuse as a security measure. &lt;br /&gt;
 Pass the '''-o allow_root''' or '''-o allow_other''' option when mounting the filesystem with sshfs.&lt;br /&gt;
 [https://serverfault.com/questions/188894/denied-root-access-to-user-mounted-fuse-file-system https://serverfault.com]&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS TIMEOUT''' ====&lt;br /&gt;
 '''1) In der Datei .ssh/config folgende Zeile hinzufügen (liegt im Homeverzeichnis des Anwenders, bzw. wenn man Automount beim Systemstart macht, ist die Datei /root/.ssh/config zu ändern):'''&lt;br /&gt;
 &lt;br /&gt;
  '''$ sshfs -o ServerAliveInterval=15'''&lt;br /&gt;
  '''$ sshfs-o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3  '''&lt;br /&gt;
  [https://serverfault.com/questions/6709/sshfs-mount-that-survives-disconnect SSHFS mount that survives disconnect| keep connection alive]&lt;br /&gt;
 The options ServerAliveInterval=5,ServerAliveCountMax=3 say that ssh checks every 5 seconds to see whether the remote server is still responding. &lt;br /&gt;
 If it does not receive a response after 3 of these checks, then it disconnects automatically. &lt;br /&gt;
 Thus any process waiting on this mount should hang about 15 seconds max.&lt;br /&gt;
 The options ConnectTimeout=3,ConnectionAttempts=1 are necessary because otherwise ssh will wait a very long time when attempting to reestablish connections, &lt;br /&gt;
 which again causes other processes to hang if they try to access the mount during this time.&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS SYSTEMSTART | /etc/fstab''' ====&lt;br /&gt;
 '''$ sshfs#Benutzername@irgendEinRechner:/pfad_auf_dem_server/ ~/fusessh fuse uid=1003,gid=100,umask=0,allow_other,_netdev 0 0'''&lt;br /&gt;
 &lt;br /&gt;
 '''$ sshfs#user@server:/remote/folder /local/mount/dir fuse IdentityFile=sshkeyfile,Port=XXX,allow_other,_netdev,ServerAliveInterval=45,ServerAliveCountMax=2,reconnect,noatime,auto 0 0 '''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs#user@server:/remote/folder /local/mount/dir fuse IdentityFile=sshkeyfile,Port=XXX,uid=1000,gid=1000,allow_other,_netdev,ServerAliveInterval=45,ServerAliveCountMax=2,reconnect,noatime,auto 0 0 '''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs#user@server:/remote/folder /local/mount/dir fuse delay_connect,IdentityFile=sshkeyfile,Port=XXX,uid=1000,gid=1000,allow_other,_netdev,ServerAliveInterval=45,ServerAliveCountMax=2,reconnect,noatime,auto 0 0 '''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS SHOW MOUNTS/CHECK MOUNTED | /etc/mtab''' ====&lt;br /&gt;
 '''$ mount'''&lt;br /&gt;
 '''$ cat /proc/mounts'''&lt;br /&gt;
 '''$ cat /etc/mtab'''&lt;br /&gt;
 '''$ cat /etc/mtab | grep fuse'''&lt;br /&gt;
 '''$ cat /etc/mtab | grep ssh'''&lt;br /&gt;
 '''$ findmnt'''&lt;br /&gt;
 '''$ findmnt | grep fuse'''&lt;br /&gt;
 '''$ findmnt | grep ssh'''&lt;br /&gt;
 '''$ df -h'''&lt;br /&gt;
 '''$ lsblk -f'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSH Port-Tunneling ''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''Local Forwarding'''===== &lt;br /&gt;
 '''$ ssh -i ~/.ssh/KEY -L 80:IP:80 user@IP -p 2000 '''&lt;br /&gt;
&lt;br /&gt;
===== '''Remote Forwarding'''===== &lt;br /&gt;
&lt;br /&gt;
===== '''Port Forwarding'''=====&lt;br /&gt;
&lt;br /&gt;
==== '''Reverse SSH Tunnel ''' ====&lt;br /&gt;
 ''Check for:''&lt;br /&gt;
 ''1. ServerAliveInterval(sshd_config)''&lt;br /&gt;
 ''2. autossh''&lt;br /&gt;
&lt;br /&gt;
 '''ssh -R 5001:localhost:22 -fN I'''P&lt;br /&gt;
&lt;br /&gt;
==== '''AutoSSH SSH Tunnel ''' ====&lt;br /&gt;
 '''$ autossh -NT -o &amp;quot;ExitOnForwardFailure=yes&amp;quot; -R 5001:localhost:6001 -l USER IP -p 7001 -i /home/USER/.ssh/KEY'''&lt;br /&gt;
&lt;br /&gt;
 '''$ autossh -N -f -i /home/&amp;lt;user&amp;gt;/.ssh/id_rsa -R 22222:localhost:22 &amp;lt;user&amp;gt;@&amp;lt;remote_host&amp;gt;'''&lt;br /&gt;
 '''-N:''' tell ssh to not execute any command, since we only use it for tunneling.&lt;br /&gt;
 '''-f:''' tell autossh to fall into background on start.&lt;br /&gt;
 '''-i:''' tell ssh to use the proper identity.&lt;br /&gt;
 '''-R''' 22222:localhost:22: &lt;br /&gt;
 reverse tunnel remote host's 22222 port to localhost's 22 port. &lt;br /&gt;
 So that we can use ssh -p 22222 localhost on remote host to ssh into local machine.&lt;br /&gt;
&lt;br /&gt;
 '''nano /etc/systemd/system/sshtunnel.service''' &lt;br /&gt;
&lt;br /&gt;
===== '''sshtunnel.service''' =====&lt;br /&gt;
&lt;br /&gt;
 '''[Unit]'''&lt;br /&gt;
 Description=AutoSSH tunnel service&lt;br /&gt;
 #After=network.target&lt;br /&gt;
 After=network-online.target ssh.service&lt;br /&gt;
 '''[Service]'''&lt;br /&gt;
 User=USER&lt;br /&gt;
 Environment=&amp;quot;AUTOSSH_GATETIME=0&amp;quot;&lt;br /&gt;
 RestartSec=30&lt;br /&gt;
 Restart=always&lt;br /&gt;
 ExecStart=/usr/bin/autossh -NT -o &amp;quot;ExitOnForwardFailure=yes&amp;quot; -R 5001:localhost:6000 -l USER IP -p 6001 -i /home/USER/.ssh/KEY&lt;br /&gt;
 ExecStop=pkill -s KILL autossh&lt;br /&gt;
 TimeoutStopSec=10&lt;br /&gt;
 '''[Install]'''&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
 '''systemctl status sshtunnel.service'''&lt;br /&gt;
 '''systemctl daemon-reload'''&lt;br /&gt;
 '''systemctl restart sshtunnel.service'''&lt;br /&gt;
 &lt;br /&gt;
 When using ssh multiplexing, killing the ssh process is often undesirable &lt;br /&gt;
 (it kills all open connections with that host), &lt;br /&gt;
 and you cannot easily access the escape because &amp;quot;escape not available to multiplexed sessions&amp;quot;. &lt;br /&gt;
 The right way is then to run the analogue of the forwarding command that you want to cancel, &lt;br /&gt;
 but adding -O cancel. For instance:&lt;br /&gt;
&lt;br /&gt;
 '''ssh -O cancel -L 5002:192.168.0.10:5002 192.168.178.100'''&lt;br /&gt;
&lt;br /&gt;
 This will disable this port forwarding without terminating the session. Again, this will only   &lt;br /&gt;
 work if ssh multiplexing is in use for the connection to 192.168.178.100&lt;br /&gt;
&lt;br /&gt;
 $ ssh -luser 192.xx.xxx.xx&lt;br /&gt;
&lt;br /&gt;
==== ''' ssh commands ''' ====&lt;br /&gt;
 $ ssh user@192.168.188.2 '[command]'&lt;br /&gt;
 $ ssh user@192.168.188.2 'ls -la /home/user'&lt;br /&gt;
 $ put&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== ''' ssh execute command ''' ====&lt;br /&gt;
 $ ssh user@ip 'ls -la'&lt;br /&gt;
&lt;br /&gt;
==== ''' ssh execute script ''' ====&lt;br /&gt;
&lt;br /&gt;
 $ ssh user@ip &amp;lt; script.sh&lt;br /&gt;
 $ ssh user@ip &amp;quot;bash -s&amp;quot; &amp;lt; script.sh&lt;br /&gt;
&lt;br /&gt;
==== ''' secure file transfer ''' ====&lt;br /&gt;
&lt;br /&gt;
===== ''' SCP file ''' =====&lt;br /&gt;
 $ pscp&lt;br /&gt;
&lt;br /&gt;
 # scp [source][destination]&lt;br /&gt;
 # destination ip:/path/&lt;br /&gt;
&lt;br /&gt;
 '''$ scp /test user@192.168.188.2:/home/user/test'''&lt;br /&gt;
 '''$ scp *.txt user@192.168.188.2:/home/user/txt'''&lt;br /&gt;
&lt;br /&gt;
 '''$ scp user@192.168.188.2:/home/user/txt.txt .'''&lt;br /&gt;
&lt;br /&gt;
[https://unix.stackexchange.com/a/748130/515538 How to copy files from one machine to another using ssh]&lt;br /&gt;
&lt;br /&gt;
===== ''' SCP folder ''' =====&lt;br /&gt;
&lt;br /&gt;
 '''$ scp -r /dir user@192.168.188.2:/home/user/dir '''&lt;br /&gt;
 '''$ scp -r /dir/* user@192.168.188.2:/home/user/dir '''&lt;br /&gt;
 '''$ scp -r user@192.168.188.2:/home/user/dir /home/dir'''&lt;br /&gt;
 '''$ scp -r user@192.168.188.2:/home/user/dir .'''&lt;br /&gt;
&lt;br /&gt;
===== ''' sftp ''' =====&lt;br /&gt;
 &lt;br /&gt;
===== ''' psftp ''' =====&lt;br /&gt;
&lt;br /&gt;
===== ''' ssh Jumphost ''' =====&lt;br /&gt;
#ssh jumphost&lt;br /&gt;
 PC-&amp;gt;Junphost-&amp;gt;IntServer&lt;br /&gt;
 PC-&amp;gt;Firewall-&amp;gt;IntServer&lt;br /&gt;
 ssh -J user@ip user@ip&lt;br /&gt;
&lt;br /&gt;
===== ''' ssh Multi-hop Tunnel ''' =====&lt;br /&gt;
 ssh -L8080:localhost:8080 user@host1&lt;br /&gt;
 SSH Tunnel with -t and -v (verbose)&lt;br /&gt;
&lt;br /&gt;
===== ''' ssh X11 Forwarding ''' =====&lt;br /&gt;
 '''$ ssh -X user@ip'''&lt;br /&gt;
 firefox &amp;amp; &lt;br /&gt;
&lt;br /&gt;
===== ''' ssh config file ''' =====&lt;br /&gt;
#ssh config file in .ssh/config&lt;br /&gt;
Host *&lt;br /&gt;
        User user&lt;br /&gt;
Host linuxhost&lt;br /&gt;
        HostName 192.168.188.2&lt;br /&gt;
        User user&lt;br /&gt;
        Port 2000&lt;br /&gt;
        IdentityFile ~/.ssh/mykey&lt;br /&gt;
&lt;br /&gt;
 ssh config file in /etc/ssh/ssh_config&lt;br /&gt;
&lt;br /&gt;
 debug modus&lt;br /&gt;
 $ ssh debianvm -v&lt;br /&gt;
&lt;br /&gt;
===== ''' ssh VNC|DISPLAY ''' =====&lt;br /&gt;
 ssh user @&amp;lt;ipadresse&amp;gt; &amp;quot;DISPLAY =:0 nohup firefox&amp;quot;&lt;br /&gt;
 ssh -i KEY -p XXXX user@x.x.x.x &amp;quot;DIS1PLAY =:0 nohup firefox&amp;quot;&lt;br /&gt;
 ssh -i KEY -p XXXX -X user@x.x.x.x&lt;br /&gt;
 ssh -i KEY -L 5901:127.0.0.1:5901 -C -N -l -p XXXX user@x.x.x.x&lt;br /&gt;
 ssh -i KEY -p XXXX -L 5901:127.0.0.1:5901 -C -N -l user x.x.x.x&lt;br /&gt;
&lt;br /&gt;
===== '''  socks proxy with google-authenticator!?  ''' =====&lt;br /&gt;
 # in SSHD FILE&lt;br /&gt;
 $ AuthenticationMethods publickey,keyboard-interactive&lt;br /&gt;
 $ nano /etc/pam.d/sshd 	&lt;br /&gt;
&lt;br /&gt;
 # google auth&lt;br /&gt;
 $auth required pam_google_authenticator.so &lt;br /&gt;
 $auth required pam_google_authenticator.so nullok&lt;br /&gt;
&lt;br /&gt;
ssh socks reverse&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Bash&amp;diff=1122</id>
		<title>Bash</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Bash&amp;diff=1122"/>
		<updated>2023-06-08T09:55:57Z</updated>

		<summary type="html">&lt;p&gt;Geist: /* RANDOM STRINGS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Script ==&lt;br /&gt;
 '''$ type script'''&lt;br /&gt;
 '''$ chmod +x script'''&lt;br /&gt;
 '''$ ./script'''&lt;br /&gt;
 '''$ .script'''&lt;br /&gt;
 '''$ source script'''&lt;br /&gt;
 '''$ bash script'''&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
&lt;br /&gt;
== Command Line ==&lt;br /&gt;
 '''Everything is a file'''&lt;br /&gt;
 '''255 Byte'''&lt;br /&gt;
 The maximum length for a file name is 255 bytes.&lt;br /&gt;
 The maximum combined length of both the file name and path name is 4096 bytes.&lt;br /&gt;
 This length matches the PATH_MAX that is supported by the operating system.&lt;br /&gt;
 '''Names are case-sensitive'''&lt;br /&gt;
&lt;br /&gt;
==== Special chars to avoid in names/filenames ====&lt;br /&gt;
 /   Never&lt;br /&gt;
 \   Escaped&lt;br /&gt;
 -   Never at beginning&lt;br /&gt;
 []  Escaped&lt;br /&gt;
 {}  Escaped&lt;br /&gt;
 *   Escaped&lt;br /&gt;
 '   Escaped&lt;br /&gt;
 &amp;quot;   Escaped&lt;br /&gt;
&lt;br /&gt;
==== Wildcards ====&lt;br /&gt;
 '''*'''  asterisk        | any char&lt;br /&gt;
 '''?'''  question mark   | single char&lt;br /&gt;
 '''[]''' square brackets | set of single char or a range of chars&lt;br /&gt;
&lt;br /&gt;
==== List files and folders ====&lt;br /&gt;
 '''$ ls'''&lt;br /&gt;
 '''$ ls folder'''&lt;br /&gt;
 '''$ ls ./folder'''&lt;br /&gt;
 '''$ ls /path/folder'''&lt;br /&gt;
 '''$ ls ~/folder'''&lt;br /&gt;
 '''$ ls ~/folder/*.jpg'''&lt;br /&gt;
 '''$ ls ~/folder/*txt*'''&lt;br /&gt;
 '''$ ls -R folder''' (list of subfolders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -l''' (single column)&lt;br /&gt;
  '''-''' regular file&lt;br /&gt;
  '''_''' executable&lt;br /&gt;
  '''d''' directory&lt;br /&gt;
  '''l''' symbolic link&lt;br /&gt;
  '''s''' socket&lt;br /&gt;
  '''b''' block device&lt;br /&gt;
  '''c''' character device&lt;br /&gt;
  '''p''' named pipe&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -m''' (comma-separated list)&lt;br /&gt;
 '''$ ls -a''' (hidden files and folders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -F''' (file type)&lt;br /&gt;
 Symbols and file types&lt;br /&gt;
  '''*''' Executable&lt;br /&gt;
  '''/''' Directory&lt;br /&gt;
  '''@''' Symbolic link&lt;br /&gt;
  '''|''' FIFO&lt;br /&gt;
  '''=''' Socket&lt;br /&gt;
&lt;br /&gt;
 '''$ ls --color (content in color)'''&lt;br /&gt;
 '''$ dircolors'''&lt;br /&gt;
 '''$ dircolors --print-database'''&lt;br /&gt;
 '''$ ls -F --color'''&lt;br /&gt;
 '''$ la -la'''&lt;br /&gt;
 '''$ ls -r'''&lt;br /&gt;
 '''$ ls -X''' (sort by extension)&lt;br /&gt;
 '''$ ls -t''' (sort by date)&lt;br /&gt;
 '''$ ls -S''' (sort by content)&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
 '''$ ls -laS'''&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
&lt;br /&gt;
 '''$ pwd''' (current path)&lt;br /&gt;
&lt;br /&gt;
==== Change directory with '''cd'''====&lt;br /&gt;
 '''$ cd folder'''&lt;br /&gt;
 '''$ cd ~'''&lt;br /&gt;
 '''$ cd -'''&lt;br /&gt;
 '''$ cd ..'''&lt;br /&gt;
&lt;br /&gt;
==== Create and change current time of file '''touch'''====&lt;br /&gt;
 create new, empty file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 update access and modification time for file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 any desired time for file&lt;br /&gt;
 '''$ touch -t [[CC]YY]MMDDhhmm[.ss]file'''&lt;br /&gt;
&lt;br /&gt;
==== Create directory with '''mkdir'''====&lt;br /&gt;
 new directory&lt;br /&gt;
 '''$ mkdir folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory with subdirectories&lt;br /&gt;
 '''$ mkdir -p test/sub/folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory and show steps&lt;br /&gt;
 '''$ mkdir -v test/sub/folder'''&lt;br /&gt;
 '''$ mkdir -pv test/sub/folder'''&lt;br /&gt;
 &lt;br /&gt;
== Count files and directories, summary size and '''EXCLUDE''' folders ==&lt;br /&gt;
'''[https://unix.stackexchange.com/q/691703/515538 '''bash count files and directory, summary size and EXCLUDE folders that are fuse|sshfs''']'''&lt;br /&gt;
&lt;br /&gt;
==== Full size of a folder with '''du'''====&lt;br /&gt;
 get the full size of workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs workdir'''&lt;br /&gt;
&lt;br /&gt;
 get the full size of workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs --exclude=mysshf workdir'''&lt;br /&gt;
&lt;br /&gt;
==== Count files in folder with '''find'''====&lt;br /&gt;
 count files in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune -o \( -type f -print \) | wc -l'''&lt;br /&gt;
&lt;br /&gt;
==== Count folders in folder with '''find'''====&lt;br /&gt;
 count folders in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune \( -type d -print \)  | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Building blocks ==&lt;br /&gt;
&lt;br /&gt;
==== run several commands sequentially with ''';''' and '''&amp;amp;&amp;amp;''' ====&lt;br /&gt;
 executed sequential no matter if successfully or unsucessfully&lt;br /&gt;
 ''';'''&lt;br /&gt;
 '''$ ls /home ; ls notfound; ls ~'''&lt;br /&gt;
&lt;br /&gt;
 executed sequential if successfully run next&lt;br /&gt;
 '''&amp;amp;&amp;amp;'''&lt;br /&gt;
 '''$ ls /home &amp;amp;&amp;amp; ls notfound &amp;amp;&amp;amp; ls ~'''&lt;br /&gt;
&lt;br /&gt;
== PORT SCAN with bash's built-in /dev/tcp ==&lt;br /&gt;
'''check if host response on a give port with bash's built-in /dev/tcp'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 HOST_PORT=&amp;quot;80&amp;quot;&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 exit; '''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 for HOST_PORT in {1..1000}&lt;br /&gt;
 do&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 declare -A PORT_ON&lt;br /&gt;
 for HOST_PORT in {1..65535}&lt;br /&gt;
 do&lt;br /&gt;
    if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
        PORT_ON[${HOST_PORT}]=&amp;quot;ON&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
 done&lt;br /&gt;
 for i in ${!PORT_ON[*]}&lt;br /&gt;
 do&lt;br /&gt;
    echo -e &amp;quot;$i : ${PORT_ON[$i]}&amp;quot;&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
== watch ==&lt;br /&gt;
&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo&amp;quot;'''&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
== Firefox bash output ==&lt;br /&gt;
&lt;br /&gt;
 For the usage in bash:&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -d -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
 Load a page and press F5 in the tab(again and again or hold the F5 button pressed) and watch&lt;br /&gt;
 When i kill the a tab with the right pid i get the message in the tab, that the tab is crashed now&lt;br /&gt;
 &lt;br /&gt;
 ''' In Firefox, about:performance'''&lt;br /&gt;
&lt;br /&gt;
 But check also this in bash if i close or open and load a page tab:&lt;br /&gt;
 '''$ pidof firefox'''&lt;br /&gt;
 '''$ pidof firefox-esr'''&lt;br /&gt;
 '''$ pgrep firefox get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
 '''$ pgrep firefox-esr get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
&lt;br /&gt;
 Get parentid and childid&lt;br /&gt;
 '''$ ps aux | grep [f]irefox'''&lt;br /&gt;
 '''$ ps aux | grep [f]irefox | grep tab'''&lt;br /&gt;
&lt;br /&gt;
 You see the parentBuildID and something of the child/tab&lt;br /&gt;
 It looks like that you can't close the child/tab only the parentBuildID, if you kill the child/tab the tab will crash but not close(but killed).&lt;br /&gt;
&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | wc -l'''&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | grep tab | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Create Symbolic Links ==&lt;br /&gt;
 [https://man7.org/linux/man-pages/man1/ln.1.html ln|Linux manual page]&lt;br /&gt;
 ''Symlink To a File''&lt;br /&gt;
 '''$ ln -s [OPTIONS] TARGET LINKNAME'''&lt;br /&gt;
 '''$ ln -s TARGET LINK_NAME''' &lt;br /&gt;
&lt;br /&gt;
 ''Symlinks To a Directory''&lt;br /&gt;
 '''$ ln -s /mnt/my_drive/movies ~/my_movies '''&lt;br /&gt;
&lt;br /&gt;
 ''Overwriting Symlinks''&lt;br /&gt;
 ''To overwrite the destination path of the symlink, use the -f (--force) option''&lt;br /&gt;
 '''$ ln -sf my_file.txt my_link.txt'''&lt;br /&gt;
&lt;br /&gt;
 ''Removing Symlinks ''&lt;br /&gt;
 '''$ unlink symlink_to_remove'''&lt;br /&gt;
 '''$ rm symlink_to_remove'''&lt;br /&gt;
&lt;br /&gt;
== List harddisk|usb|volume|partitions  ==&lt;br /&gt;
 ''Get label names:''&lt;br /&gt;
 '''$ e2label /dev/sdXx '''&lt;br /&gt;
 '''$ /sbin/blkid | grep sdXx''''&lt;br /&gt;
 '''$ blkid /dev/sdXx | awk -F'&amp;quot;' '{print $2}''''&lt;br /&gt;
&lt;br /&gt;
 ''Set label name:''&lt;br /&gt;
 '''$ e2label /dev/sdXx MYNAME'''&lt;br /&gt;
 '''$ tune2fs -L MYNAME /dev/sdXx '''&lt;br /&gt;
&lt;br /&gt;
== Create filesystem with '''mkfs.ext4'''  ==&lt;br /&gt;
 '''$ mkfs.ext4 /dev/sda1 -L MYNAME'''&lt;br /&gt;
&lt;br /&gt;
== Create/Add new USER '''useradd'''==&lt;br /&gt;
 Useradd is built-in Linux command that can be found on any Linux system. However, creating new users with this low-level is a tedious task because it doesn't create the home directory and user password by default.&lt;br /&gt;
&lt;br /&gt;
 Adduser is not a standard Linux command. It’s essentially a Perl script that uses the useradd command in the background. This high-level utility  is more efficient in properly creating new users on Linux. It gives you the option to create the home directory, and set password along with a few more parameters.&lt;br /&gt;
&lt;br /&gt;
 [https://linuxhandbook.com/useradd-vs-adduser/ Difference between adduser and useradd commands]&lt;br /&gt;
 [https://linuxconfig.org/add-user-linux-command adduser vs useradd in Linux] &lt;br /&gt;
&lt;br /&gt;
 '''$ useradd [OPTIONS] USERNAME'''&lt;br /&gt;
&lt;br /&gt;
 '''$ cat /etc/default/useradd'''&lt;br /&gt;
 '''$ ls -la /etc/skel/'''&lt;br /&gt;
 '''$ cat /etc/login.defs'''&lt;br /&gt;
&lt;br /&gt;
 View default options:&lt;br /&gt;
 '''$ useradd -D '''&lt;br /&gt;
&lt;br /&gt;
 Change the default login shell&lt;br /&gt;
 '''$ useradd -D -s /bin/bash '''&lt;br /&gt;
 '''$ useradd -D | grep -i shell '''&lt;br /&gt;
&lt;br /&gt;
 To create a user without home directory&lt;br /&gt;
 '''$ useradd -M user '''&lt;br /&gt;
&lt;br /&gt;
 Create a user with changed login shell &lt;br /&gt;
 '''$ useradd -s /bin/sh user '''&lt;br /&gt;
&lt;br /&gt;
 Option to create a user home directory &lt;br /&gt;
 '''--create-home'''&lt;br /&gt;
 '''-m '''&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -m -u 10000 USERNAME -s /bin/bash '''&lt;br /&gt;
&lt;br /&gt;
 There is an option for adding an encrypted password via the '''-p''' option on useradd&lt;br /&gt;
 Note that the '''-p''' option '''doesn't allow you to input a plaintext password''', it expects you to  encrypt it first. &lt;br /&gt;
 This is intentionally difficult, because you should not do it! &lt;br /&gt;
 Just use the '''passwd''' command or '''chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 '''passwd USER'''&lt;br /&gt;
 or&lt;br /&gt;
 '''echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 [https://stackoverflow.com/questions/2150882/how-to-automatically-add-user-account-and-password-with-a-bash-script How to automatically add user account AND password with a Bash script?]&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER'''&lt;br /&gt;
 Create USER + Homedirectory + Bash as Shell&lt;br /&gt;
&lt;br /&gt;
 USER+HOME+SHELL+PASSWORD&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER &amp;amp;&amp;amp; echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
== Delete USER '''userdel'''==&lt;br /&gt;
 '''$ userdel [OPTIONS] USERNAME '''&lt;br /&gt;
&lt;br /&gt;
 Use the -r (--remove) option to force userdel to remove the user’s home directory and mail spool:&lt;br /&gt;
 '''$ userdel -r username '''&lt;br /&gt;
&lt;br /&gt;
 Kill all user’s running processes&lt;br /&gt;
 '''$ killall -u username '''&lt;br /&gt;
&lt;br /&gt;
 Another option is to use the -f (--force) option that tells userdel to forcefully remove the user account, even if the user is still logged in or if there are running processes that belong to the user.&lt;br /&gt;
 '''$ userdel -f username '''&lt;br /&gt;
&lt;br /&gt;
[https://linuxize.com/post/how-to-delete-users-in-linux-using-the-userdel-command/ How to Delete/Remove Users in Linux (userdel Command)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''usermod'''==&lt;br /&gt;
&lt;br /&gt;
https://linuxize.com/post/usermod-command-in-linux/#:~:text=By%20default%2C%20on%20most%20Linux%20systems%2C%20the%20default,name%20of%20the%20user%3A%20usermod%20-s%20SHELL%20USER&lt;br /&gt;
&lt;br /&gt;
https://linuxconfig.org/usermod#:~:text=usermod%20command%20in%20Linux%20Advanced%20Examples%201%20Use,given%20a%20unique%20ID%20when%20first%20created.%20&lt;br /&gt;
&lt;br /&gt;
https://wiki.ubuntuusers.de/usermod/&lt;br /&gt;
&lt;br /&gt;
== '''GROUP, USER | GROUP VS PASSWD''' ==&lt;br /&gt;
&lt;br /&gt;
 https://teaching.idallen.com/cst8207/12f/notes/600_users_and_groups.html&lt;br /&gt;
&lt;br /&gt;
 https://www.unix.com/unix-for-dummies-questions-and-answers/162563-inconsistency-between-passwd-group.html&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/55107/why-dont-etc-group-and-etc-password-match&lt;br /&gt;
&lt;br /&gt;
 https://www.man7.org/linux/man-pages/man3/initgroups.3.html&lt;br /&gt;
&lt;br /&gt;
== chown ==&lt;br /&gt;
&lt;br /&gt;
 https://wiki.ubuntuusers.de/chown/&lt;br /&gt;
&lt;br /&gt;
== chmod ==&lt;br /&gt;
&lt;br /&gt;
 https://wiki.ubuntuusers.de/chmod/&lt;br /&gt;
&lt;br /&gt;
== chattr ==&lt;br /&gt;
 &lt;br /&gt;
 https://wiki.ubuntuusers.de/chattr/&lt;br /&gt;
&lt;br /&gt;
 https://man7.org/linux/man-pages/man1/chattr.1.html&lt;br /&gt;
&lt;br /&gt;
== SHELL USER INFOS ==&lt;br /&gt;
&lt;br /&gt;
 '''getent passwd &amp;quot;$LOGNAME&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
 '''grep passwd /etc/nsswitch.conf'''&lt;br /&gt;
&lt;br /&gt;
== rbash | Restricted Bash ==&lt;br /&gt;
 '''$ rbash '''&lt;br /&gt;
 '''$ bash -r'''&lt;br /&gt;
&lt;br /&gt;
 https://www.tecmint.com/rbash-a-restricted-bash-shell-explained-with-practical-examples/&lt;br /&gt;
 https://www.thegeekdiary.com/rbash-set-restricted-shell-in-linux/&lt;br /&gt;
&lt;br /&gt;
 https://www.howtogeek.com/718074/how-to-use-restricted-shell-to-limit-what-a-linux-user-cando/&lt;br /&gt;
 https://ostechnix.com/how-to-limit-users-access-to-the-linux-system/&lt;br /&gt;
 https://averagelinuxuser.com/creating-new-user-linux/&lt;br /&gt;
 https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/&lt;br /&gt;
 https://www.howtoforge.com/user_password_creating_with_a_bash_script&lt;br /&gt;
&lt;br /&gt;
== Simple Script Jail ==&lt;br /&gt;
&lt;br /&gt;
 This is are the default settings for the USER to login and run a bash shell:&lt;br /&gt;
 '''$  chsh -s /bin/bash [USER] ''' &lt;br /&gt;
 &lt;br /&gt;
 This for the simple jail:&lt;br /&gt;
 '''$ chsh -s /home/[USER]/./run [USER] '''&lt;br /&gt;
&lt;br /&gt;
== Disable history ==&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-bash-shell-commands-history-on-linux&lt;br /&gt;
 https://www.cyberciti.biz/faq/disable-bash-shell-history-linux/&lt;br /&gt;
 https://www.thegeeksearch.com/how-to-disable-and-clear-linux-command-line-history/&lt;br /&gt;
&lt;br /&gt;
== Disable LASTLOGIN ==&lt;br /&gt;
 '''$ touch /home/user/.hushlogin'''&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-last-login-message-on-rhel-linux&lt;br /&gt;
 https://www.heatware.net/linux-unix/linux-how-to-disable-last-login-welcome-message/&lt;br /&gt;
&lt;br /&gt;
== type | command check ==&lt;br /&gt;
&lt;br /&gt;
 Check whether a command is built-in or not&lt;br /&gt;
 '''$ type [COMMAND]'''&lt;br /&gt;
&lt;br /&gt;
== RANDOM NUMBERS ==&lt;br /&gt;
 '''$ echo $RANDOM'''&lt;br /&gt;
 '''$ echo $(( $RANDOM % 9 + 0 ))'''&lt;br /&gt;
&lt;br /&gt;
 '''$ echo $(shuf -i 0-9 -n1)'''&lt;br /&gt;
&lt;br /&gt;
 '''$ od /dev/urandom  -A n -t d -N 1 '''&lt;br /&gt;
&lt;br /&gt;
 https://linuxhint.com/generate-random-number-bash/&lt;br /&gt;
 https://linuxconfig.org/generating-random-numbers-in-bash-with-examples&lt;br /&gt;
 https://www.delftstack.com/howto/linux/random-number-generation-in-bash/&lt;br /&gt;
&lt;br /&gt;
== RANDOM STRINGS ==&lt;br /&gt;
 '''$ echo $RANDOM | md5sum | head -c 1; echo; ''' &lt;br /&gt;
 '''$ tr -dc A-Za-z0-9 &amp;lt;/dev/urandom | head -c 1 ; echo ' ' '''&lt;br /&gt;
&lt;br /&gt;
 https://gist.github.com/earthgecko/3089509&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/230673/how-to-generate-a-random-string&lt;br /&gt;
 https://linuxhint.com/generate-random-string-bash/&lt;br /&gt;
 https://www.saotn.org/bash-function-to-generate-a-random-alphanumeric-string/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/a/709895/515538&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/747546/dhcpd-or-dhclient-not-found#comment1421782_747546&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/747014/command-to-check-if-the-machine-was-rebooted#comment1420778_747014&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/745582/block-every-website-but-one-specific-one#comment1418071_745582&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/745375/what-does-run-rm-rf-do-in-dockerfile#comment1417469_745375&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/741540/setting-alias-for-sourcing-a-script-to-run-that-script-in-jenkins-with-restrict/741545#comment1408882_741545&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/741028/how-do-i-create-a-copy-of-a-hard-drive-on-my-pc#comment1407651_741028&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/740700/how-to-restrict-ssh-for-specific-user-from-specific-subnet#comment1406816_740700&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/740606/migration-of-a-working-debian-11-system-to-another/740612#comment1406640_740612&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/740105/cannot-figure-out-how-to-turn-off-stricthostkeychecking/740107#comment1405529_740107&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/734385/remove-directory-failed-even-as-root#comment1393984_734385&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/715772/how-to-create-a-hash-sha256sum-in-bash-with-more-than-one-source-input-and-w#comment1356335_715772&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/13802/execute-a-specific-command-in-a-given-directory-without-cding-to-it/709871#comment1344018_709871&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/693566/how-can-i-determine-which-browser-tab-is-the-most-network-intensive/693588#comment1311841_693588&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/693006/what-are-these-unexpected-network-devices-which-appear-in-kernel-log/693011#comment1310798_693011&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Bash&amp;diff=1121</id>
		<title>Bash</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Bash&amp;diff=1121"/>
		<updated>2023-06-08T09:47:03Z</updated>

		<summary type="html">&lt;p&gt;Geist: /* RANDOM STRINGS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Script ==&lt;br /&gt;
 '''$ type script'''&lt;br /&gt;
 '''$ chmod +x script'''&lt;br /&gt;
 '''$ ./script'''&lt;br /&gt;
 '''$ .script'''&lt;br /&gt;
 '''$ source script'''&lt;br /&gt;
 '''$ bash script'''&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
&lt;br /&gt;
== Command Line ==&lt;br /&gt;
 '''Everything is a file'''&lt;br /&gt;
 '''255 Byte'''&lt;br /&gt;
 The maximum length for a file name is 255 bytes.&lt;br /&gt;
 The maximum combined length of both the file name and path name is 4096 bytes.&lt;br /&gt;
 This length matches the PATH_MAX that is supported by the operating system.&lt;br /&gt;
 '''Names are case-sensitive'''&lt;br /&gt;
&lt;br /&gt;
==== Special chars to avoid in names/filenames ====&lt;br /&gt;
 /   Never&lt;br /&gt;
 \   Escaped&lt;br /&gt;
 -   Never at beginning&lt;br /&gt;
 []  Escaped&lt;br /&gt;
 {}  Escaped&lt;br /&gt;
 *   Escaped&lt;br /&gt;
 '   Escaped&lt;br /&gt;
 &amp;quot;   Escaped&lt;br /&gt;
&lt;br /&gt;
==== Wildcards ====&lt;br /&gt;
 '''*'''  asterisk        | any char&lt;br /&gt;
 '''?'''  question mark   | single char&lt;br /&gt;
 '''[]''' square brackets | set of single char or a range of chars&lt;br /&gt;
&lt;br /&gt;
==== List files and folders ====&lt;br /&gt;
 '''$ ls'''&lt;br /&gt;
 '''$ ls folder'''&lt;br /&gt;
 '''$ ls ./folder'''&lt;br /&gt;
 '''$ ls /path/folder'''&lt;br /&gt;
 '''$ ls ~/folder'''&lt;br /&gt;
 '''$ ls ~/folder/*.jpg'''&lt;br /&gt;
 '''$ ls ~/folder/*txt*'''&lt;br /&gt;
 '''$ ls -R folder''' (list of subfolders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -l''' (single column)&lt;br /&gt;
  '''-''' regular file&lt;br /&gt;
  '''_''' executable&lt;br /&gt;
  '''d''' directory&lt;br /&gt;
  '''l''' symbolic link&lt;br /&gt;
  '''s''' socket&lt;br /&gt;
  '''b''' block device&lt;br /&gt;
  '''c''' character device&lt;br /&gt;
  '''p''' named pipe&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -m''' (comma-separated list)&lt;br /&gt;
 '''$ ls -a''' (hidden files and folders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -F''' (file type)&lt;br /&gt;
 Symbols and file types&lt;br /&gt;
  '''*''' Executable&lt;br /&gt;
  '''/''' Directory&lt;br /&gt;
  '''@''' Symbolic link&lt;br /&gt;
  '''|''' FIFO&lt;br /&gt;
  '''=''' Socket&lt;br /&gt;
&lt;br /&gt;
 '''$ ls --color (content in color)'''&lt;br /&gt;
 '''$ dircolors'''&lt;br /&gt;
 '''$ dircolors --print-database'''&lt;br /&gt;
 '''$ ls -F --color'''&lt;br /&gt;
 '''$ la -la'''&lt;br /&gt;
 '''$ ls -r'''&lt;br /&gt;
 '''$ ls -X''' (sort by extension)&lt;br /&gt;
 '''$ ls -t''' (sort by date)&lt;br /&gt;
 '''$ ls -S''' (sort by content)&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
 '''$ ls -laS'''&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
&lt;br /&gt;
 '''$ pwd''' (current path)&lt;br /&gt;
&lt;br /&gt;
==== Change directory with '''cd'''====&lt;br /&gt;
 '''$ cd folder'''&lt;br /&gt;
 '''$ cd ~'''&lt;br /&gt;
 '''$ cd -'''&lt;br /&gt;
 '''$ cd ..'''&lt;br /&gt;
&lt;br /&gt;
==== Create and change current time of file '''touch'''====&lt;br /&gt;
 create new, empty file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 update access and modification time for file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 any desired time for file&lt;br /&gt;
 '''$ touch -t [[CC]YY]MMDDhhmm[.ss]file'''&lt;br /&gt;
&lt;br /&gt;
==== Create directory with '''mkdir'''====&lt;br /&gt;
 new directory&lt;br /&gt;
 '''$ mkdir folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory with subdirectories&lt;br /&gt;
 '''$ mkdir -p test/sub/folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory and show steps&lt;br /&gt;
 '''$ mkdir -v test/sub/folder'''&lt;br /&gt;
 '''$ mkdir -pv test/sub/folder'''&lt;br /&gt;
 &lt;br /&gt;
== Count files and directories, summary size and '''EXCLUDE''' folders ==&lt;br /&gt;
'''[https://unix.stackexchange.com/q/691703/515538 '''bash count files and directory, summary size and EXCLUDE folders that are fuse|sshfs''']'''&lt;br /&gt;
&lt;br /&gt;
==== Full size of a folder with '''du'''====&lt;br /&gt;
 get the full size of workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs workdir'''&lt;br /&gt;
&lt;br /&gt;
 get the full size of workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs --exclude=mysshf workdir'''&lt;br /&gt;
&lt;br /&gt;
==== Count files in folder with '''find'''====&lt;br /&gt;
 count files in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune -o \( -type f -print \) | wc -l'''&lt;br /&gt;
&lt;br /&gt;
==== Count folders in folder with '''find'''====&lt;br /&gt;
 count folders in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune \( -type d -print \)  | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Building blocks ==&lt;br /&gt;
&lt;br /&gt;
==== run several commands sequentially with ''';''' and '''&amp;amp;&amp;amp;''' ====&lt;br /&gt;
 executed sequential no matter if successfully or unsucessfully&lt;br /&gt;
 ''';'''&lt;br /&gt;
 '''$ ls /home ; ls notfound; ls ~'''&lt;br /&gt;
&lt;br /&gt;
 executed sequential if successfully run next&lt;br /&gt;
 '''&amp;amp;&amp;amp;'''&lt;br /&gt;
 '''$ ls /home &amp;amp;&amp;amp; ls notfound &amp;amp;&amp;amp; ls ~'''&lt;br /&gt;
&lt;br /&gt;
== PORT SCAN with bash's built-in /dev/tcp ==&lt;br /&gt;
'''check if host response on a give port with bash's built-in /dev/tcp'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 HOST_PORT=&amp;quot;80&amp;quot;&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 exit; '''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 for HOST_PORT in {1..1000}&lt;br /&gt;
 do&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 declare -A PORT_ON&lt;br /&gt;
 for HOST_PORT in {1..65535}&lt;br /&gt;
 do&lt;br /&gt;
    if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
        PORT_ON[${HOST_PORT}]=&amp;quot;ON&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
 done&lt;br /&gt;
 for i in ${!PORT_ON[*]}&lt;br /&gt;
 do&lt;br /&gt;
    echo -e &amp;quot;$i : ${PORT_ON[$i]}&amp;quot;&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
== watch ==&lt;br /&gt;
&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo&amp;quot;'''&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
== Firefox bash output ==&lt;br /&gt;
&lt;br /&gt;
 For the usage in bash:&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -d -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
 Load a page and press F5 in the tab(again and again or hold the F5 button pressed) and watch&lt;br /&gt;
 When i kill the a tab with the right pid i get the message in the tab, that the tab is crashed now&lt;br /&gt;
 &lt;br /&gt;
 ''' In Firefox, about:performance'''&lt;br /&gt;
&lt;br /&gt;
 But check also this in bash if i close or open and load a page tab:&lt;br /&gt;
 '''$ pidof firefox'''&lt;br /&gt;
 '''$ pidof firefox-esr'''&lt;br /&gt;
 '''$ pgrep firefox get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
 '''$ pgrep firefox-esr get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
&lt;br /&gt;
 Get parentid and childid&lt;br /&gt;
 '''$ ps aux | grep [f]irefox'''&lt;br /&gt;
 '''$ ps aux | grep [f]irefox | grep tab'''&lt;br /&gt;
&lt;br /&gt;
 You see the parentBuildID and something of the child/tab&lt;br /&gt;
 It looks like that you can't close the child/tab only the parentBuildID, if you kill the child/tab the tab will crash but not close(but killed).&lt;br /&gt;
&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | wc -l'''&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | grep tab | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Create Symbolic Links ==&lt;br /&gt;
 [https://man7.org/linux/man-pages/man1/ln.1.html ln|Linux manual page]&lt;br /&gt;
 ''Symlink To a File''&lt;br /&gt;
 '''$ ln -s [OPTIONS] TARGET LINKNAME'''&lt;br /&gt;
 '''$ ln -s TARGET LINK_NAME''' &lt;br /&gt;
&lt;br /&gt;
 ''Symlinks To a Directory''&lt;br /&gt;
 '''$ ln -s /mnt/my_drive/movies ~/my_movies '''&lt;br /&gt;
&lt;br /&gt;
 ''Overwriting Symlinks''&lt;br /&gt;
 ''To overwrite the destination path of the symlink, use the -f (--force) option''&lt;br /&gt;
 '''$ ln -sf my_file.txt my_link.txt'''&lt;br /&gt;
&lt;br /&gt;
 ''Removing Symlinks ''&lt;br /&gt;
 '''$ unlink symlink_to_remove'''&lt;br /&gt;
 '''$ rm symlink_to_remove'''&lt;br /&gt;
&lt;br /&gt;
== List harddisk|usb|volume|partitions  ==&lt;br /&gt;
 ''Get label names:''&lt;br /&gt;
 '''$ e2label /dev/sdXx '''&lt;br /&gt;
 '''$ /sbin/blkid | grep sdXx''''&lt;br /&gt;
 '''$ blkid /dev/sdXx | awk -F'&amp;quot;' '{print $2}''''&lt;br /&gt;
&lt;br /&gt;
 ''Set label name:''&lt;br /&gt;
 '''$ e2label /dev/sdXx MYNAME'''&lt;br /&gt;
 '''$ tune2fs -L MYNAME /dev/sdXx '''&lt;br /&gt;
&lt;br /&gt;
== Create filesystem with '''mkfs.ext4'''  ==&lt;br /&gt;
 '''$ mkfs.ext4 /dev/sda1 -L MYNAME'''&lt;br /&gt;
&lt;br /&gt;
== Create/Add new USER '''useradd'''==&lt;br /&gt;
 Useradd is built-in Linux command that can be found on any Linux system. However, creating new users with this low-level is a tedious task because it doesn't create the home directory and user password by default.&lt;br /&gt;
&lt;br /&gt;
 Adduser is not a standard Linux command. It’s essentially a Perl script that uses the useradd command in the background. This high-level utility  is more efficient in properly creating new users on Linux. It gives you the option to create the home directory, and set password along with a few more parameters.&lt;br /&gt;
&lt;br /&gt;
 [https://linuxhandbook.com/useradd-vs-adduser/ Difference between adduser and useradd commands]&lt;br /&gt;
 [https://linuxconfig.org/add-user-linux-command adduser vs useradd in Linux] &lt;br /&gt;
&lt;br /&gt;
 '''$ useradd [OPTIONS] USERNAME'''&lt;br /&gt;
&lt;br /&gt;
 '''$ cat /etc/default/useradd'''&lt;br /&gt;
 '''$ ls -la /etc/skel/'''&lt;br /&gt;
 '''$ cat /etc/login.defs'''&lt;br /&gt;
&lt;br /&gt;
 View default options:&lt;br /&gt;
 '''$ useradd -D '''&lt;br /&gt;
&lt;br /&gt;
 Change the default login shell&lt;br /&gt;
 '''$ useradd -D -s /bin/bash '''&lt;br /&gt;
 '''$ useradd -D | grep -i shell '''&lt;br /&gt;
&lt;br /&gt;
 To create a user without home directory&lt;br /&gt;
 '''$ useradd -M user '''&lt;br /&gt;
&lt;br /&gt;
 Create a user with changed login shell &lt;br /&gt;
 '''$ useradd -s /bin/sh user '''&lt;br /&gt;
&lt;br /&gt;
 Option to create a user home directory &lt;br /&gt;
 '''--create-home'''&lt;br /&gt;
 '''-m '''&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -m -u 10000 USERNAME -s /bin/bash '''&lt;br /&gt;
&lt;br /&gt;
 There is an option for adding an encrypted password via the '''-p''' option on useradd&lt;br /&gt;
 Note that the '''-p''' option '''doesn't allow you to input a plaintext password''', it expects you to  encrypt it first. &lt;br /&gt;
 This is intentionally difficult, because you should not do it! &lt;br /&gt;
 Just use the '''passwd''' command or '''chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 '''passwd USER'''&lt;br /&gt;
 or&lt;br /&gt;
 '''echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 [https://stackoverflow.com/questions/2150882/how-to-automatically-add-user-account-and-password-with-a-bash-script How to automatically add user account AND password with a Bash script?]&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER'''&lt;br /&gt;
 Create USER + Homedirectory + Bash as Shell&lt;br /&gt;
&lt;br /&gt;
 USER+HOME+SHELL+PASSWORD&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER &amp;amp;&amp;amp; echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
== Delete USER '''userdel'''==&lt;br /&gt;
 '''$ userdel [OPTIONS] USERNAME '''&lt;br /&gt;
&lt;br /&gt;
 Use the -r (--remove) option to force userdel to remove the user’s home directory and mail spool:&lt;br /&gt;
 '''$ userdel -r username '''&lt;br /&gt;
&lt;br /&gt;
 Kill all user’s running processes&lt;br /&gt;
 '''$ killall -u username '''&lt;br /&gt;
&lt;br /&gt;
 Another option is to use the -f (--force) option that tells userdel to forcefully remove the user account, even if the user is still logged in or if there are running processes that belong to the user.&lt;br /&gt;
 '''$ userdel -f username '''&lt;br /&gt;
&lt;br /&gt;
[https://linuxize.com/post/how-to-delete-users-in-linux-using-the-userdel-command/ How to Delete/Remove Users in Linux (userdel Command)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''usermod'''==&lt;br /&gt;
&lt;br /&gt;
https://linuxize.com/post/usermod-command-in-linux/#:~:text=By%20default%2C%20on%20most%20Linux%20systems%2C%20the%20default,name%20of%20the%20user%3A%20usermod%20-s%20SHELL%20USER&lt;br /&gt;
&lt;br /&gt;
https://linuxconfig.org/usermod#:~:text=usermod%20command%20in%20Linux%20Advanced%20Examples%201%20Use,given%20a%20unique%20ID%20when%20first%20created.%20&lt;br /&gt;
&lt;br /&gt;
https://wiki.ubuntuusers.de/usermod/&lt;br /&gt;
&lt;br /&gt;
== '''GROUP, USER | GROUP VS PASSWD''' ==&lt;br /&gt;
&lt;br /&gt;
 https://teaching.idallen.com/cst8207/12f/notes/600_users_and_groups.html&lt;br /&gt;
&lt;br /&gt;
 https://www.unix.com/unix-for-dummies-questions-and-answers/162563-inconsistency-between-passwd-group.html&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/55107/why-dont-etc-group-and-etc-password-match&lt;br /&gt;
&lt;br /&gt;
 https://www.man7.org/linux/man-pages/man3/initgroups.3.html&lt;br /&gt;
&lt;br /&gt;
== chown ==&lt;br /&gt;
&lt;br /&gt;
 https://wiki.ubuntuusers.de/chown/&lt;br /&gt;
&lt;br /&gt;
== chmod ==&lt;br /&gt;
&lt;br /&gt;
 https://wiki.ubuntuusers.de/chmod/&lt;br /&gt;
&lt;br /&gt;
== chattr ==&lt;br /&gt;
 &lt;br /&gt;
 https://wiki.ubuntuusers.de/chattr/&lt;br /&gt;
&lt;br /&gt;
 https://man7.org/linux/man-pages/man1/chattr.1.html&lt;br /&gt;
&lt;br /&gt;
== SHELL USER INFOS ==&lt;br /&gt;
&lt;br /&gt;
 '''getent passwd &amp;quot;$LOGNAME&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
 '''grep passwd /etc/nsswitch.conf'''&lt;br /&gt;
&lt;br /&gt;
== rbash | Restricted Bash ==&lt;br /&gt;
 '''$ rbash '''&lt;br /&gt;
 '''$ bash -r'''&lt;br /&gt;
&lt;br /&gt;
 https://www.tecmint.com/rbash-a-restricted-bash-shell-explained-with-practical-examples/&lt;br /&gt;
 https://www.thegeekdiary.com/rbash-set-restricted-shell-in-linux/&lt;br /&gt;
&lt;br /&gt;
 https://www.howtogeek.com/718074/how-to-use-restricted-shell-to-limit-what-a-linux-user-cando/&lt;br /&gt;
 https://ostechnix.com/how-to-limit-users-access-to-the-linux-system/&lt;br /&gt;
 https://averagelinuxuser.com/creating-new-user-linux/&lt;br /&gt;
 https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/&lt;br /&gt;
 https://www.howtoforge.com/user_password_creating_with_a_bash_script&lt;br /&gt;
&lt;br /&gt;
== Simple Script Jail ==&lt;br /&gt;
&lt;br /&gt;
 This is are the default settings for the USER to login and run a bash shell:&lt;br /&gt;
 '''$  chsh -s /bin/bash [USER] ''' &lt;br /&gt;
 &lt;br /&gt;
 This for the simple jail:&lt;br /&gt;
 '''$ chsh -s /home/[USER]/./run [USER] '''&lt;br /&gt;
&lt;br /&gt;
== Disable history ==&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-bash-shell-commands-history-on-linux&lt;br /&gt;
 https://www.cyberciti.biz/faq/disable-bash-shell-history-linux/&lt;br /&gt;
 https://www.thegeeksearch.com/how-to-disable-and-clear-linux-command-line-history/&lt;br /&gt;
&lt;br /&gt;
== Disable LASTLOGIN ==&lt;br /&gt;
 '''$ touch /home/user/.hushlogin'''&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-last-login-message-on-rhel-linux&lt;br /&gt;
 https://www.heatware.net/linux-unix/linux-how-to-disable-last-login-welcome-message/&lt;br /&gt;
&lt;br /&gt;
== type | command check ==&lt;br /&gt;
&lt;br /&gt;
 Check whether a command is built-in or not&lt;br /&gt;
 '''$ type [COMMAND]'''&lt;br /&gt;
&lt;br /&gt;
== RANDOM NUMBERS ==&lt;br /&gt;
 '''$ echo $RANDOM'''&lt;br /&gt;
 '''$ echo $(( $RANDOM % 9 + 0 ))'''&lt;br /&gt;
&lt;br /&gt;
 '''$ echo $(shuf -i 0-9 -n1)'''&lt;br /&gt;
&lt;br /&gt;
 '''$ od /dev/urandom  -A n -t d -N 1 '''&lt;br /&gt;
&lt;br /&gt;
 https://linuxhint.com/generate-random-number-bash/&lt;br /&gt;
 https://linuxconfig.org/generating-random-numbers-in-bash-with-examples&lt;br /&gt;
 https://www.delftstack.com/howto/linux/random-number-generation-in-bash/&lt;br /&gt;
&lt;br /&gt;
== RANDOM STRINGS ==&lt;br /&gt;
 '''$ echo $RANDOM | md5sum | head -c 1; echo; ''' &lt;br /&gt;
 '''$ tr -dc A-Za-z0-9 &amp;lt;/dev/urandom | head -c 1 ; echo ' ' '''&lt;br /&gt;
&lt;br /&gt;
 https://gist.github.com/earthgecko/3089509&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/230673/how-to-generate-a-random-string&lt;br /&gt;
 https://linuxhint.com/generate-random-string-bash/&lt;br /&gt;
 https://www.saotn.org/bash-function-to-generate-a-random-alphanumeric-string/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/a/709895/515538&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/747546/dhcpd-or-dhclient-not-found#comment1421782_747546&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/747014/command-to-check-if-the-machine-was-rebooted#comment1420778_747014&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/745582/block-every-website-but-one-specific-one#comment1418071_745582&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/745375/what-does-run-rm-rf-do-in-dockerfile#comment1417469_745375&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/741540/setting-alias-for-sourcing-a-script-to-run-that-script-in-jenkins-with-restrict/741545#comment1408882_741545&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/741028/how-do-i-create-a-copy-of-a-hard-drive-on-my-pc#comment1407651_741028&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/740700/how-to-restrict-ssh-for-specific-user-from-specific-subnet#comment1406816_740700&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/740606/migration-of-a-working-debian-11-system-to-another/740612#comment1406640_740612&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Bash&amp;diff=1120</id>
		<title>Bash</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Bash&amp;diff=1120"/>
		<updated>2023-06-08T09:42:27Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Script ==&lt;br /&gt;
 '''$ type script'''&lt;br /&gt;
 '''$ chmod +x script'''&lt;br /&gt;
 '''$ ./script'''&lt;br /&gt;
 '''$ .script'''&lt;br /&gt;
 '''$ source script'''&lt;br /&gt;
 '''$ bash script'''&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
&lt;br /&gt;
== Command Line ==&lt;br /&gt;
 '''Everything is a file'''&lt;br /&gt;
 '''255 Byte'''&lt;br /&gt;
 The maximum length for a file name is 255 bytes.&lt;br /&gt;
 The maximum combined length of both the file name and path name is 4096 bytes.&lt;br /&gt;
 This length matches the PATH_MAX that is supported by the operating system.&lt;br /&gt;
 '''Names are case-sensitive'''&lt;br /&gt;
&lt;br /&gt;
==== Special chars to avoid in names/filenames ====&lt;br /&gt;
 /   Never&lt;br /&gt;
 \   Escaped&lt;br /&gt;
 -   Never at beginning&lt;br /&gt;
 []  Escaped&lt;br /&gt;
 {}  Escaped&lt;br /&gt;
 *   Escaped&lt;br /&gt;
 '   Escaped&lt;br /&gt;
 &amp;quot;   Escaped&lt;br /&gt;
&lt;br /&gt;
==== Wildcards ====&lt;br /&gt;
 '''*'''  asterisk        | any char&lt;br /&gt;
 '''?'''  question mark   | single char&lt;br /&gt;
 '''[]''' square brackets | set of single char or a range of chars&lt;br /&gt;
&lt;br /&gt;
==== List files and folders ====&lt;br /&gt;
 '''$ ls'''&lt;br /&gt;
 '''$ ls folder'''&lt;br /&gt;
 '''$ ls ./folder'''&lt;br /&gt;
 '''$ ls /path/folder'''&lt;br /&gt;
 '''$ ls ~/folder'''&lt;br /&gt;
 '''$ ls ~/folder/*.jpg'''&lt;br /&gt;
 '''$ ls ~/folder/*txt*'''&lt;br /&gt;
 '''$ ls -R folder''' (list of subfolders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -l''' (single column)&lt;br /&gt;
  '''-''' regular file&lt;br /&gt;
  '''_''' executable&lt;br /&gt;
  '''d''' directory&lt;br /&gt;
  '''l''' symbolic link&lt;br /&gt;
  '''s''' socket&lt;br /&gt;
  '''b''' block device&lt;br /&gt;
  '''c''' character device&lt;br /&gt;
  '''p''' named pipe&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -m''' (comma-separated list)&lt;br /&gt;
 '''$ ls -a''' (hidden files and folders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -F''' (file type)&lt;br /&gt;
 Symbols and file types&lt;br /&gt;
  '''*''' Executable&lt;br /&gt;
  '''/''' Directory&lt;br /&gt;
  '''@''' Symbolic link&lt;br /&gt;
  '''|''' FIFO&lt;br /&gt;
  '''=''' Socket&lt;br /&gt;
&lt;br /&gt;
 '''$ ls --color (content in color)'''&lt;br /&gt;
 '''$ dircolors'''&lt;br /&gt;
 '''$ dircolors --print-database'''&lt;br /&gt;
 '''$ ls -F --color'''&lt;br /&gt;
 '''$ la -la'''&lt;br /&gt;
 '''$ ls -r'''&lt;br /&gt;
 '''$ ls -X''' (sort by extension)&lt;br /&gt;
 '''$ ls -t''' (sort by date)&lt;br /&gt;
 '''$ ls -S''' (sort by content)&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
 '''$ ls -laS'''&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
&lt;br /&gt;
 '''$ pwd''' (current path)&lt;br /&gt;
&lt;br /&gt;
==== Change directory with '''cd'''====&lt;br /&gt;
 '''$ cd folder'''&lt;br /&gt;
 '''$ cd ~'''&lt;br /&gt;
 '''$ cd -'''&lt;br /&gt;
 '''$ cd ..'''&lt;br /&gt;
&lt;br /&gt;
==== Create and change current time of file '''touch'''====&lt;br /&gt;
 create new, empty file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 update access and modification time for file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 any desired time for file&lt;br /&gt;
 '''$ touch -t [[CC]YY]MMDDhhmm[.ss]file'''&lt;br /&gt;
&lt;br /&gt;
==== Create directory with '''mkdir'''====&lt;br /&gt;
 new directory&lt;br /&gt;
 '''$ mkdir folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory with subdirectories&lt;br /&gt;
 '''$ mkdir -p test/sub/folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory and show steps&lt;br /&gt;
 '''$ mkdir -v test/sub/folder'''&lt;br /&gt;
 '''$ mkdir -pv test/sub/folder'''&lt;br /&gt;
 &lt;br /&gt;
== Count files and directories, summary size and '''EXCLUDE''' folders ==&lt;br /&gt;
'''[https://unix.stackexchange.com/q/691703/515538 '''bash count files and directory, summary size and EXCLUDE folders that are fuse|sshfs''']'''&lt;br /&gt;
&lt;br /&gt;
==== Full size of a folder with '''du'''====&lt;br /&gt;
 get the full size of workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs workdir'''&lt;br /&gt;
&lt;br /&gt;
 get the full size of workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs --exclude=mysshf workdir'''&lt;br /&gt;
&lt;br /&gt;
==== Count files in folder with '''find'''====&lt;br /&gt;
 count files in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune -o \( -type f -print \) | wc -l'''&lt;br /&gt;
&lt;br /&gt;
==== Count folders in folder with '''find'''====&lt;br /&gt;
 count folders in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune \( -type d -print \)  | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Building blocks ==&lt;br /&gt;
&lt;br /&gt;
==== run several commands sequentially with ''';''' and '''&amp;amp;&amp;amp;''' ====&lt;br /&gt;
 executed sequential no matter if successfully or unsucessfully&lt;br /&gt;
 ''';'''&lt;br /&gt;
 '''$ ls /home ; ls notfound; ls ~'''&lt;br /&gt;
&lt;br /&gt;
 executed sequential if successfully run next&lt;br /&gt;
 '''&amp;amp;&amp;amp;'''&lt;br /&gt;
 '''$ ls /home &amp;amp;&amp;amp; ls notfound &amp;amp;&amp;amp; ls ~'''&lt;br /&gt;
&lt;br /&gt;
== PORT SCAN with bash's built-in /dev/tcp ==&lt;br /&gt;
'''check if host response on a give port with bash's built-in /dev/tcp'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 HOST_PORT=&amp;quot;80&amp;quot;&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 exit; '''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 for HOST_PORT in {1..1000}&lt;br /&gt;
 do&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 declare -A PORT_ON&lt;br /&gt;
 for HOST_PORT in {1..65535}&lt;br /&gt;
 do&lt;br /&gt;
    if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
        PORT_ON[${HOST_PORT}]=&amp;quot;ON&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
 done&lt;br /&gt;
 for i in ${!PORT_ON[*]}&lt;br /&gt;
 do&lt;br /&gt;
    echo -e &amp;quot;$i : ${PORT_ON[$i]}&amp;quot;&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
== watch ==&lt;br /&gt;
&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo&amp;quot;'''&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
== Firefox bash output ==&lt;br /&gt;
&lt;br /&gt;
 For the usage in bash:&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -d -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
 Load a page and press F5 in the tab(again and again or hold the F5 button pressed) and watch&lt;br /&gt;
 When i kill the a tab with the right pid i get the message in the tab, that the tab is crashed now&lt;br /&gt;
 &lt;br /&gt;
 ''' In Firefox, about:performance'''&lt;br /&gt;
&lt;br /&gt;
 But check also this in bash if i close or open and load a page tab:&lt;br /&gt;
 '''$ pidof firefox'''&lt;br /&gt;
 '''$ pidof firefox-esr'''&lt;br /&gt;
 '''$ pgrep firefox get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
 '''$ pgrep firefox-esr get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
&lt;br /&gt;
 Get parentid and childid&lt;br /&gt;
 '''$ ps aux | grep [f]irefox'''&lt;br /&gt;
 '''$ ps aux | grep [f]irefox | grep tab'''&lt;br /&gt;
&lt;br /&gt;
 You see the parentBuildID and something of the child/tab&lt;br /&gt;
 It looks like that you can't close the child/tab only the parentBuildID, if you kill the child/tab the tab will crash but not close(but killed).&lt;br /&gt;
&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | wc -l'''&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | grep tab | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Create Symbolic Links ==&lt;br /&gt;
 [https://man7.org/linux/man-pages/man1/ln.1.html ln|Linux manual page]&lt;br /&gt;
 ''Symlink To a File''&lt;br /&gt;
 '''$ ln -s [OPTIONS] TARGET LINKNAME'''&lt;br /&gt;
 '''$ ln -s TARGET LINK_NAME''' &lt;br /&gt;
&lt;br /&gt;
 ''Symlinks To a Directory''&lt;br /&gt;
 '''$ ln -s /mnt/my_drive/movies ~/my_movies '''&lt;br /&gt;
&lt;br /&gt;
 ''Overwriting Symlinks''&lt;br /&gt;
 ''To overwrite the destination path of the symlink, use the -f (--force) option''&lt;br /&gt;
 '''$ ln -sf my_file.txt my_link.txt'''&lt;br /&gt;
&lt;br /&gt;
 ''Removing Symlinks ''&lt;br /&gt;
 '''$ unlink symlink_to_remove'''&lt;br /&gt;
 '''$ rm symlink_to_remove'''&lt;br /&gt;
&lt;br /&gt;
== List harddisk|usb|volume|partitions  ==&lt;br /&gt;
 ''Get label names:''&lt;br /&gt;
 '''$ e2label /dev/sdXx '''&lt;br /&gt;
 '''$ /sbin/blkid | grep sdXx''''&lt;br /&gt;
 '''$ blkid /dev/sdXx | awk -F'&amp;quot;' '{print $2}''''&lt;br /&gt;
&lt;br /&gt;
 ''Set label name:''&lt;br /&gt;
 '''$ e2label /dev/sdXx MYNAME'''&lt;br /&gt;
 '''$ tune2fs -L MYNAME /dev/sdXx '''&lt;br /&gt;
&lt;br /&gt;
== Create filesystem with '''mkfs.ext4'''  ==&lt;br /&gt;
 '''$ mkfs.ext4 /dev/sda1 -L MYNAME'''&lt;br /&gt;
&lt;br /&gt;
== Create/Add new USER '''useradd'''==&lt;br /&gt;
 Useradd is built-in Linux command that can be found on any Linux system. However, creating new users with this low-level is a tedious task because it doesn't create the home directory and user password by default.&lt;br /&gt;
&lt;br /&gt;
 Adduser is not a standard Linux command. It’s essentially a Perl script that uses the useradd command in the background. This high-level utility  is more efficient in properly creating new users on Linux. It gives you the option to create the home directory, and set password along with a few more parameters.&lt;br /&gt;
&lt;br /&gt;
 [https://linuxhandbook.com/useradd-vs-adduser/ Difference between adduser and useradd commands]&lt;br /&gt;
 [https://linuxconfig.org/add-user-linux-command adduser vs useradd in Linux] &lt;br /&gt;
&lt;br /&gt;
 '''$ useradd [OPTIONS] USERNAME'''&lt;br /&gt;
&lt;br /&gt;
 '''$ cat /etc/default/useradd'''&lt;br /&gt;
 '''$ ls -la /etc/skel/'''&lt;br /&gt;
 '''$ cat /etc/login.defs'''&lt;br /&gt;
&lt;br /&gt;
 View default options:&lt;br /&gt;
 '''$ useradd -D '''&lt;br /&gt;
&lt;br /&gt;
 Change the default login shell&lt;br /&gt;
 '''$ useradd -D -s /bin/bash '''&lt;br /&gt;
 '''$ useradd -D | grep -i shell '''&lt;br /&gt;
&lt;br /&gt;
 To create a user without home directory&lt;br /&gt;
 '''$ useradd -M user '''&lt;br /&gt;
&lt;br /&gt;
 Create a user with changed login shell &lt;br /&gt;
 '''$ useradd -s /bin/sh user '''&lt;br /&gt;
&lt;br /&gt;
 Option to create a user home directory &lt;br /&gt;
 '''--create-home'''&lt;br /&gt;
 '''-m '''&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -m -u 10000 USERNAME -s /bin/bash '''&lt;br /&gt;
&lt;br /&gt;
 There is an option for adding an encrypted password via the '''-p''' option on useradd&lt;br /&gt;
 Note that the '''-p''' option '''doesn't allow you to input a plaintext password''', it expects you to  encrypt it first. &lt;br /&gt;
 This is intentionally difficult, because you should not do it! &lt;br /&gt;
 Just use the '''passwd''' command or '''chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 '''passwd USER'''&lt;br /&gt;
 or&lt;br /&gt;
 '''echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 [https://stackoverflow.com/questions/2150882/how-to-automatically-add-user-account-and-password-with-a-bash-script How to automatically add user account AND password with a Bash script?]&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER'''&lt;br /&gt;
 Create USER + Homedirectory + Bash as Shell&lt;br /&gt;
&lt;br /&gt;
 USER+HOME+SHELL+PASSWORD&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER &amp;amp;&amp;amp; echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
== Delete USER '''userdel'''==&lt;br /&gt;
 '''$ userdel [OPTIONS] USERNAME '''&lt;br /&gt;
&lt;br /&gt;
 Use the -r (--remove) option to force userdel to remove the user’s home directory and mail spool:&lt;br /&gt;
 '''$ userdel -r username '''&lt;br /&gt;
&lt;br /&gt;
 Kill all user’s running processes&lt;br /&gt;
 '''$ killall -u username '''&lt;br /&gt;
&lt;br /&gt;
 Another option is to use the -f (--force) option that tells userdel to forcefully remove the user account, even if the user is still logged in or if there are running processes that belong to the user.&lt;br /&gt;
 '''$ userdel -f username '''&lt;br /&gt;
&lt;br /&gt;
[https://linuxize.com/post/how-to-delete-users-in-linux-using-the-userdel-command/ How to Delete/Remove Users in Linux (userdel Command)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''usermod'''==&lt;br /&gt;
&lt;br /&gt;
https://linuxize.com/post/usermod-command-in-linux/#:~:text=By%20default%2C%20on%20most%20Linux%20systems%2C%20the%20default,name%20of%20the%20user%3A%20usermod%20-s%20SHELL%20USER&lt;br /&gt;
&lt;br /&gt;
https://linuxconfig.org/usermod#:~:text=usermod%20command%20in%20Linux%20Advanced%20Examples%201%20Use,given%20a%20unique%20ID%20when%20first%20created.%20&lt;br /&gt;
&lt;br /&gt;
https://wiki.ubuntuusers.de/usermod/&lt;br /&gt;
&lt;br /&gt;
== '''GROUP, USER | GROUP VS PASSWD''' ==&lt;br /&gt;
&lt;br /&gt;
 https://teaching.idallen.com/cst8207/12f/notes/600_users_and_groups.html&lt;br /&gt;
&lt;br /&gt;
 https://www.unix.com/unix-for-dummies-questions-and-answers/162563-inconsistency-between-passwd-group.html&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/55107/why-dont-etc-group-and-etc-password-match&lt;br /&gt;
&lt;br /&gt;
 https://www.man7.org/linux/man-pages/man3/initgroups.3.html&lt;br /&gt;
&lt;br /&gt;
== chown ==&lt;br /&gt;
&lt;br /&gt;
 https://wiki.ubuntuusers.de/chown/&lt;br /&gt;
&lt;br /&gt;
== chmod ==&lt;br /&gt;
&lt;br /&gt;
 https://wiki.ubuntuusers.de/chmod/&lt;br /&gt;
&lt;br /&gt;
== chattr ==&lt;br /&gt;
 &lt;br /&gt;
 https://wiki.ubuntuusers.de/chattr/&lt;br /&gt;
&lt;br /&gt;
 https://man7.org/linux/man-pages/man1/chattr.1.html&lt;br /&gt;
&lt;br /&gt;
== SHELL USER INFOS ==&lt;br /&gt;
&lt;br /&gt;
 '''getent passwd &amp;quot;$LOGNAME&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
 '''grep passwd /etc/nsswitch.conf'''&lt;br /&gt;
&lt;br /&gt;
== rbash | Restricted Bash ==&lt;br /&gt;
 '''$ rbash '''&lt;br /&gt;
 '''$ bash -r'''&lt;br /&gt;
&lt;br /&gt;
 https://www.tecmint.com/rbash-a-restricted-bash-shell-explained-with-practical-examples/&lt;br /&gt;
 https://www.thegeekdiary.com/rbash-set-restricted-shell-in-linux/&lt;br /&gt;
&lt;br /&gt;
 https://www.howtogeek.com/718074/how-to-use-restricted-shell-to-limit-what-a-linux-user-cando/&lt;br /&gt;
 https://ostechnix.com/how-to-limit-users-access-to-the-linux-system/&lt;br /&gt;
 https://averagelinuxuser.com/creating-new-user-linux/&lt;br /&gt;
 https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/&lt;br /&gt;
 https://www.howtoforge.com/user_password_creating_with_a_bash_script&lt;br /&gt;
&lt;br /&gt;
== Simple Script Jail ==&lt;br /&gt;
&lt;br /&gt;
 This is are the default settings for the USER to login and run a bash shell:&lt;br /&gt;
 '''$  chsh -s /bin/bash [USER] ''' &lt;br /&gt;
 &lt;br /&gt;
 This for the simple jail:&lt;br /&gt;
 '''$ chsh -s /home/[USER]/./run [USER] '''&lt;br /&gt;
&lt;br /&gt;
== Disable history ==&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-bash-shell-commands-history-on-linux&lt;br /&gt;
 https://www.cyberciti.biz/faq/disable-bash-shell-history-linux/&lt;br /&gt;
 https://www.thegeeksearch.com/how-to-disable-and-clear-linux-command-line-history/&lt;br /&gt;
&lt;br /&gt;
== Disable LASTLOGIN ==&lt;br /&gt;
 '''$ touch /home/user/.hushlogin'''&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-last-login-message-on-rhel-linux&lt;br /&gt;
 https://www.heatware.net/linux-unix/linux-how-to-disable-last-login-welcome-message/&lt;br /&gt;
&lt;br /&gt;
== type | command check ==&lt;br /&gt;
&lt;br /&gt;
 Check whether a command is built-in or not&lt;br /&gt;
 '''$ type [COMMAND]'''&lt;br /&gt;
&lt;br /&gt;
== RANDOM NUMBERS ==&lt;br /&gt;
 '''$ echo $RANDOM'''&lt;br /&gt;
 '''$ echo $(( $RANDOM % 9 + 0 ))'''&lt;br /&gt;
&lt;br /&gt;
 '''$ echo $(shuf -i 0-9 -n1)'''&lt;br /&gt;
&lt;br /&gt;
 '''$ od /dev/urandom  -A n -t d -N 1 '''&lt;br /&gt;
&lt;br /&gt;
 https://linuxhint.com/generate-random-number-bash/&lt;br /&gt;
 https://linuxconfig.org/generating-random-numbers-in-bash-with-examples&lt;br /&gt;
 https://www.delftstack.com/howto/linux/random-number-generation-in-bash/&lt;br /&gt;
&lt;br /&gt;
== RANDOM STRINGS ==&lt;br /&gt;
 '''$ echo $RANDOM | md5sum | head -c 1; echo; ''' &lt;br /&gt;
 '''$ tr -dc A-Za-z0-9 &amp;lt;/dev/urandom | head -c 1 ; echo ' ' '''&lt;br /&gt;
&lt;br /&gt;
 https://gist.github.com/earthgecko/3089509&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/230673/how-to-generate-a-random-string&lt;br /&gt;
 https://linuxhint.com/generate-random-string-bash/&lt;br /&gt;
 https://www.saotn.org/bash-function-to-generate-a-random-alphanumeric-string/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/a/709895/515538&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/747546/dhcpd-or-dhclient-not-found#comment1421782_747546&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/747014/command-to-check-if-the-machine-was-rebooted#comment1420778_747014&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/745582/block-every-website-but-one-specific-one#comment1418071_745582&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/questions/745375/what-does-run-rm-rf-do-in-dockerfile#comment1417469_745375&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Luks&amp;diff=1119</id>
		<title>Luks</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Luks&amp;diff=1119"/>
		<updated>2023-06-07T10:17:25Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
'''[https://gitlab.com/cryptsetup/cryptsetup/ cryptsetup]'''&lt;br /&gt;
&lt;br /&gt;
'''[https://gitlab.com/cryptsetup/cryptsetup/-/wikis/FrequentlyAskedQuestions cryptsetup FAQ''']&lt;br /&gt;
&lt;br /&gt;
== '''luks, cryptsetup''' ==&lt;br /&gt;
&lt;br /&gt;
===== ''luks install'' =====&lt;br /&gt;
 '''$ apt-get install cryptsetup'''&lt;br /&gt;
&lt;br /&gt;
==== ''luks config'' ====&lt;br /&gt;
 '''$ modprobe dm-cryp'''t&lt;br /&gt;
 '''$ dmsetup ls'''&lt;br /&gt;
&lt;br /&gt;
==== ''luks create'' ====&lt;br /&gt;
 '''$ cryptsetup luksFormat -c aes-xts-plain64 -s 512 -h sha512 -y /dev/sda''' &lt;br /&gt;
&lt;br /&gt;
==== ''luks open'' ====&lt;br /&gt;
 '''$ cryptsetup luksOpen /dev/sda cryptdata'''&lt;br /&gt;
&lt;br /&gt;
==== ''luks filesystem'' ====&lt;br /&gt;
 '''$ mkfs.ext4 /dev/mapper/cryptdata'''&lt;br /&gt;
 &lt;br /&gt;
==== ''luks mount'' ====&lt;br /&gt;
 '''$ mount /dev/mapper/cryptdata /home/cryptdata'''&lt;br /&gt;
 '''$ mount -t ext4 /dev/mapper/cryptdata cryptdata'''&lt;br /&gt;
&lt;br /&gt;
==== ''luks umount'' ====&lt;br /&gt;
 '''$ umount /home/cryptdata'''&lt;br /&gt;
&lt;br /&gt;
==== ''luks close'' ====&lt;br /&gt;
 '''$ cryptsetup luksClose container'''&lt;br /&gt;
&lt;br /&gt;
==== ''luks file-container'' ====&lt;br /&gt;
 '''$ dd if=/dev/zero of=/home/container bs=1M count=1024'''&lt;br /&gt;
&lt;br /&gt;
 '''$ cryptsetup -y luksFormat /home/container'''&lt;br /&gt;
 '''$ cryptsetup luksOpen /home/container container'''&lt;br /&gt;
&lt;br /&gt;
 '''$ mkfs.ext4 -j /dev/mapper/container'''&lt;br /&gt;
&lt;br /&gt;
 '''$ mkdir /home/container_data'''&lt;br /&gt;
 '''$ mount /dev/mapper/container /home/container_data'''&lt;br /&gt;
&lt;br /&gt;
 '''$ umount /home/container_data'''&lt;br /&gt;
&lt;br /&gt;
 '''$ cryptsetup luksClose container'''&lt;br /&gt;
&lt;br /&gt;
==== ''luks Header/Slots:Keys'' ====&lt;br /&gt;
 '''$ cryptsetup luksDump [device-name]'''&lt;br /&gt;
 '''$ cryptsetup status /dev/mapper/[device-name]'''&lt;br /&gt;
&lt;br /&gt;
 '''$ cryptsetup luksAddKey /dev/sda1'''&lt;br /&gt;
 '''$ cryptsetup luksAddKey [geraet] [schluesseldatei]'''&lt;br /&gt;
&lt;br /&gt;
 delete password&lt;br /&gt;
 '''$ cryptsetup luksRemoveKey [device-name]&lt;br /&gt;
&lt;br /&gt;
 delete slot&lt;br /&gt;
 '''$ cryptsetup luksKillSlot /dev/sda1 1		'''&lt;br /&gt;
 '''$ cryptsetup luksDelKey [geraet] [speicherplatz]'''&lt;br /&gt;
&lt;br /&gt;
==== luks luksUUID ====&lt;br /&gt;
 '''$ cryptsetup luksUUID NAME '''&lt;br /&gt;
 '''$ printf &amp;quot;lukslvm\tUUID=%s\tnone\tluks\n&amp;quot; &amp;quot;$(cryptsetup luksUUID NAME)&amp;quot; | tee -a /etc/crypttab'''&lt;br /&gt;
 #CHECK!&lt;br /&gt;
 '''$ cryptsetup luksUUID /dev/sda1 --uuid &amp;quot;$newuuid&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
==== luks luksUUID open ====&lt;br /&gt;
cryptsetup luksOpen /dev/disk/by-uuid/xxxxx NAME&lt;br /&gt;
&lt;br /&gt;
==== luks Create KeyFile ====&lt;br /&gt;
 dd if=/dev/urandom of=/root/keyfile bs=1024 count=4&lt;br /&gt;
 chmod 0400 /root/keyfile&lt;br /&gt;
 cryptsetup luksAddKey /dev/sdx /root/keyfile&lt;br /&gt;
&lt;br /&gt;
 blkid /dev/SDX &amp;gt;&amp;gt; /etc/crypttab&lt;br /&gt;
 nano /etc/crypttab&lt;br /&gt;
      sdx_CryptNameMapper UUID=XXXX /root/keyfile luks&lt;br /&gt;
&lt;br /&gt;
 bsp.: hd0 UUID=d993b1ed-9b42-46e8-a520-d74737db9684 /root/keyfile luks&lt;br /&gt;
&lt;br /&gt;
 nano /etc/fstab&lt;br /&gt;
        /dev/mapper/sdx_CryptNameMapper /media/xxxx ext4 defualts 0 2&lt;br /&gt;
 bsp.:  /dev/mapper/hd0 /media/hd0 ext4 defaults 0 2&lt;br /&gt;
&lt;br /&gt;
 update-initramfs -u&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://unix.stackexchange.com/a/748191/515538 How to prevent Centos from recovery password in remount - Grub?]&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Ssh&amp;diff=1118</id>
		<title>Ssh</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Ssh&amp;diff=1118"/>
		<updated>2023-06-06T16:30:16Z</updated>

		<summary type="html">&lt;p&gt;Geist: /*  SCP file  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==== ''' AUTHOR | HACKBUGZ ''' ====&lt;br /&gt;
 [https://stackexchange.com/users/23684174/hackbugz?tab=accounts StackExchange | HACKBUGZ]&lt;br /&gt;
 [https://www.tiktok.com/@hackbugz? TIKTOK | HACKBUGZ]&lt;br /&gt;
&lt;br /&gt;
==== ''' Links ''' ====&lt;br /&gt;
 [https://linux.die.net/man/1/sshfs sshfs(1) - Linux man page]&lt;br /&gt;
 [https://wiki.ubuntuusers.de/FUSE/sshfs/ wiki.ubuntuusers.de FUSE/SSHFS]&lt;br /&gt;
 [https://wiki.ubuntuusers.de/FUSE/ wiki.ubuntuusers.de FUSE]  &lt;br /&gt;
&lt;br /&gt;
 [https://www.ssh.com/iam/ssh-key-management/ SSH Key Management]&lt;br /&gt;
 [https://www.ssh.com/ssh/authorized_keys/ Authorized_keys file in SSH]&lt;br /&gt;
 [https://unix.stackexchange.com/questions/208960/how-to-restrict-a-user-to-one-folder-and-not-allow-them-to-move-out-his-folder How to restrict a user to one folder and not allow them to move out his folder - Unix &amp;amp; Linux Stack Exchange]&lt;br /&gt;
 [https://www.tecmint.com/restrict-ssh-user-to-directory-using-chrooted-jail/ Restrict SSH User Access to Certain Directory Using Chrooted Jail]&lt;br /&gt;
 [https://www.cyberciti.biz/faq/debian-ubuntu-restricting-ssh-user-session-to-a-directory-chrooted-jail/ Debian/Ubuntu Linux: Restrict an SSH user session to a specific directory by setting chrooted jail - nixCraft]&lt;br /&gt;
 [https://wiki.archlinux.org/index.php/SSHFS SSHFS - ArchWiki]&lt;br /&gt;
&lt;br /&gt;
 [https://askubuntu.com/questions/48129/how-to-create-a-restricted-ssh-user-for-port-forwarding security - How to create a restricted SSH user for port forwarding? - Ask Ubuntu]&lt;br /&gt;
 [https://www.linux-magazin.de/ausgaben/2018/08/einfuehrung-2-5/ Aus dem Alltag eines Sysadmin: Reverse-SSH-Tunnel und Autossh]&lt;br /&gt;
 [https://www.howtogeek.com/428413/what-is-reverse-ssh-tunneling-and-how-to-use-it/ What Is Reverse SSH Tunneling? (and How to Use It)]&lt;br /&gt;
 [https://unix.stackexchange.com/questions/100859/ssh-tunnel-without-shell-on-ssh-server ssh tunneling - SSH: tunnel without shell on ssh server - Unix &amp;amp; Linux Stack Exchange]&lt;br /&gt;
 [https://serverfault.com/questions/56566/ssh-tunneling-only-access linux - ssh tunneling only access - Server Fault]&lt;br /&gt;
 [https://www.it-react.com/index.php/2020/01/06/how-to-setup-reverse-ssh-tunnel-on-linux/ How to Setup Reverse SSH Tunnel on Raspberry Pi behind a 3G USB stick modem - IT-REACT]&lt;br /&gt;
 [https://dev.to/bulletmark/create-a-reverse-ssh-tunnel-for-remote-access-to-a-restricted-machine-1ma0 Create a reverse SSH tunnel for remote access to a restricted Linux machine - DEV Community]&lt;br /&gt;
 [https://unix.stackexchange.com/questions/55106/disable-user-shell-for-security-reasons https://unix.stackexchange.com/questions/55106/disable-user-shell-for-security-reasons]&lt;br /&gt;
 [https://www.everythingcli.org/ssh-tunnelling-for-fun-and-profit-autossh/ SSH tunnelling for fun and profit: Autossh]&lt;br /&gt;
 [https://man7.org/linux/man-pages/man1/ssh-keygen.1.html ssh-keygen(1) - Linux manual page]&lt;br /&gt;
 [https://unix.stackexchange.com/questions/128894/ssh-exchange-identification-connection-closed-by-remote-host-not-using-hosts-d linux - ssh_exchange_identification: Connection closed by remote host (not using hosts.deny) - Unix &amp;amp; Linux Stack Exchange]&lt;br /&gt;
&lt;br /&gt;
 [https://github.com/szmi Miklos Szeredi | github]&lt;br /&gt;
 [https://indico.cern.ch/event/608592/contributions/2830117/attachments/1592339/2520491/Evolution_of_FUSE_and_OverlayFS.pdf  Evolution of FUSE and OverlayFS | Miklos Szeredi]&lt;br /&gt;
&lt;br /&gt;
 [https://explainshell.com/explain?cmd=ssh+-L+-N+-f+-l+-R+-i+-1 explainshell]&lt;br /&gt;
 [https://wiki.ubuntuusers.de/Screen/ Screen]&lt;br /&gt;
 [https://wiki.ubuntuusers.de/nohup/ nohup]&lt;br /&gt;
 [https://linuxcommand.org/lc3_man_pages/ssh1.html linuxcommand ssh1]&lt;br /&gt;
 open ip&lt;br /&gt;
&lt;br /&gt;
=== '''SSH|SCP|SFTP FUSE, SSHFS''' ===&lt;br /&gt;
 '''Mit dem SSH-Clients SSHSSH|SCP|SFTP kann man sich über ein Terminal auf entfernte Rechner anmelden.'''&lt;br /&gt;
 '''Die Kommunikation und die Authentifizierung findet dabei verschlüsselt statt.'''&lt;br /&gt;
 '''SSH kann dabei interaktiv oder nicht interaktiv genutzt werden'''&lt;br /&gt;
&lt;br /&gt;
=== '''RANKING DER REMOTE CLIENTS|TOOLS NACH SICHERHEIT''' ===&lt;br /&gt;
 # '''SSH'''&lt;br /&gt;
 # '''SCP'''&lt;br /&gt;
 # '''SFTP'''&lt;br /&gt;
 # '''RLOGIN'''&lt;br /&gt;
 # '''TELNET'''&lt;br /&gt;
 # '''FTP'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSH STATUS''' ====&lt;br /&gt;
 '''$ systemctl status ssh '''&lt;br /&gt;
&lt;br /&gt;
 '''$ whoami'''&lt;br /&gt;
 '''$ who'''&lt;br /&gt;
 '''$ w'''&lt;br /&gt;
&lt;br /&gt;
 '''$ ps'''&lt;br /&gt;
 '''$ ps aux'''&lt;br /&gt;
 '''$ ps aux | grep ssh '''&lt;br /&gt;
 '''$ ps aux | grep sshd '''&lt;br /&gt;
&lt;br /&gt;
 '''$ lsof -i -n | egrep 'ssh' '''&lt;br /&gt;
 '''$ lsof -i -n | egrep 'sshd' '''&lt;br /&gt;
&lt;br /&gt;
 '''$ ss '''&lt;br /&gt;
 '''$ ss -l'''&lt;br /&gt;
 '''$ ss | grep tcp'''&lt;br /&gt;
 '''$ ss | grep -i ssh'''&lt;br /&gt;
 '''$ ss -u -a'''&lt;br /&gt;
&lt;br /&gt;
 '''$ last -a | grep -i still'''&lt;br /&gt;
&lt;br /&gt;
 '''apk*error'''&lt;br /&gt;
 ''$ service ssh status ''&lt;br /&gt;
 ''$ netstat -tanup | grep ssh ''&lt;br /&gt;
 ''$ netstat -tnpa | grep 'ESTABLISHED.*sshd''&lt;br /&gt;
 ''$ netstat -an | grep 8090/port''&lt;br /&gt;
 ''$ firewall-cmd --list-all-zones ''&lt;br /&gt;
&lt;br /&gt;
==== '''SSH tools''' ====&lt;br /&gt;
 '''ssh-keygen'''&lt;br /&gt;
 '''$ ssh-keyscan ip &amp;gt; known_hosts'''&lt;br /&gt;
 '''$ ssh-keyscan -f txtwithhosts'''&lt;br /&gt;
&lt;br /&gt;
 '''ssh-keyscan'''&lt;br /&gt;
&lt;br /&gt;
 '''ssh-copy-id'''&lt;br /&gt;
&lt;br /&gt;
 '''ssh-add'''&lt;br /&gt;
 '''$ ssh-add -l '''&lt;br /&gt;
 '''$ ssh-add KEY '''&lt;br /&gt;
&lt;br /&gt;
 '''ssh-agent'''&lt;br /&gt;
 '''$ pgrep ssh-agent '''&lt;br /&gt;
 '''$ ps aux | grep ssh-agent'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSH|SSHFS|FUSE CONFIG FILES''' ====&lt;br /&gt;
 '''$ cat /etc/ssh/sshd_config'''&lt;br /&gt;
 '''$ cat /etc/ssh/ssh_config'''&lt;br /&gt;
 '''$ /etc/fuse.conf'''&lt;br /&gt;
 '''$ /etc/modules'''&lt;br /&gt;
''&lt;br /&gt;
 '''''IN LAB'''''&lt;br /&gt;
 '''AllowHosts'''&lt;br /&gt;
 '''AllowUsers'''&lt;br /&gt;
 '''AllowGroups'''&lt;br /&gt;
 '''ChRootGroups(Syntax: AllowGroups)'''&lt;br /&gt;
 '''ChRootUsers(Syntax: AllowUsers)'''&lt;br /&gt;
&lt;br /&gt;
==== '''Create SSH Key''' ====&lt;br /&gt;
 '''$ ssh-keygen -t ed25519 -b 4096'''&lt;br /&gt;
&lt;br /&gt;
==== '''Copy SSH Key''' ====&lt;br /&gt;
 '''$ ssh-copy-id  -i KEY user@IP'''&lt;br /&gt;
 '''$ ssh-copy-id  -i ~/.ssh/KEY user@IP'''&lt;br /&gt;
&lt;br /&gt;
 ''copy key while login with key''&lt;br /&gt;
 '''$ ssh-copy-id -i KEYTOCOPY -f -o 'IdentityFile KEYTOLOGIN' -p 5000 USER@IP'''&lt;br /&gt;
&lt;br /&gt;
==== '''Login with SSH Key''' ====&lt;br /&gt;
 '''$ ssh -i ~/.ssh/KEY user@IP -p 5001'''&lt;br /&gt;
&lt;br /&gt;
==== '''ssh config files &amp;amp; folders''' ====&lt;br /&gt;
 '''/etc/ssh/ssh_config'''&lt;br /&gt;
 '''/etc/ssh/sshd_config'''&lt;br /&gt;
 '''~/.ssh'''&lt;br /&gt;
 '''~/.ssh/authorized_keys '''&lt;br /&gt;
 '''~/.ssh/known_hosts'''&lt;br /&gt;
&lt;br /&gt;
==== '''ssh sshd_config file''' ====&lt;br /&gt;
 '''$ nano /etc/ssh/sshd_config'''&lt;br /&gt;
 ''' Port 5000'''&lt;br /&gt;
 ''' PubkeyAuthentication yes'''&lt;br /&gt;
 ''' PasswordAuthentication no'''&lt;br /&gt;
 ''' PermitEmptyPasswords no'''&lt;br /&gt;
 ''' X11Forwarding no'''&lt;br /&gt;
 ''' Banner /path/ (Message before login)'''&lt;br /&gt;
 ''''' ListenAddress (Strict/Diff Networks)'''''&lt;br /&gt;
 ''''' MaxSessions '''''&lt;br /&gt;
 [https://unix.stackexchange.com/questions/26170/sshd-config-maxsessions-parameter  MaxSessions parameter]&lt;br /&gt;
&lt;br /&gt;
==== '''ssh motd file''' ====&lt;br /&gt;
 '''$ nano /etc/motd (Message after Login)'''&lt;br /&gt;
&lt;br /&gt;
==== '''ssh known_hosts file''' ====&lt;br /&gt;
 '''$ nano ~/.ssh/known_hosts '''&lt;br /&gt;
&lt;br /&gt;
==== '''ssh authorized_keys file''' ====&lt;br /&gt;
 '''$ nano ~/.ssh/authorized_keys '''&lt;br /&gt;
&lt;br /&gt;
 '''How to manually copy SSH public keys to server:'''&lt;br /&gt;
 On the local machine&lt;br /&gt;
 '''$ cat ~/.ssh/id_rsa.pub'''&lt;br /&gt;
 copy&lt;br /&gt;
 ''ssh-rsa .STRING. USER@IP''&lt;br /&gt;
&lt;br /&gt;
 On the remote server paste the line to:&lt;br /&gt;
 '''~/.ssh/authorized_keys'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE''' ====&lt;br /&gt;
 '''$ sshfs user@host:/dir /dir -o IdentityFile=~/.ssh/KEY'''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs user@host:/dir /dir -o IdentityFile=~/.ssh/KEY -o idmap=user -o uid=$(id -u) -o gid=$(id -g)'''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs user@host:/dir /dir -C -p 5001'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE | USER MAPPING''' ====&lt;br /&gt;
 '''$ sshfs Benutzername@irgendEinRechner:/pfad_auf_dem_server/ ~/fusessh -o idmap=user -o uid=$(id -u) -o gid=$(id -g) '''&lt;br /&gt;
 '''$ sshfs user@host:/dir /dir -o IdentityFile=~/.ssh/KEY -o idmap=user -o uid=$(id -u) -o gid=$(id -g) -o nonempty -p 5001 '''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE | SYMLINKS''' ====&lt;br /&gt;
 '''$ sshfs -o follow_symlinks'''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs Benutzername@irgendEinRechner:/pfad_auf_dem_server/ ~/fusessh -o follow_symlinks '''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE | FUSERMOUNT''' ====&lt;br /&gt;
 '''$ fusermount -u /dir '''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS FUSE | Denied root access to user mounted FUSE file system''' ====&lt;br /&gt;
 This is by design in fuse as a security measure. &lt;br /&gt;
 Pass the '''-o allow_root''' or '''-o allow_other''' option when mounting the filesystem with sshfs.&lt;br /&gt;
 [https://serverfault.com/questions/188894/denied-root-access-to-user-mounted-fuse-file-system https://serverfault.com]&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS TIMEOUT''' ====&lt;br /&gt;
 '''1) In der Datei .ssh/config folgende Zeile hinzufügen (liegt im Homeverzeichnis des Anwenders, bzw. wenn man Automount beim Systemstart macht, ist die Datei /root/.ssh/config zu ändern):'''&lt;br /&gt;
 &lt;br /&gt;
  '''$ sshfs -o ServerAliveInterval=15'''&lt;br /&gt;
  '''$ sshfs-o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3  '''&lt;br /&gt;
  [https://serverfault.com/questions/6709/sshfs-mount-that-survives-disconnect SSHFS mount that survives disconnect| keep connection alive]&lt;br /&gt;
 The options ServerAliveInterval=5,ServerAliveCountMax=3 say that ssh checks every 5 seconds to see whether the remote server is still responding. &lt;br /&gt;
 If it does not receive a response after 3 of these checks, then it disconnects automatically. &lt;br /&gt;
 Thus any process waiting on this mount should hang about 15 seconds max.&lt;br /&gt;
 The options ConnectTimeout=3,ConnectionAttempts=1 are necessary because otherwise ssh will wait a very long time when attempting to reestablish connections, &lt;br /&gt;
 which again causes other processes to hang if they try to access the mount during this time.&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS SYSTEMSTART | /etc/fstab''' ====&lt;br /&gt;
 '''$ sshfs#Benutzername@irgendEinRechner:/pfad_auf_dem_server/ ~/fusessh fuse uid=1003,gid=100,umask=0,allow_other,_netdev 0 0'''&lt;br /&gt;
 &lt;br /&gt;
 '''$ sshfs#user@server:/remote/folder /local/mount/dir fuse IdentityFile=sshkeyfile,Port=XXX,allow_other,_netdev,ServerAliveInterval=45,ServerAliveCountMax=2,reconnect,noatime,auto 0 0 '''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs#user@server:/remote/folder /local/mount/dir fuse IdentityFile=sshkeyfile,Port=XXX,uid=1000,gid=1000,allow_other,_netdev,ServerAliveInterval=45,ServerAliveCountMax=2,reconnect,noatime,auto 0 0 '''&lt;br /&gt;
&lt;br /&gt;
 '''$ sshfs#user@server:/remote/folder /local/mount/dir fuse delay_connect,IdentityFile=sshkeyfile,Port=XXX,uid=1000,gid=1000,allow_other,_netdev,ServerAliveInterval=45,ServerAliveCountMax=2,reconnect,noatime,auto 0 0 '''&lt;br /&gt;
&lt;br /&gt;
==== '''SSHFS SHOW MOUNTS/CHECK MOUNTED | /etc/mtab''' ====&lt;br /&gt;
 '''$ mount'''&lt;br /&gt;
 '''$ cat /proc/mounts'''&lt;br /&gt;
 '''$ cat /etc/mtab'''&lt;br /&gt;
 '''$ cat /etc/mtab | grep fuse'''&lt;br /&gt;
 '''$ cat /etc/mtab | grep ssh'''&lt;br /&gt;
 '''$ findmnt'''&lt;br /&gt;
 '''$ findmnt | grep fuse'''&lt;br /&gt;
 '''$ findmnt | grep ssh'''&lt;br /&gt;
 '''$ df -h'''&lt;br /&gt;
 '''$ lsblk -f'''&lt;br /&gt;
&lt;br /&gt;
==== '''SSH Port-Tunneling ''' ====&lt;br /&gt;
&lt;br /&gt;
===== '''Local Forwarding'''===== &lt;br /&gt;
 '''$ ssh -i ~/.ssh/KEY -L 80:IP:80 user@IP -p 2000 '''&lt;br /&gt;
&lt;br /&gt;
===== '''Remote Forwarding'''===== &lt;br /&gt;
&lt;br /&gt;
===== '''Port Forwarding'''=====&lt;br /&gt;
&lt;br /&gt;
==== '''Reverse SSH Tunnel ''' ====&lt;br /&gt;
 ''Check for:''&lt;br /&gt;
 ''1. ServerAliveInterval(sshd_config)''&lt;br /&gt;
 ''2. autossh''&lt;br /&gt;
&lt;br /&gt;
 '''ssh -R 5001:localhost:22 -fN I'''P&lt;br /&gt;
&lt;br /&gt;
==== '''AutoSSH SSH Tunnel ''' ====&lt;br /&gt;
 '''$ autossh -NT -o &amp;quot;ExitOnForwardFailure=yes&amp;quot; -R 5001:localhost:6001 -l USER IP -p 7001 -i /home/USER/.ssh/KEY'''&lt;br /&gt;
&lt;br /&gt;
 '''$ autossh -N -f -i /home/&amp;lt;user&amp;gt;/.ssh/id_rsa -R 22222:localhost:22 &amp;lt;user&amp;gt;@&amp;lt;remote_host&amp;gt;'''&lt;br /&gt;
 '''-N:''' tell ssh to not execute any command, since we only use it for tunneling.&lt;br /&gt;
 '''-f:''' tell autossh to fall into background on start.&lt;br /&gt;
 '''-i:''' tell ssh to use the proper identity.&lt;br /&gt;
 '''-R''' 22222:localhost:22: &lt;br /&gt;
 reverse tunnel remote host's 22222 port to localhost's 22 port. &lt;br /&gt;
 So that we can use ssh -p 22222 localhost on remote host to ssh into local machine.&lt;br /&gt;
&lt;br /&gt;
 '''nano /etc/systemd/system/sshtunnel.service''' &lt;br /&gt;
&lt;br /&gt;
===== '''sshtunnel.service''' =====&lt;br /&gt;
&lt;br /&gt;
 '''[Unit]'''&lt;br /&gt;
 Description=AutoSSH tunnel service&lt;br /&gt;
 #After=network.target&lt;br /&gt;
 After=network-online.target ssh.service&lt;br /&gt;
 '''[Service]'''&lt;br /&gt;
 User=USER&lt;br /&gt;
 Environment=&amp;quot;AUTOSSH_GATETIME=0&amp;quot;&lt;br /&gt;
 RestartSec=30&lt;br /&gt;
 Restart=always&lt;br /&gt;
 ExecStart=/usr/bin/autossh -NT -o &amp;quot;ExitOnForwardFailure=yes&amp;quot; -R 5001:localhost:6000 -l USER IP -p 6001 -i /home/USER/.ssh/KEY&lt;br /&gt;
 ExecStop=pkill -s KILL autossh&lt;br /&gt;
 TimeoutStopSec=10&lt;br /&gt;
 '''[Install]'''&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
 '''systemctl status sshtunnel.service'''&lt;br /&gt;
 '''systemctl daemon-reload'''&lt;br /&gt;
 '''systemctl restart sshtunnel.service'''&lt;br /&gt;
 &lt;br /&gt;
 When using ssh multiplexing, killing the ssh process is often undesirable &lt;br /&gt;
 (it kills all open connections with that host), &lt;br /&gt;
 and you cannot easily access the escape because &amp;quot;escape not available to multiplexed sessions&amp;quot;. &lt;br /&gt;
 The right way is then to run the analogue of the forwarding command that you want to cancel, &lt;br /&gt;
 but adding -O cancel. For instance:&lt;br /&gt;
&lt;br /&gt;
 '''ssh -O cancel -L 5002:192.168.0.10:5002 192.168.178.100'''&lt;br /&gt;
&lt;br /&gt;
 This will disable this port forwarding without terminating the session. Again, this will only   &lt;br /&gt;
 work if ssh multiplexing is in use for the connection to 192.168.178.100&lt;br /&gt;
&lt;br /&gt;
 $ ssh -luser 192.xx.xxx.xx&lt;br /&gt;
&lt;br /&gt;
==== ''' ssh commands ''' ====&lt;br /&gt;
 $ ssh user@192.168.188.2 '[command]'&lt;br /&gt;
 $ ssh user@192.168.188.2 'ls -la /home/user'&lt;br /&gt;
 $ put&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== ''' ssh execute command ''' ====&lt;br /&gt;
 $ ssh user@ip 'ls -la'&lt;br /&gt;
&lt;br /&gt;
==== ''' ssh execute script ''' ====&lt;br /&gt;
&lt;br /&gt;
 $ ssh user@ip &amp;lt; script.sh&lt;br /&gt;
 $ ssh user@ip &amp;quot;bash -s&amp;quot; &amp;lt; script.sh&lt;br /&gt;
&lt;br /&gt;
==== ''' secure file transfer ''' ====&lt;br /&gt;
&lt;br /&gt;
===== ''' SCP file ''' =====&lt;br /&gt;
 $ pscp&lt;br /&gt;
&lt;br /&gt;
 # scp [source][destination]&lt;br /&gt;
 # destination ip:/path/&lt;br /&gt;
&lt;br /&gt;
 '''$ scp /test user@192.168.188.2:/home/user/test'''&lt;br /&gt;
 '''$ scp *.txt user@192.168.188.2:/home/user/txt'''&lt;br /&gt;
&lt;br /&gt;
 '''$ scp user@192.168.188.2:/home/user/txt.txt .'''&lt;br /&gt;
&lt;br /&gt;
[https://unix.stackexchange.com/a/748130/515538 How to copy files from one machine to another using ssh]&lt;br /&gt;
&lt;br /&gt;
===== ''' SCP folder ''' =====&lt;br /&gt;
&lt;br /&gt;
 '''$ scp -r /dir user@192.168.188.2:/home/user/dir '''&lt;br /&gt;
 '''$ scp -r /dir/* user@192.168.188.2:/home/user/dir '''&lt;br /&gt;
 '''$ scp -r user@192.168.188.2:/home/user/dir /home/dir'''&lt;br /&gt;
 '''$ scp -r user@192.168.188.2:/home/user/dir .'''&lt;br /&gt;
&lt;br /&gt;
===== ''' sftp ''' =====&lt;br /&gt;
 &lt;br /&gt;
===== ''' psftp ''' =====&lt;br /&gt;
&lt;br /&gt;
===== ''' ssh Jumphost ''' =====&lt;br /&gt;
#ssh jumphost&lt;br /&gt;
 PC-&amp;gt;Junphost-&amp;gt;IntServer&lt;br /&gt;
 PC-&amp;gt;Firewall-&amp;gt;IntServer&lt;br /&gt;
 ssh -J user@ip user@ip&lt;br /&gt;
&lt;br /&gt;
===== ''' ssh Multi-hop Tunnel ''' =====&lt;br /&gt;
 ssh -L8080:localhost:8080 user@host1&lt;br /&gt;
 SSH Tunnel with -t and -v (verbose)&lt;br /&gt;
&lt;br /&gt;
===== ''' ssh X11 Forwarding ''' =====&lt;br /&gt;
 '''$ ssh -X user@ip'''&lt;br /&gt;
 firefox &amp;amp; &lt;br /&gt;
&lt;br /&gt;
===== ''' ssh config file ''' =====&lt;br /&gt;
#ssh config file in .ssh/config&lt;br /&gt;
Host *&lt;br /&gt;
        User user&lt;br /&gt;
Host linuxhost&lt;br /&gt;
        HostName 192.168.188.2&lt;br /&gt;
        User user&lt;br /&gt;
        Port 2000&lt;br /&gt;
        IdentityFile ~/.ssh/mykey&lt;br /&gt;
&lt;br /&gt;
 ssh config file in /etc/ssh/ssh_config&lt;br /&gt;
&lt;br /&gt;
 debug modus&lt;br /&gt;
 $ ssh debianvm -v&lt;br /&gt;
&lt;br /&gt;
===== ''' ssh VNC|DISPLAY ''' =====&lt;br /&gt;
 ssh user @&amp;lt;ipadresse&amp;gt; &amp;quot;DISPLAY =:0 nohup firefox&amp;quot;&lt;br /&gt;
 ssh -i KEY -p XXXX user@x.x.x.x &amp;quot;DIS1PLAY =:0 nohup firefox&amp;quot;&lt;br /&gt;
 ssh -i KEY -p XXXX -X user@x.x.x.x&lt;br /&gt;
 ssh -i KEY -L 5901:127.0.0.1:5901 -C -N -l -p XXXX user@x.x.x.x&lt;br /&gt;
 ssh -i KEY -p XXXX -L 5901:127.0.0.1:5901 -C -N -l user x.x.x.x&lt;br /&gt;
&lt;br /&gt;
===== '''  socks proxy with google-authenticator!?  ''' =====&lt;br /&gt;
 # in SSHD FILE&lt;br /&gt;
 $ AuthenticationMethods publickey,keyboard-interactive&lt;br /&gt;
 $ nano /etc/pam.d/sshd 	&lt;br /&gt;
&lt;br /&gt;
 # google auth&lt;br /&gt;
 $auth required pam_google_authenticator.so &lt;br /&gt;
 $auth required pam_google_authenticator.so nullok&lt;br /&gt;
&lt;br /&gt;
ssh socks reverse&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=ADB&amp;diff=1117</id>
		<title>ADB</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=ADB&amp;diff=1117"/>
		<updated>2023-05-23T17:33:17Z</updated>

		<summary type="html">&lt;p&gt;Geist: /* Device Related Commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; '''$ adb devices'''&lt;br /&gt;
 '''$ adb root'''&lt;br /&gt;
 '''$ adb devices -l''' (list devices, product/model)&lt;br /&gt;
 '''$ adb shell''' (terminal)&lt;br /&gt;
 '''$ adb help'''&lt;br /&gt;
 '''$ adb reboot bootloader '''&lt;br /&gt;
 '''$ adb reboot recovery '''&lt;br /&gt;
 '''$ adb push [LOCAL] /[DEVICE]/ '''&lt;br /&gt;
 '''$ adb push -p [LOCAL] /[DEVICE]/ '''&lt;br /&gt;
&lt;br /&gt;
 [https://www.automatetheplanet.com/adb-cheat-sheet/ Most Complete ADB Cheat Sheet]&lt;br /&gt;
 &lt;br /&gt;
 ''Maru Set up with PC''&lt;br /&gt;
 '''$ adb root'''&lt;br /&gt;
 '''$ adb shell'''&lt;br /&gt;
 '''$ lxc-start -n default'''&lt;br /&gt;
&lt;br /&gt;
== ADB Basics ==&lt;br /&gt;
&lt;br /&gt;
 adb devices (lists connected devices)&lt;br /&gt;
 adb root (restarts adbd with root permissions)&lt;br /&gt;
 adb start-server (starts the adb server)&lt;br /&gt;
 adb kill-server (kills the adb server)&lt;br /&gt;
 adb reboot (reboots the device)&lt;br /&gt;
 adb devices -l (list of devices by product/model)&lt;br /&gt;
 adb shell (starts the backround terminal)&lt;br /&gt;
 exit (exits the background terminal)&lt;br /&gt;
 adb help (list all commands)&lt;br /&gt;
 adb -s &amp;lt;deviceName&amp;gt; &amp;lt;command&amp;gt; (redirect command to specific device)&lt;br /&gt;
 adb –d &amp;lt;command&amp;gt; (directs command to only attached USB device)&lt;br /&gt;
 adb –e &amp;lt;command&amp;gt; (directs command to only attached emulator)&lt;br /&gt;
&lt;br /&gt;
== Package Installation ==&lt;br /&gt;
&lt;br /&gt;
 adb shell install &amp;lt;apk&amp;gt; (install app)&lt;br /&gt;
 adb shell install &amp;lt;path&amp;gt; (install app from phone path)&lt;br /&gt;
 adb shell install -r &amp;lt;path&amp;gt; (install app from phone path)&lt;br /&gt;
 adb shell uninstall &amp;lt;name&amp;gt; (remove the app)&lt;br /&gt;
&lt;br /&gt;
== Paths ==&lt;br /&gt;
&lt;br /&gt;
 /data/data/&amp;lt;package&amp;gt;/databases (app databases)&lt;br /&gt;
 /data/data/&amp;lt;package&amp;gt;/shared_prefs/ (shared preferences)&lt;br /&gt;
 /data/app (apk installed by user)&lt;br /&gt;
 /system/app (pre-installed APK files)&lt;br /&gt;
 /mmt/asec (encrypted apps) (App2SD)&lt;br /&gt;
 /mmt/emmc (internal SD Card)&lt;br /&gt;
 /mmt/adcard (external/Internal SD Card)&lt;br /&gt;
 /mmt/adcard/external_sd (external SD Card)&lt;br /&gt;
&lt;br /&gt;
 adb shell ls (list directory contents)&lt;br /&gt;
 adb shell ls -s (print size of each file)&lt;br /&gt;
 adb shell ls -R (list subdirectories recursively)&lt;br /&gt;
&lt;br /&gt;
== File Operations ==&lt;br /&gt;
&lt;br /&gt;
 adb push &amp;lt;local&amp;gt; &amp;lt;remote&amp;gt; (copy file/dir to device)&lt;br /&gt;
 adb pull &amp;lt;remote&amp;gt; &amp;lt;local&amp;gt; (copy file/dir from device)&lt;br /&gt;
 run-as &amp;lt;package&amp;gt; cat &amp;lt;file&amp;gt; (access the private package files)&lt;br /&gt;
&lt;br /&gt;
== Phone Info ==&lt;br /&gt;
&lt;br /&gt;
 adb get-statе (print device state)&lt;br /&gt;
 adb get-serialno (get the serial number)&lt;br /&gt;
 adb shell dumpsys iphonesybinfo (get the IMEI)&lt;br /&gt;
 adb shell netstat (list TCP connectivity)&lt;br /&gt;
 adb shell pwd (print current working directory)&lt;br /&gt;
 adb shell dumpsys battery (battery status)&lt;br /&gt;
 adb shell pm list features (list phone features)&lt;br /&gt;
 adb shell service list (list all services)&lt;br /&gt;
 adb shell dumpsys activity &amp;lt;package&amp;gt;/&amp;lt;activity&amp;gt; (activity info)&lt;br /&gt;
 adb shell ps (print process status)&lt;br /&gt;
 adb shell wm size (displays the current screen resolution)&lt;br /&gt;
 dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp' (print current app's opened activity)&lt;br /&gt;
&lt;br /&gt;
== Package Info == &lt;br /&gt;
&lt;br /&gt;
 adb shell list packages (list package names)&lt;br /&gt;
 adb shell list packages -r (list package name + path to apks)&lt;br /&gt;
 adb shell list packages -3 (list third party package names)&lt;br /&gt;
 adb shell list packages -s (list only system packages)&lt;br /&gt;
 adb shell list packages -u (list package names + uninstalled)&lt;br /&gt;
 adb shell dumpsys package packages (list info on all apps)&lt;br /&gt;
 adb shell dump &amp;lt;name&amp;gt; (list info on one package)&lt;br /&gt;
 adb shell path &amp;lt;package&amp;gt; (path to the apk file)&lt;br /&gt;
&lt;br /&gt;
== Configure Settings Commands ==&lt;br /&gt;
&lt;br /&gt;
 adb shell dumpsys battery set level &amp;lt;n&amp;gt; (change the level from 0 to 100)&lt;br /&gt;
 adb shell dumpsys battery set status&amp;lt;n&amp;gt; (change the level to unknown, charging, discharging, not charging or full)&lt;br /&gt;
 adb shell dumpsys battery reset (reset the battery)&lt;br /&gt;
 adb shell dumpsys battery set usb &amp;lt;n&amp;gt; (change the status of USB connection. ON or OFF)&lt;br /&gt;
 adb shell wm size WxH (sets the resolution to WxH)&lt;br /&gt;
&lt;br /&gt;
== Device Related Commands == &lt;br /&gt;
&lt;br /&gt;
 adb reboot-recovery (reboot device into recovery mode)&lt;br /&gt;
 adb reboot fastboot (reboot device into recovery mode)&lt;br /&gt;
 adb shell screencap -p &amp;quot;/path/to/screenshot.png&amp;quot; (capture screenshot)&lt;br /&gt;
 adb shell screenrecord &amp;quot;/path/to/record.mp4&amp;quot; (record device screen)&lt;br /&gt;
 adb backup -apk -all -f backup.ab (backup settings and apps)&lt;br /&gt;
 adb backup -apk -shared -all -f backup.ab (backup settings, apps and shared storage)&lt;br /&gt;
 adb backup -apk -nosystem -all -f backup.ab (backup only non-system apps)&lt;br /&gt;
 adb restore backup.ab (restore a previous backup)&lt;br /&gt;
 &lt;br /&gt;
 adb shell am start|startservice|broadcast &amp;lt;INTENT&amp;gt;[&amp;lt;COMPONENT&amp;gt;]&lt;br /&gt;
 -a &amp;lt;ACTION&amp;gt; e.g. android.intent.action.VIEW&lt;br /&gt;
 -c &amp;lt;CATEGORY&amp;gt; e.g. android.intent.category.LAUNCHER (start activity intent)&lt;br /&gt;
&lt;br /&gt;
 adb shell am start -a android.intent.action.VIEW -d URL (open URL)&lt;br /&gt;
 adb shell am start -t image/* -a android.intent.action.VIEW (opens gallery)&lt;br /&gt;
&lt;br /&gt;
== Logs ==&lt;br /&gt;
&lt;br /&gt;
 adb logcat [options] [filter] [filter] (view device log)&lt;br /&gt;
 adb bugreport (print bug reports)&lt;br /&gt;
&lt;br /&gt;
== Permissions ==&lt;br /&gt;
&lt;br /&gt;
 adb shell permissions groups (list permission groups definitions)&lt;br /&gt;
 adb shell list permissions -g -r (list permissions details)&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=ADB&amp;diff=1116</id>
		<title>ADB</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=ADB&amp;diff=1116"/>
		<updated>2023-05-23T17:32:59Z</updated>

		<summary type="html">&lt;p&gt;Geist: /* Device Related Commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; '''$ adb devices'''&lt;br /&gt;
 '''$ adb root'''&lt;br /&gt;
 '''$ adb devices -l''' (list devices, product/model)&lt;br /&gt;
 '''$ adb shell''' (terminal)&lt;br /&gt;
 '''$ adb help'''&lt;br /&gt;
 '''$ adb reboot bootloader '''&lt;br /&gt;
 '''$ adb reboot recovery '''&lt;br /&gt;
 '''$ adb push [LOCAL] /[DEVICE]/ '''&lt;br /&gt;
 '''$ adb push -p [LOCAL] /[DEVICE]/ '''&lt;br /&gt;
&lt;br /&gt;
 [https://www.automatetheplanet.com/adb-cheat-sheet/ Most Complete ADB Cheat Sheet]&lt;br /&gt;
 &lt;br /&gt;
 ''Maru Set up with PC''&lt;br /&gt;
 '''$ adb root'''&lt;br /&gt;
 '''$ adb shell'''&lt;br /&gt;
 '''$ lxc-start -n default'''&lt;br /&gt;
&lt;br /&gt;
== ADB Basics ==&lt;br /&gt;
&lt;br /&gt;
 adb devices (lists connected devices)&lt;br /&gt;
 adb root (restarts adbd with root permissions)&lt;br /&gt;
 adb start-server (starts the adb server)&lt;br /&gt;
 adb kill-server (kills the adb server)&lt;br /&gt;
 adb reboot (reboots the device)&lt;br /&gt;
 adb devices -l (list of devices by product/model)&lt;br /&gt;
 adb shell (starts the backround terminal)&lt;br /&gt;
 exit (exits the background terminal)&lt;br /&gt;
 adb help (list all commands)&lt;br /&gt;
 adb -s &amp;lt;deviceName&amp;gt; &amp;lt;command&amp;gt; (redirect command to specific device)&lt;br /&gt;
 adb –d &amp;lt;command&amp;gt; (directs command to only attached USB device)&lt;br /&gt;
 adb –e &amp;lt;command&amp;gt; (directs command to only attached emulator)&lt;br /&gt;
&lt;br /&gt;
== Package Installation ==&lt;br /&gt;
&lt;br /&gt;
 adb shell install &amp;lt;apk&amp;gt; (install app)&lt;br /&gt;
 adb shell install &amp;lt;path&amp;gt; (install app from phone path)&lt;br /&gt;
 adb shell install -r &amp;lt;path&amp;gt; (install app from phone path)&lt;br /&gt;
 adb shell uninstall &amp;lt;name&amp;gt; (remove the app)&lt;br /&gt;
&lt;br /&gt;
== Paths ==&lt;br /&gt;
&lt;br /&gt;
 /data/data/&amp;lt;package&amp;gt;/databases (app databases)&lt;br /&gt;
 /data/data/&amp;lt;package&amp;gt;/shared_prefs/ (shared preferences)&lt;br /&gt;
 /data/app (apk installed by user)&lt;br /&gt;
 /system/app (pre-installed APK files)&lt;br /&gt;
 /mmt/asec (encrypted apps) (App2SD)&lt;br /&gt;
 /mmt/emmc (internal SD Card)&lt;br /&gt;
 /mmt/adcard (external/Internal SD Card)&lt;br /&gt;
 /mmt/adcard/external_sd (external SD Card)&lt;br /&gt;
&lt;br /&gt;
 adb shell ls (list directory contents)&lt;br /&gt;
 adb shell ls -s (print size of each file)&lt;br /&gt;
 adb shell ls -R (list subdirectories recursively)&lt;br /&gt;
&lt;br /&gt;
== File Operations ==&lt;br /&gt;
&lt;br /&gt;
 adb push &amp;lt;local&amp;gt; &amp;lt;remote&amp;gt; (copy file/dir to device)&lt;br /&gt;
 adb pull &amp;lt;remote&amp;gt; &amp;lt;local&amp;gt; (copy file/dir from device)&lt;br /&gt;
 run-as &amp;lt;package&amp;gt; cat &amp;lt;file&amp;gt; (access the private package files)&lt;br /&gt;
&lt;br /&gt;
== Phone Info ==&lt;br /&gt;
&lt;br /&gt;
 adb get-statе (print device state)&lt;br /&gt;
 adb get-serialno (get the serial number)&lt;br /&gt;
 adb shell dumpsys iphonesybinfo (get the IMEI)&lt;br /&gt;
 adb shell netstat (list TCP connectivity)&lt;br /&gt;
 adb shell pwd (print current working directory)&lt;br /&gt;
 adb shell dumpsys battery (battery status)&lt;br /&gt;
 adb shell pm list features (list phone features)&lt;br /&gt;
 adb shell service list (list all services)&lt;br /&gt;
 adb shell dumpsys activity &amp;lt;package&amp;gt;/&amp;lt;activity&amp;gt; (activity info)&lt;br /&gt;
 adb shell ps (print process status)&lt;br /&gt;
 adb shell wm size (displays the current screen resolution)&lt;br /&gt;
 dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp' (print current app's opened activity)&lt;br /&gt;
&lt;br /&gt;
== Package Info == &lt;br /&gt;
&lt;br /&gt;
 adb shell list packages (list package names)&lt;br /&gt;
 adb shell list packages -r (list package name + path to apks)&lt;br /&gt;
 adb shell list packages -3 (list third party package names)&lt;br /&gt;
 adb shell list packages -s (list only system packages)&lt;br /&gt;
 adb shell list packages -u (list package names + uninstalled)&lt;br /&gt;
 adb shell dumpsys package packages (list info on all apps)&lt;br /&gt;
 adb shell dump &amp;lt;name&amp;gt; (list info on one package)&lt;br /&gt;
 adb shell path &amp;lt;package&amp;gt; (path to the apk file)&lt;br /&gt;
&lt;br /&gt;
== Configure Settings Commands ==&lt;br /&gt;
&lt;br /&gt;
 adb shell dumpsys battery set level &amp;lt;n&amp;gt; (change the level from 0 to 100)&lt;br /&gt;
 adb shell dumpsys battery set status&amp;lt;n&amp;gt; (change the level to unknown, charging, discharging, not charging or full)&lt;br /&gt;
 adb shell dumpsys battery reset (reset the battery)&lt;br /&gt;
 adb shell dumpsys battery set usb &amp;lt;n&amp;gt; (change the status of USB connection. ON or OFF)&lt;br /&gt;
 adb shell wm size WxH (sets the resolution to WxH)&lt;br /&gt;
&lt;br /&gt;
== Device Related Commands == &lt;br /&gt;
&lt;br /&gt;
 adb reboot-recovery (reboot device into recovery mode)&lt;br /&gt;
 adb reboot fastboot (reboot device into recovery mode)&lt;br /&gt;
 adb shell screencap -p &amp;quot;/path/to/screenshot.png&amp;quot; (capture screenshot)&lt;br /&gt;
 adb shell screenrecord &amp;quot;/path/to/record.mp4&amp;quot; (record device screen)&lt;br /&gt;
 adb backup -apk -all -f backup.ab (backup settings and apps)&lt;br /&gt;
 adb backup -apk -shared -all -f backup.ab (backup settings, apps and shared storage)&lt;br /&gt;
 adb backup -apk -nosystem -all -f backup.ab (backup only non-system apps)&lt;br /&gt;
 adb restore backup.ab (restore a previous backup)&lt;br /&gt;
 adb shell am start|startservice|broadcast &amp;lt;INTENT&amp;gt;[&amp;lt;COMPONENT&amp;gt;]&lt;br /&gt;
 -a &amp;lt;ACTION&amp;gt; e.g. android.intent.action.VIEW&lt;br /&gt;
 -c &amp;lt;CATEGORY&amp;gt; e.g. android.intent.category.LAUNCHER (start activity intent)&lt;br /&gt;
&lt;br /&gt;
 adb shell am start -a android.intent.action.VIEW -d URL (open URL)&lt;br /&gt;
 adb shell am start -t image/* -a android.intent.action.VIEW (opens gallery)&lt;br /&gt;
&lt;br /&gt;
== Logs ==&lt;br /&gt;
&lt;br /&gt;
 adb logcat [options] [filter] [filter] (view device log)&lt;br /&gt;
 adb bugreport (print bug reports)&lt;br /&gt;
&lt;br /&gt;
== Permissions ==&lt;br /&gt;
&lt;br /&gt;
 adb shell permissions groups (list permission groups definitions)&lt;br /&gt;
 adb shell list permissions -g -r (list permissions details)&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=ADB&amp;diff=1115</id>
		<title>ADB</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=ADB&amp;diff=1115"/>
		<updated>2023-05-23T17:32:05Z</updated>

		<summary type="html">&lt;p&gt;Geist: /* ADB Basics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; '''$ adb devices'''&lt;br /&gt;
 '''$ adb root'''&lt;br /&gt;
 '''$ adb devices -l''' (list devices, product/model)&lt;br /&gt;
 '''$ adb shell''' (terminal)&lt;br /&gt;
 '''$ adb help'''&lt;br /&gt;
 '''$ adb reboot bootloader '''&lt;br /&gt;
 '''$ adb reboot recovery '''&lt;br /&gt;
 '''$ adb push [LOCAL] /[DEVICE]/ '''&lt;br /&gt;
 '''$ adb push -p [LOCAL] /[DEVICE]/ '''&lt;br /&gt;
&lt;br /&gt;
 [https://www.automatetheplanet.com/adb-cheat-sheet/ Most Complete ADB Cheat Sheet]&lt;br /&gt;
 &lt;br /&gt;
 ''Maru Set up with PC''&lt;br /&gt;
 '''$ adb root'''&lt;br /&gt;
 '''$ adb shell'''&lt;br /&gt;
 '''$ lxc-start -n default'''&lt;br /&gt;
&lt;br /&gt;
== ADB Basics ==&lt;br /&gt;
&lt;br /&gt;
 adb devices (lists connected devices)&lt;br /&gt;
 adb root (restarts adbd with root permissions)&lt;br /&gt;
 adb start-server (starts the adb server)&lt;br /&gt;
 adb kill-server (kills the adb server)&lt;br /&gt;
 adb reboot (reboots the device)&lt;br /&gt;
 adb devices -l (list of devices by product/model)&lt;br /&gt;
 adb shell (starts the backround terminal)&lt;br /&gt;
 exit (exits the background terminal)&lt;br /&gt;
 adb help (list all commands)&lt;br /&gt;
 adb -s &amp;lt;deviceName&amp;gt; &amp;lt;command&amp;gt; (redirect command to specific device)&lt;br /&gt;
 adb –d &amp;lt;command&amp;gt; (directs command to only attached USB device)&lt;br /&gt;
 adb –e &amp;lt;command&amp;gt; (directs command to only attached emulator)&lt;br /&gt;
&lt;br /&gt;
== Package Installation ==&lt;br /&gt;
&lt;br /&gt;
 adb shell install &amp;lt;apk&amp;gt; (install app)&lt;br /&gt;
 adb shell install &amp;lt;path&amp;gt; (install app from phone path)&lt;br /&gt;
 adb shell install -r &amp;lt;path&amp;gt; (install app from phone path)&lt;br /&gt;
 adb shell uninstall &amp;lt;name&amp;gt; (remove the app)&lt;br /&gt;
&lt;br /&gt;
== Paths ==&lt;br /&gt;
&lt;br /&gt;
 /data/data/&amp;lt;package&amp;gt;/databases (app databases)&lt;br /&gt;
 /data/data/&amp;lt;package&amp;gt;/shared_prefs/ (shared preferences)&lt;br /&gt;
 /data/app (apk installed by user)&lt;br /&gt;
 /system/app (pre-installed APK files)&lt;br /&gt;
 /mmt/asec (encrypted apps) (App2SD)&lt;br /&gt;
 /mmt/emmc (internal SD Card)&lt;br /&gt;
 /mmt/adcard (external/Internal SD Card)&lt;br /&gt;
 /mmt/adcard/external_sd (external SD Card)&lt;br /&gt;
&lt;br /&gt;
 adb shell ls (list directory contents)&lt;br /&gt;
 adb shell ls -s (print size of each file)&lt;br /&gt;
 adb shell ls -R (list subdirectories recursively)&lt;br /&gt;
&lt;br /&gt;
== File Operations ==&lt;br /&gt;
&lt;br /&gt;
 adb push &amp;lt;local&amp;gt; &amp;lt;remote&amp;gt; (copy file/dir to device)&lt;br /&gt;
 adb pull &amp;lt;remote&amp;gt; &amp;lt;local&amp;gt; (copy file/dir from device)&lt;br /&gt;
 run-as &amp;lt;package&amp;gt; cat &amp;lt;file&amp;gt; (access the private package files)&lt;br /&gt;
&lt;br /&gt;
== Phone Info ==&lt;br /&gt;
&lt;br /&gt;
 adb get-statе (print device state)&lt;br /&gt;
 adb get-serialno (get the serial number)&lt;br /&gt;
 adb shell dumpsys iphonesybinfo (get the IMEI)&lt;br /&gt;
 adb shell netstat (list TCP connectivity)&lt;br /&gt;
 adb shell pwd (print current working directory)&lt;br /&gt;
 adb shell dumpsys battery (battery status)&lt;br /&gt;
 adb shell pm list features (list phone features)&lt;br /&gt;
 adb shell service list (list all services)&lt;br /&gt;
 adb shell dumpsys activity &amp;lt;package&amp;gt;/&amp;lt;activity&amp;gt; (activity info)&lt;br /&gt;
 adb shell ps (print process status)&lt;br /&gt;
 adb shell wm size (displays the current screen resolution)&lt;br /&gt;
 dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp' (print current app's opened activity)&lt;br /&gt;
&lt;br /&gt;
== Package Info == &lt;br /&gt;
&lt;br /&gt;
 adb shell list packages (list package names)&lt;br /&gt;
 adb shell list packages -r (list package name + path to apks)&lt;br /&gt;
 adb shell list packages -3 (list third party package names)&lt;br /&gt;
 adb shell list packages -s (list only system packages)&lt;br /&gt;
 adb shell list packages -u (list package names + uninstalled)&lt;br /&gt;
 adb shell dumpsys package packages (list info on all apps)&lt;br /&gt;
 adb shell dump &amp;lt;name&amp;gt; (list info on one package)&lt;br /&gt;
 adb shell path &amp;lt;package&amp;gt; (path to the apk file)&lt;br /&gt;
&lt;br /&gt;
== Configure Settings Commands ==&lt;br /&gt;
&lt;br /&gt;
 adb shell dumpsys battery set level &amp;lt;n&amp;gt; (change the level from 0 to 100)&lt;br /&gt;
 adb shell dumpsys battery set status&amp;lt;n&amp;gt; (change the level to unknown, charging, discharging, not charging or full)&lt;br /&gt;
 adb shell dumpsys battery reset (reset the battery)&lt;br /&gt;
 adb shell dumpsys battery set usb &amp;lt;n&amp;gt; (change the status of USB connection. ON or OFF)&lt;br /&gt;
 adb shell wm size WxH (sets the resolution to WxH)&lt;br /&gt;
&lt;br /&gt;
== Device Related Commands == &lt;br /&gt;
&lt;br /&gt;
 adb reboot-recovery (reboot device into recovery mode)&lt;br /&gt;
 adb reboot fastboot (reboot device into recovery mode)&lt;br /&gt;
 adb shell screencap -p &amp;quot;/path/to/screenshot.png&amp;quot; (capture screenshot)&lt;br /&gt;
 adb shell screenrecord &amp;quot;/path/to/record.mp4&amp;quot; (record device screen)&lt;br /&gt;
 adb backup -apk -all -f backup.ab (backup settings and apps)&lt;br /&gt;
 adb backup -apk -shared -all -f backup.ab (backup settings, apps and shared storage)&lt;br /&gt;
 adb backup -apk -nosystem -all -f backup.ab (backup only non-system apps)&lt;br /&gt;
 adb restore backup.ab (restore a previous backup)&lt;br /&gt;
 adb shell am start|startservice|broadcast &amp;lt;INTENT&amp;gt;[&amp;lt;COMPONENT&amp;gt;]&lt;br /&gt;
-a &amp;lt;ACTION&amp;gt; e.g. android.intent.action.VIEW&lt;br /&gt;
-c &amp;lt;CATEGORY&amp;gt; e.g. android.intent.category.LAUNCHER (start activity intent)&lt;br /&gt;
&lt;br /&gt;
 adb shell am start -a android.intent.action.VIEW -d URL (open URL)&lt;br /&gt;
 adb shell am start -t image/* -a android.intent.action.VIEW (opens gallery)&lt;br /&gt;
&lt;br /&gt;
== Logs ==&lt;br /&gt;
&lt;br /&gt;
 adb logcat [options] [filter] [filter] (view device log)&lt;br /&gt;
 adb bugreport (print bug reports)&lt;br /&gt;
&lt;br /&gt;
== Permissions ==&lt;br /&gt;
&lt;br /&gt;
 adb shell permissions groups (list permission groups definitions)&lt;br /&gt;
 adb shell list permissions -g -r (list permissions details)&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=ADB&amp;diff=1114</id>
		<title>ADB</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=ADB&amp;diff=1114"/>
		<updated>2023-05-23T17:29:40Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; '''$ adb devices'''&lt;br /&gt;
 '''$ adb root'''&lt;br /&gt;
 '''$ adb devices -l''' (list devices, product/model)&lt;br /&gt;
 '''$ adb shell''' (terminal)&lt;br /&gt;
 '''$ adb help'''&lt;br /&gt;
 '''$ adb reboot bootloader '''&lt;br /&gt;
 '''$ adb reboot recovery '''&lt;br /&gt;
 '''$ adb push [LOCAL] /[DEVICE]/ '''&lt;br /&gt;
 '''$ adb push -p [LOCAL] /[DEVICE]/ '''&lt;br /&gt;
&lt;br /&gt;
 [https://www.automatetheplanet.com/adb-cheat-sheet/ Most Complete ADB Cheat Sheet]&lt;br /&gt;
 &lt;br /&gt;
 ''Maru Set up with PC''&lt;br /&gt;
 '''$ adb root'''&lt;br /&gt;
 '''$ adb shell'''&lt;br /&gt;
 '''$ lxc-start -n default'''&lt;br /&gt;
&lt;br /&gt;
== ADB Basics ==&lt;br /&gt;
&lt;br /&gt;
adb devices (lists connected devices)&lt;br /&gt;
adb root (restarts adbd with root permissions)&lt;br /&gt;
adb start-server (starts the adb server)&lt;br /&gt;
adb kill-server (kills the adb server)&lt;br /&gt;
adb reboot (reboots the device)&lt;br /&gt;
adb devices -l (list of devices by product/model)&lt;br /&gt;
adb shell (starts the backround terminal)&lt;br /&gt;
exit (exits the background terminal)&lt;br /&gt;
adb help (list all commands)&lt;br /&gt;
adb -s &amp;lt;deviceName&amp;gt; &amp;lt;command&amp;gt; (redirect command to specific device)&lt;br /&gt;
adb –d &amp;lt;command&amp;gt; (directs command to only attached USB device)&lt;br /&gt;
adb –e &amp;lt;command&amp;gt; (directs command to only attached emulator)&lt;br /&gt;
Package Installation&lt;br /&gt;
&lt;br /&gt;
adb shell install &amp;lt;apk&amp;gt; (install app)&lt;br /&gt;
adb shell install &amp;lt;path&amp;gt; (install app from phone path)&lt;br /&gt;
adb shell install -r &amp;lt;path&amp;gt; (install app from phone path)&lt;br /&gt;
adb shell uninstall &amp;lt;name&amp;gt; (remove the app)&lt;br /&gt;
Paths&lt;br /&gt;
&lt;br /&gt;
/data/data/&amp;lt;package&amp;gt;/databases (app databases)&lt;br /&gt;
/data/data/&amp;lt;package&amp;gt;/shared_prefs/ (shared preferences)&lt;br /&gt;
/data/app (apk installed by user)&lt;br /&gt;
/system/app (pre-installed APK files)&lt;br /&gt;
/mmt/asec (encrypted apps) (App2SD)&lt;br /&gt;
/mmt/emmc (internal SD Card)&lt;br /&gt;
/mmt/adcard (external/Internal SD Card)&lt;br /&gt;
/mmt/adcard/external_sd (external SD Card)&lt;br /&gt;
&lt;br /&gt;
adb shell ls (list directory contents)&lt;br /&gt;
adb shell ls -s (print size of each file)&lt;br /&gt;
adb shell ls -R (list subdirectories recursively)&lt;br /&gt;
File Operations&lt;br /&gt;
&lt;br /&gt;
adb push &amp;lt;local&amp;gt; &amp;lt;remote&amp;gt; (copy file/dir to device)&lt;br /&gt;
adb pull &amp;lt;remote&amp;gt; &amp;lt;local&amp;gt; (copy file/dir from device)&lt;br /&gt;
run-as &amp;lt;package&amp;gt; cat &amp;lt;file&amp;gt; (access the private package files)&lt;br /&gt;
Phone Info&lt;br /&gt;
&lt;br /&gt;
adb get-statе (print device state)&lt;br /&gt;
adb get-serialno (get the serial number)&lt;br /&gt;
adb shell dumpsys iphonesybinfo (get the IMEI)&lt;br /&gt;
adb shell netstat (list TCP connectivity)&lt;br /&gt;
adb shell pwd (print current working directory)&lt;br /&gt;
adb shell dumpsys battery (battery status)&lt;br /&gt;
adb shell pm list features (list phone features)&lt;br /&gt;
adb shell service list (list all services)&lt;br /&gt;
adb shell dumpsys activity &amp;lt;package&amp;gt;/&amp;lt;activity&amp;gt; (activity info)&lt;br /&gt;
adb shell ps (print process status)&lt;br /&gt;
adb shell wm size (displays the current screen resolution)&lt;br /&gt;
dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp' (print current app's opened activity)&lt;br /&gt;
Package Info&lt;br /&gt;
&lt;br /&gt;
adb shell list packages (list package names)&lt;br /&gt;
adb shell list packages -r (list package name + path to apks)&lt;br /&gt;
adb shell list packages -3 (list third party package names)&lt;br /&gt;
adb shell list packages -s (list only system packages)&lt;br /&gt;
adb shell list packages -u (list package names + uninstalled)&lt;br /&gt;
adb shell dumpsys package packages (list info on all apps)&lt;br /&gt;
adb shell dump &amp;lt;name&amp;gt; (list info on one package)&lt;br /&gt;
adb shell path &amp;lt;package&amp;gt; (path to the apk file)&lt;br /&gt;
Configure Settings Commands&lt;br /&gt;
&lt;br /&gt;
adb shell dumpsys battery set level &amp;lt;n&amp;gt; (change the level from 0 to 100)&lt;br /&gt;
adb shell dumpsys battery set status&amp;lt;n&amp;gt; (change the level to unknown, charging, discharging, not charging or full)&lt;br /&gt;
adb shell dumpsys battery reset (reset the battery)&lt;br /&gt;
adb shell dumpsys battery set usb &amp;lt;n&amp;gt; (change the status of USB connection. ON or OFF)&lt;br /&gt;
adb shell wm size WxH (sets the resolution to WxH)&lt;br /&gt;
Device Related Commands&lt;br /&gt;
&lt;br /&gt;
adb reboot-recovery (reboot device into recovery mode)&lt;br /&gt;
adb reboot fastboot (reboot device into recovery mode)&lt;br /&gt;
adb shell screencap -p &amp;quot;/path/to/screenshot.png&amp;quot; (capture screenshot)&lt;br /&gt;
adb shell screenrecord &amp;quot;/path/to/record.mp4&amp;quot; (record device screen)&lt;br /&gt;
adb backup -apk -all -f backup.ab (backup settings and apps)&lt;br /&gt;
adb backup -apk -shared -all -f backup.ab (backup settings, apps and shared storage)&lt;br /&gt;
adb backup -apk -nosystem -all -f backup.ab (backup only non-system apps)&lt;br /&gt;
adb restore backup.ab (restore a previous backup)&lt;br /&gt;
adb shell am start|startservice|broadcast &amp;lt;INTENT&amp;gt;[&amp;lt;COMPONENT&amp;gt;]&lt;br /&gt;
-a &amp;lt;ACTION&amp;gt; e.g. android.intent.action.VIEW&lt;br /&gt;
-c &amp;lt;CATEGORY&amp;gt; e.g. android.intent.category.LAUNCHER (start activity intent)&lt;br /&gt;
&lt;br /&gt;
adb shell am start -a android.intent.action.VIEW -d URL (open URL)&lt;br /&gt;
adb shell am start -t image/* -a android.intent.action.VIEW (opens gallery)&lt;br /&gt;
Logs&lt;br /&gt;
&lt;br /&gt;
adb logcat [options] [filter] [filter] (view device log)&lt;br /&gt;
adb bugreport (print bug reports)&lt;br /&gt;
Permissions&lt;br /&gt;
&lt;br /&gt;
adb shell permissions groups (list permission groups definitions)&lt;br /&gt;
adb shell list permissions -g -r (list permissions details)&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Bash&amp;diff=1113</id>
		<title>Bash</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Bash&amp;diff=1113"/>
		<updated>2023-05-04T17:38:13Z</updated>

		<summary type="html">&lt;p&gt;Geist: /* BASH USER INFOS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Script ==&lt;br /&gt;
 '''$ type script'''&lt;br /&gt;
 '''$ chmod +x script'''&lt;br /&gt;
 '''$ ./script'''&lt;br /&gt;
 '''$ .script'''&lt;br /&gt;
 '''$ source script'''&lt;br /&gt;
 '''$ bash script'''&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
&lt;br /&gt;
== Command Line ==&lt;br /&gt;
 '''Everything is a file'''&lt;br /&gt;
 '''255 Byte'''&lt;br /&gt;
 The maximum length for a file name is 255 bytes.&lt;br /&gt;
 The maximum combined length of both the file name and path name is 4096 bytes.&lt;br /&gt;
 This length matches the PATH_MAX that is supported by the operating system.&lt;br /&gt;
 '''Names are case-sensitive'''&lt;br /&gt;
&lt;br /&gt;
==== Special chars to avoid in names/filenames ====&lt;br /&gt;
 /   Never&lt;br /&gt;
 \   Escaped&lt;br /&gt;
 -   Never at beginning&lt;br /&gt;
 []  Escaped&lt;br /&gt;
 {}  Escaped&lt;br /&gt;
 *   Escaped&lt;br /&gt;
 '   Escaped&lt;br /&gt;
 &amp;quot;   Escaped&lt;br /&gt;
&lt;br /&gt;
==== Wildcards ====&lt;br /&gt;
 '''*'''  asterisk        | any char&lt;br /&gt;
 '''?'''  question mark   | single char&lt;br /&gt;
 '''[]''' square brackets | set of single char or a range of chars&lt;br /&gt;
&lt;br /&gt;
==== List files and folders ====&lt;br /&gt;
 '''$ ls'''&lt;br /&gt;
 '''$ ls folder'''&lt;br /&gt;
 '''$ ls ./folder'''&lt;br /&gt;
 '''$ ls /path/folder'''&lt;br /&gt;
 '''$ ls ~/folder'''&lt;br /&gt;
 '''$ ls ~/folder/*.jpg'''&lt;br /&gt;
 '''$ ls ~/folder/*txt*'''&lt;br /&gt;
 '''$ ls -R folder''' (list of subfolders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -l''' (single column)&lt;br /&gt;
  '''-''' regular file&lt;br /&gt;
  '''_''' executable&lt;br /&gt;
  '''d''' directory&lt;br /&gt;
  '''l''' symbolic link&lt;br /&gt;
  '''s''' socket&lt;br /&gt;
  '''b''' block device&lt;br /&gt;
  '''c''' character device&lt;br /&gt;
  '''p''' named pipe&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -m''' (comma-separated list)&lt;br /&gt;
 '''$ ls -a''' (hidden files and folders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -F''' (file type)&lt;br /&gt;
 Symbols and file types&lt;br /&gt;
  '''*''' Executable&lt;br /&gt;
  '''/''' Directory&lt;br /&gt;
  '''@''' Symbolic link&lt;br /&gt;
  '''|''' FIFO&lt;br /&gt;
  '''=''' Socket&lt;br /&gt;
&lt;br /&gt;
 '''$ ls --color (content in color)'''&lt;br /&gt;
 '''$ dircolors'''&lt;br /&gt;
 '''$ dircolors --print-database'''&lt;br /&gt;
 '''$ ls -F --color'''&lt;br /&gt;
 '''$ la -la'''&lt;br /&gt;
 '''$ ls -r'''&lt;br /&gt;
 '''$ ls -X''' (sort by extension)&lt;br /&gt;
 '''$ ls -t''' (sort by date)&lt;br /&gt;
 '''$ ls -S''' (sort by content)&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
 '''$ ls -laS'''&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
&lt;br /&gt;
 '''$ pwd''' (current path)&lt;br /&gt;
&lt;br /&gt;
==== Change directory with '''cd'''====&lt;br /&gt;
 '''$ cd folder'''&lt;br /&gt;
 '''$ cd ~'''&lt;br /&gt;
 '''$ cd -'''&lt;br /&gt;
 '''$ cd ..'''&lt;br /&gt;
&lt;br /&gt;
==== Create and change current time of file '''touch'''====&lt;br /&gt;
 create new, empty file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 update access and modification time for file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 any desired time for file&lt;br /&gt;
 '''$ touch -t [[CC]YY]MMDDhhmm[.ss]file'''&lt;br /&gt;
&lt;br /&gt;
==== Create directory with '''mkdir'''====&lt;br /&gt;
 new directory&lt;br /&gt;
 '''$ mkdir folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory with subdirectories&lt;br /&gt;
 '''$ mkdir -p test/sub/folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory and show steps&lt;br /&gt;
 '''$ mkdir -v test/sub/folder'''&lt;br /&gt;
 '''$ mkdir -pv test/sub/folder'''&lt;br /&gt;
 &lt;br /&gt;
== Count files and directories, summary size and '''EXCLUDE''' folders ==&lt;br /&gt;
'''[https://unix.stackexchange.com/q/691703/515538 '''bash count files and directory, summary size and EXCLUDE folders that are fuse|sshfs''']'''&lt;br /&gt;
&lt;br /&gt;
==== Full size of a folder with '''du'''====&lt;br /&gt;
 get the full size of workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs workdir'''&lt;br /&gt;
&lt;br /&gt;
 get the full size of workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs --exclude=mysshf workdir'''&lt;br /&gt;
&lt;br /&gt;
==== Count files in folder with '''find'''====&lt;br /&gt;
 count files in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune -o \( -type f -print \) | wc -l'''&lt;br /&gt;
&lt;br /&gt;
==== Count folders in folder with '''find'''====&lt;br /&gt;
 count folders in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune \( -type d -print \)  | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Building blocks ==&lt;br /&gt;
&lt;br /&gt;
==== run several commands sequentially with ''';''' and '''&amp;amp;&amp;amp;''' ====&lt;br /&gt;
 executed sequential no matter if successfully or unsucessfully&lt;br /&gt;
 ''';'''&lt;br /&gt;
 '''$ ls /home ; ls notfound; ls ~'''&lt;br /&gt;
&lt;br /&gt;
 executed sequential if successfully run next&lt;br /&gt;
 '''&amp;amp;&amp;amp;'''&lt;br /&gt;
 '''$ ls /home &amp;amp;&amp;amp; ls notfound &amp;amp;&amp;amp; ls ~'''&lt;br /&gt;
&lt;br /&gt;
== PORT SCAN with bash's built-in /dev/tcp ==&lt;br /&gt;
'''check if host response on a give port with bash's built-in /dev/tcp'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 HOST_PORT=&amp;quot;80&amp;quot;&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 exit; '''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 for HOST_PORT in {1..1000}&lt;br /&gt;
 do&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 declare -A PORT_ON&lt;br /&gt;
 for HOST_PORT in {1..65535}&lt;br /&gt;
 do&lt;br /&gt;
    if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
        PORT_ON[${HOST_PORT}]=&amp;quot;ON&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
 done&lt;br /&gt;
 for i in ${!PORT_ON[*]}&lt;br /&gt;
 do&lt;br /&gt;
    echo -e &amp;quot;$i : ${PORT_ON[$i]}&amp;quot;&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
== watch ==&lt;br /&gt;
&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo&amp;quot;'''&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
== Firefox bash output ==&lt;br /&gt;
&lt;br /&gt;
 For the usage in bash:&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -d -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
 Load a page and press F5 in the tab(again and again or hold the F5 button pressed) and watch&lt;br /&gt;
 When i kill the a tab with the right pid i get the message in the tab, that the tab is crashed now&lt;br /&gt;
 &lt;br /&gt;
 ''' In Firefox, about:performance'''&lt;br /&gt;
&lt;br /&gt;
 But check also this in bash if i close or open and load a page tab:&lt;br /&gt;
 '''$ pidof firefox'''&lt;br /&gt;
 '''$ pidof firefox-esr'''&lt;br /&gt;
 '''$ pgrep firefox get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
 '''$ pgrep firefox-esr get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
&lt;br /&gt;
 Get parentid and childid&lt;br /&gt;
 '''$ ps aux | grep [f]irefox'''&lt;br /&gt;
 '''$ ps aux | grep [f]irefox | grep tab'''&lt;br /&gt;
&lt;br /&gt;
 You see the parentBuildID and something of the child/tab&lt;br /&gt;
 It looks like that you can't close the child/tab only the parentBuildID, if you kill the child/tab the tab will crash but not close(but killed).&lt;br /&gt;
&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | wc -l'''&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | grep tab | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Create Symbolic Links ==&lt;br /&gt;
 [https://man7.org/linux/man-pages/man1/ln.1.html ln|Linux manual page]&lt;br /&gt;
 ''Symlink To a File''&lt;br /&gt;
 '''$ ln -s [OPTIONS] TARGET LINKNAME'''&lt;br /&gt;
 '''$ ln -s TARGET LINK_NAME''' &lt;br /&gt;
&lt;br /&gt;
 ''Symlinks To a Directory''&lt;br /&gt;
 '''$ ln -s /mnt/my_drive/movies ~/my_movies '''&lt;br /&gt;
&lt;br /&gt;
 ''Overwriting Symlinks''&lt;br /&gt;
 ''To overwrite the destination path of the symlink, use the -f (--force) option''&lt;br /&gt;
 '''$ ln -sf my_file.txt my_link.txt'''&lt;br /&gt;
&lt;br /&gt;
 ''Removing Symlinks ''&lt;br /&gt;
 '''$ unlink symlink_to_remove'''&lt;br /&gt;
 '''$ rm symlink_to_remove'''&lt;br /&gt;
&lt;br /&gt;
== List harddisk|usb|volume|partitions  ==&lt;br /&gt;
 ''Get label names:''&lt;br /&gt;
 '''$ e2label /dev/sdXx '''&lt;br /&gt;
 '''$ /sbin/blkid | grep sdXx''''&lt;br /&gt;
 '''$ blkid /dev/sdXx | awk -F'&amp;quot;' '{print $2}''''&lt;br /&gt;
&lt;br /&gt;
 ''Set label name:''&lt;br /&gt;
 '''$ e2label /dev/sdXx MYNAME'''&lt;br /&gt;
 '''$ tune2fs -L MYNAME /dev/sdXx '''&lt;br /&gt;
&lt;br /&gt;
== Create filesystem with '''mkfs.ext4'''  ==&lt;br /&gt;
 '''$ mkfs.ext4 /dev/sda1 -L MYNAME'''&lt;br /&gt;
&lt;br /&gt;
== Create/Add new USER '''useradd'''==&lt;br /&gt;
 Useradd is built-in Linux command that can be found on any Linux system. However, creating new users with this low-level is a tedious task because it doesn't create the home directory and user password by default.&lt;br /&gt;
&lt;br /&gt;
 Adduser is not a standard Linux command. It’s essentially a Perl script that uses the useradd command in the background. This high-level utility  is more efficient in properly creating new users on Linux. It gives you the option to create the home directory, and set password along with a few more parameters.&lt;br /&gt;
&lt;br /&gt;
 [https://linuxhandbook.com/useradd-vs-adduser/ Difference between adduser and useradd commands]&lt;br /&gt;
 [https://linuxconfig.org/add-user-linux-command adduser vs useradd in Linux] &lt;br /&gt;
&lt;br /&gt;
 '''$ useradd [OPTIONS] USERNAME'''&lt;br /&gt;
&lt;br /&gt;
 '''$ cat /etc/default/useradd'''&lt;br /&gt;
 '''$ ls -la /etc/skel/'''&lt;br /&gt;
 '''$ cat /etc/login.defs'''&lt;br /&gt;
&lt;br /&gt;
 View default options:&lt;br /&gt;
 '''$ useradd -D '''&lt;br /&gt;
&lt;br /&gt;
 Change the default login shell&lt;br /&gt;
 '''$ useradd -D -s /bin/bash '''&lt;br /&gt;
 '''$ useradd -D | grep -i shell '''&lt;br /&gt;
&lt;br /&gt;
 To create a user without home directory&lt;br /&gt;
 '''$ useradd -M user '''&lt;br /&gt;
&lt;br /&gt;
 Create a user with changed login shell &lt;br /&gt;
 '''$ useradd -s /bin/sh user '''&lt;br /&gt;
&lt;br /&gt;
 Option to create a user home directory &lt;br /&gt;
 '''--create-home'''&lt;br /&gt;
 '''-m '''&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -m -u 10000 USERNAME -s /bin/bash '''&lt;br /&gt;
&lt;br /&gt;
 There is an option for adding an encrypted password via the '''-p''' option on useradd&lt;br /&gt;
 Note that the '''-p''' option '''doesn't allow you to input a plaintext password''', it expects you to  encrypt it first. &lt;br /&gt;
 This is intentionally difficult, because you should not do it! &lt;br /&gt;
 Just use the '''passwd''' command or '''chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 '''passwd USER'''&lt;br /&gt;
 or&lt;br /&gt;
 '''echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 [https://stackoverflow.com/questions/2150882/how-to-automatically-add-user-account-and-password-with-a-bash-script How to automatically add user account AND password with a Bash script?]&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER'''&lt;br /&gt;
 Create USER + Homedirectory + Bash as Shell&lt;br /&gt;
&lt;br /&gt;
 USER+HOME+SHELL+PASSWORD&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER &amp;amp;&amp;amp; echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
== Delete USER '''userdel'''==&lt;br /&gt;
 '''$ userdel [OPTIONS] USERNAME '''&lt;br /&gt;
&lt;br /&gt;
 Use the -r (--remove) option to force userdel to remove the user’s home directory and mail spool:&lt;br /&gt;
 '''$ userdel -r username '''&lt;br /&gt;
&lt;br /&gt;
 Kill all user’s running processes&lt;br /&gt;
 '''$ killall -u username '''&lt;br /&gt;
&lt;br /&gt;
 Another option is to use the -f (--force) option that tells userdel to forcefully remove the user account, even if the user is still logged in or if there are running processes that belong to the user.&lt;br /&gt;
 '''$ userdel -f username '''&lt;br /&gt;
&lt;br /&gt;
[https://linuxize.com/post/how-to-delete-users-in-linux-using-the-userdel-command/ How to Delete/Remove Users in Linux (userdel Command)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''usermod'''==&lt;br /&gt;
&lt;br /&gt;
https://linuxize.com/post/usermod-command-in-linux/#:~:text=By%20default%2C%20on%20most%20Linux%20systems%2C%20the%20default,name%20of%20the%20user%3A%20usermod%20-s%20SHELL%20USER&lt;br /&gt;
&lt;br /&gt;
https://linuxconfig.org/usermod#:~:text=usermod%20command%20in%20Linux%20Advanced%20Examples%201%20Use,given%20a%20unique%20ID%20when%20first%20created.%20&lt;br /&gt;
&lt;br /&gt;
https://wiki.ubuntuusers.de/usermod/&lt;br /&gt;
&lt;br /&gt;
== '''GROUP, USER | GROUP VS PASSWD''' ==&lt;br /&gt;
&lt;br /&gt;
 https://teaching.idallen.com/cst8207/12f/notes/600_users_and_groups.html&lt;br /&gt;
&lt;br /&gt;
 https://www.unix.com/unix-for-dummies-questions-and-answers/162563-inconsistency-between-passwd-group.html&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/55107/why-dont-etc-group-and-etc-password-match&lt;br /&gt;
&lt;br /&gt;
 https://www.man7.org/linux/man-pages/man3/initgroups.3.html&lt;br /&gt;
&lt;br /&gt;
== chown ==&lt;br /&gt;
&lt;br /&gt;
 https://wiki.ubuntuusers.de/chown/&lt;br /&gt;
&lt;br /&gt;
== chmod ==&lt;br /&gt;
&lt;br /&gt;
 https://wiki.ubuntuusers.de/chmod/&lt;br /&gt;
&lt;br /&gt;
== chattr ==&lt;br /&gt;
 &lt;br /&gt;
 https://wiki.ubuntuusers.de/chattr/&lt;br /&gt;
&lt;br /&gt;
 https://man7.org/linux/man-pages/man1/chattr.1.html&lt;br /&gt;
&lt;br /&gt;
== SHELL USER INFOS ==&lt;br /&gt;
&lt;br /&gt;
 '''getent passwd &amp;quot;$LOGNAME&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
 '''grep passwd /etc/nsswitch.conf'''&lt;br /&gt;
&lt;br /&gt;
== rbash | Restricted Bash ==&lt;br /&gt;
 '''$ rbash '''&lt;br /&gt;
 '''$ bash -r'''&lt;br /&gt;
&lt;br /&gt;
 https://www.tecmint.com/rbash-a-restricted-bash-shell-explained-with-practical-examples/&lt;br /&gt;
 https://www.thegeekdiary.com/rbash-set-restricted-shell-in-linux/&lt;br /&gt;
&lt;br /&gt;
 https://www.howtogeek.com/718074/how-to-use-restricted-shell-to-limit-what-a-linux-user-cando/&lt;br /&gt;
 https://ostechnix.com/how-to-limit-users-access-to-the-linux-system/&lt;br /&gt;
 https://averagelinuxuser.com/creating-new-user-linux/&lt;br /&gt;
 https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/&lt;br /&gt;
 https://www.howtoforge.com/user_password_creating_with_a_bash_script&lt;br /&gt;
&lt;br /&gt;
== Simple Script Jail ==&lt;br /&gt;
&lt;br /&gt;
 This is are the default settings for the USER to login and run a bash shell:&lt;br /&gt;
 '''$  chsh -s /bin/bash [USER] ''' &lt;br /&gt;
 &lt;br /&gt;
 This for the simple jail:&lt;br /&gt;
 '''$ chsh -s /home/[USER]/./run [USER] '''&lt;br /&gt;
&lt;br /&gt;
== Disable history ==&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-bash-shell-commands-history-on-linux&lt;br /&gt;
 https://www.cyberciti.biz/faq/disable-bash-shell-history-linux/&lt;br /&gt;
 https://www.thegeeksearch.com/how-to-disable-and-clear-linux-command-line-history/&lt;br /&gt;
&lt;br /&gt;
== Disable LASTLOGIN ==&lt;br /&gt;
 '''$ touch /home/user/.hushlogin'''&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-last-login-message-on-rhel-linux&lt;br /&gt;
 https://www.heatware.net/linux-unix/linux-how-to-disable-last-login-welcome-message/&lt;br /&gt;
&lt;br /&gt;
== type | command check ==&lt;br /&gt;
&lt;br /&gt;
 Check whether a command is built-in or not&lt;br /&gt;
 '''$ type [COMMAND]'''&lt;br /&gt;
&lt;br /&gt;
== RANDOM NUMBERS ==&lt;br /&gt;
 '''$ echo $RANDOM'''&lt;br /&gt;
 '''$ echo $(( $RANDOM % 9 + 0 ))'''&lt;br /&gt;
&lt;br /&gt;
 '''$ echo $(shuf -i 0-9 -n1)'''&lt;br /&gt;
&lt;br /&gt;
 '''$ od /dev/urandom  -A n -t d -N 1 '''&lt;br /&gt;
&lt;br /&gt;
 https://linuxhint.com/generate-random-number-bash/&lt;br /&gt;
 https://linuxconfig.org/generating-random-numbers-in-bash-with-examples&lt;br /&gt;
 https://www.delftstack.com/howto/linux/random-number-generation-in-bash/&lt;br /&gt;
&lt;br /&gt;
== RANDOM STRINGS ==&lt;br /&gt;
 '''$ echo $RANDOM | md5sum | head -c 1; echo; ''' &lt;br /&gt;
 '''$ tr -dc A-Za-z0-9 &amp;lt;/dev/urandom | head -c 1 ; echo ' ' '''&lt;br /&gt;
&lt;br /&gt;
 https://gist.github.com/earthgecko/3089509&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/230673/how-to-generate-a-random-string&lt;br /&gt;
 https://linuxhint.com/generate-random-string-bash/&lt;br /&gt;
 https://www.saotn.org/bash-function-to-generate-a-random-alphanumeric-string/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/a/709895/515538&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Bash&amp;diff=1112</id>
		<title>Bash</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Bash&amp;diff=1112"/>
		<updated>2023-05-04T17:37:59Z</updated>

		<summary type="html">&lt;p&gt;Geist: /* BASH USER INFIS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Script ==&lt;br /&gt;
 '''$ type script'''&lt;br /&gt;
 '''$ chmod +x script'''&lt;br /&gt;
 '''$ ./script'''&lt;br /&gt;
 '''$ .script'''&lt;br /&gt;
 '''$ source script'''&lt;br /&gt;
 '''$ bash script'''&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
&lt;br /&gt;
== Command Line ==&lt;br /&gt;
 '''Everything is a file'''&lt;br /&gt;
 '''255 Byte'''&lt;br /&gt;
 The maximum length for a file name is 255 bytes.&lt;br /&gt;
 The maximum combined length of both the file name and path name is 4096 bytes.&lt;br /&gt;
 This length matches the PATH_MAX that is supported by the operating system.&lt;br /&gt;
 '''Names are case-sensitive'''&lt;br /&gt;
&lt;br /&gt;
==== Special chars to avoid in names/filenames ====&lt;br /&gt;
 /   Never&lt;br /&gt;
 \   Escaped&lt;br /&gt;
 -   Never at beginning&lt;br /&gt;
 []  Escaped&lt;br /&gt;
 {}  Escaped&lt;br /&gt;
 *   Escaped&lt;br /&gt;
 '   Escaped&lt;br /&gt;
 &amp;quot;   Escaped&lt;br /&gt;
&lt;br /&gt;
==== Wildcards ====&lt;br /&gt;
 '''*'''  asterisk        | any char&lt;br /&gt;
 '''?'''  question mark   | single char&lt;br /&gt;
 '''[]''' square brackets | set of single char or a range of chars&lt;br /&gt;
&lt;br /&gt;
==== List files and folders ====&lt;br /&gt;
 '''$ ls'''&lt;br /&gt;
 '''$ ls folder'''&lt;br /&gt;
 '''$ ls ./folder'''&lt;br /&gt;
 '''$ ls /path/folder'''&lt;br /&gt;
 '''$ ls ~/folder'''&lt;br /&gt;
 '''$ ls ~/folder/*.jpg'''&lt;br /&gt;
 '''$ ls ~/folder/*txt*'''&lt;br /&gt;
 '''$ ls -R folder''' (list of subfolders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -l''' (single column)&lt;br /&gt;
  '''-''' regular file&lt;br /&gt;
  '''_''' executable&lt;br /&gt;
  '''d''' directory&lt;br /&gt;
  '''l''' symbolic link&lt;br /&gt;
  '''s''' socket&lt;br /&gt;
  '''b''' block device&lt;br /&gt;
  '''c''' character device&lt;br /&gt;
  '''p''' named pipe&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -m''' (comma-separated list)&lt;br /&gt;
 '''$ ls -a''' (hidden files and folders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -F''' (file type)&lt;br /&gt;
 Symbols and file types&lt;br /&gt;
  '''*''' Executable&lt;br /&gt;
  '''/''' Directory&lt;br /&gt;
  '''@''' Symbolic link&lt;br /&gt;
  '''|''' FIFO&lt;br /&gt;
  '''=''' Socket&lt;br /&gt;
&lt;br /&gt;
 '''$ ls --color (content in color)'''&lt;br /&gt;
 '''$ dircolors'''&lt;br /&gt;
 '''$ dircolors --print-database'''&lt;br /&gt;
 '''$ ls -F --color'''&lt;br /&gt;
 '''$ la -la'''&lt;br /&gt;
 '''$ ls -r'''&lt;br /&gt;
 '''$ ls -X''' (sort by extension)&lt;br /&gt;
 '''$ ls -t''' (sort by date)&lt;br /&gt;
 '''$ ls -S''' (sort by content)&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
 '''$ ls -laS'''&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
&lt;br /&gt;
 '''$ pwd''' (current path)&lt;br /&gt;
&lt;br /&gt;
==== Change directory with '''cd'''====&lt;br /&gt;
 '''$ cd folder'''&lt;br /&gt;
 '''$ cd ~'''&lt;br /&gt;
 '''$ cd -'''&lt;br /&gt;
 '''$ cd ..'''&lt;br /&gt;
&lt;br /&gt;
==== Create and change current time of file '''touch'''====&lt;br /&gt;
 create new, empty file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 update access and modification time for file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 any desired time for file&lt;br /&gt;
 '''$ touch -t [[CC]YY]MMDDhhmm[.ss]file'''&lt;br /&gt;
&lt;br /&gt;
==== Create directory with '''mkdir'''====&lt;br /&gt;
 new directory&lt;br /&gt;
 '''$ mkdir folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory with subdirectories&lt;br /&gt;
 '''$ mkdir -p test/sub/folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory and show steps&lt;br /&gt;
 '''$ mkdir -v test/sub/folder'''&lt;br /&gt;
 '''$ mkdir -pv test/sub/folder'''&lt;br /&gt;
 &lt;br /&gt;
== Count files and directories, summary size and '''EXCLUDE''' folders ==&lt;br /&gt;
'''[https://unix.stackexchange.com/q/691703/515538 '''bash count files and directory, summary size and EXCLUDE folders that are fuse|sshfs''']'''&lt;br /&gt;
&lt;br /&gt;
==== Full size of a folder with '''du'''====&lt;br /&gt;
 get the full size of workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs workdir'''&lt;br /&gt;
&lt;br /&gt;
 get the full size of workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs --exclude=mysshf workdir'''&lt;br /&gt;
&lt;br /&gt;
==== Count files in folder with '''find'''====&lt;br /&gt;
 count files in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune -o \( -type f -print \) | wc -l'''&lt;br /&gt;
&lt;br /&gt;
==== Count folders in folder with '''find'''====&lt;br /&gt;
 count folders in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune \( -type d -print \)  | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Building blocks ==&lt;br /&gt;
&lt;br /&gt;
==== run several commands sequentially with ''';''' and '''&amp;amp;&amp;amp;''' ====&lt;br /&gt;
 executed sequential no matter if successfully or unsucessfully&lt;br /&gt;
 ''';'''&lt;br /&gt;
 '''$ ls /home ; ls notfound; ls ~'''&lt;br /&gt;
&lt;br /&gt;
 executed sequential if successfully run next&lt;br /&gt;
 '''&amp;amp;&amp;amp;'''&lt;br /&gt;
 '''$ ls /home &amp;amp;&amp;amp; ls notfound &amp;amp;&amp;amp; ls ~'''&lt;br /&gt;
&lt;br /&gt;
== PORT SCAN with bash's built-in /dev/tcp ==&lt;br /&gt;
'''check if host response on a give port with bash's built-in /dev/tcp'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 HOST_PORT=&amp;quot;80&amp;quot;&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 exit; '''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 for HOST_PORT in {1..1000}&lt;br /&gt;
 do&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 declare -A PORT_ON&lt;br /&gt;
 for HOST_PORT in {1..65535}&lt;br /&gt;
 do&lt;br /&gt;
    if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
        PORT_ON[${HOST_PORT}]=&amp;quot;ON&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
 done&lt;br /&gt;
 for i in ${!PORT_ON[*]}&lt;br /&gt;
 do&lt;br /&gt;
    echo -e &amp;quot;$i : ${PORT_ON[$i]}&amp;quot;&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
== watch ==&lt;br /&gt;
&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo&amp;quot;'''&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
== Firefox bash output ==&lt;br /&gt;
&lt;br /&gt;
 For the usage in bash:&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -d -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
 Load a page and press F5 in the tab(again and again or hold the F5 button pressed) and watch&lt;br /&gt;
 When i kill the a tab with the right pid i get the message in the tab, that the tab is crashed now&lt;br /&gt;
 &lt;br /&gt;
 ''' In Firefox, about:performance'''&lt;br /&gt;
&lt;br /&gt;
 But check also this in bash if i close or open and load a page tab:&lt;br /&gt;
 '''$ pidof firefox'''&lt;br /&gt;
 '''$ pidof firefox-esr'''&lt;br /&gt;
 '''$ pgrep firefox get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
 '''$ pgrep firefox-esr get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
&lt;br /&gt;
 Get parentid and childid&lt;br /&gt;
 '''$ ps aux | grep [f]irefox'''&lt;br /&gt;
 '''$ ps aux | grep [f]irefox | grep tab'''&lt;br /&gt;
&lt;br /&gt;
 You see the parentBuildID and something of the child/tab&lt;br /&gt;
 It looks like that you can't close the child/tab only the parentBuildID, if you kill the child/tab the tab will crash but not close(but killed).&lt;br /&gt;
&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | wc -l'''&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | grep tab | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Create Symbolic Links ==&lt;br /&gt;
 [https://man7.org/linux/man-pages/man1/ln.1.html ln|Linux manual page]&lt;br /&gt;
 ''Symlink To a File''&lt;br /&gt;
 '''$ ln -s [OPTIONS] TARGET LINKNAME'''&lt;br /&gt;
 '''$ ln -s TARGET LINK_NAME''' &lt;br /&gt;
&lt;br /&gt;
 ''Symlinks To a Directory''&lt;br /&gt;
 '''$ ln -s /mnt/my_drive/movies ~/my_movies '''&lt;br /&gt;
&lt;br /&gt;
 ''Overwriting Symlinks''&lt;br /&gt;
 ''To overwrite the destination path of the symlink, use the -f (--force) option''&lt;br /&gt;
 '''$ ln -sf my_file.txt my_link.txt'''&lt;br /&gt;
&lt;br /&gt;
 ''Removing Symlinks ''&lt;br /&gt;
 '''$ unlink symlink_to_remove'''&lt;br /&gt;
 '''$ rm symlink_to_remove'''&lt;br /&gt;
&lt;br /&gt;
== List harddisk|usb|volume|partitions  ==&lt;br /&gt;
 ''Get label names:''&lt;br /&gt;
 '''$ e2label /dev/sdXx '''&lt;br /&gt;
 '''$ /sbin/blkid | grep sdXx''''&lt;br /&gt;
 '''$ blkid /dev/sdXx | awk -F'&amp;quot;' '{print $2}''''&lt;br /&gt;
&lt;br /&gt;
 ''Set label name:''&lt;br /&gt;
 '''$ e2label /dev/sdXx MYNAME'''&lt;br /&gt;
 '''$ tune2fs -L MYNAME /dev/sdXx '''&lt;br /&gt;
&lt;br /&gt;
== Create filesystem with '''mkfs.ext4'''  ==&lt;br /&gt;
 '''$ mkfs.ext4 /dev/sda1 -L MYNAME'''&lt;br /&gt;
&lt;br /&gt;
== Create/Add new USER '''useradd'''==&lt;br /&gt;
 Useradd is built-in Linux command that can be found on any Linux system. However, creating new users with this low-level is a tedious task because it doesn't create the home directory and user password by default.&lt;br /&gt;
&lt;br /&gt;
 Adduser is not a standard Linux command. It’s essentially a Perl script that uses the useradd command in the background. This high-level utility  is more efficient in properly creating new users on Linux. It gives you the option to create the home directory, and set password along with a few more parameters.&lt;br /&gt;
&lt;br /&gt;
 [https://linuxhandbook.com/useradd-vs-adduser/ Difference between adduser and useradd commands]&lt;br /&gt;
 [https://linuxconfig.org/add-user-linux-command adduser vs useradd in Linux] &lt;br /&gt;
&lt;br /&gt;
 '''$ useradd [OPTIONS] USERNAME'''&lt;br /&gt;
&lt;br /&gt;
 '''$ cat /etc/default/useradd'''&lt;br /&gt;
 '''$ ls -la /etc/skel/'''&lt;br /&gt;
 '''$ cat /etc/login.defs'''&lt;br /&gt;
&lt;br /&gt;
 View default options:&lt;br /&gt;
 '''$ useradd -D '''&lt;br /&gt;
&lt;br /&gt;
 Change the default login shell&lt;br /&gt;
 '''$ useradd -D -s /bin/bash '''&lt;br /&gt;
 '''$ useradd -D | grep -i shell '''&lt;br /&gt;
&lt;br /&gt;
 To create a user without home directory&lt;br /&gt;
 '''$ useradd -M user '''&lt;br /&gt;
&lt;br /&gt;
 Create a user with changed login shell &lt;br /&gt;
 '''$ useradd -s /bin/sh user '''&lt;br /&gt;
&lt;br /&gt;
 Option to create a user home directory &lt;br /&gt;
 '''--create-home'''&lt;br /&gt;
 '''-m '''&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -m -u 10000 USERNAME -s /bin/bash '''&lt;br /&gt;
&lt;br /&gt;
 There is an option for adding an encrypted password via the '''-p''' option on useradd&lt;br /&gt;
 Note that the '''-p''' option '''doesn't allow you to input a plaintext password''', it expects you to  encrypt it first. &lt;br /&gt;
 This is intentionally difficult, because you should not do it! &lt;br /&gt;
 Just use the '''passwd''' command or '''chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 '''passwd USER'''&lt;br /&gt;
 or&lt;br /&gt;
 '''echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 [https://stackoverflow.com/questions/2150882/how-to-automatically-add-user-account-and-password-with-a-bash-script How to automatically add user account AND password with a Bash script?]&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER'''&lt;br /&gt;
 Create USER + Homedirectory + Bash as Shell&lt;br /&gt;
&lt;br /&gt;
 USER+HOME+SHELL+PASSWORD&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER &amp;amp;&amp;amp; echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
== Delete USER '''userdel'''==&lt;br /&gt;
 '''$ userdel [OPTIONS] USERNAME '''&lt;br /&gt;
&lt;br /&gt;
 Use the -r (--remove) option to force userdel to remove the user’s home directory and mail spool:&lt;br /&gt;
 '''$ userdel -r username '''&lt;br /&gt;
&lt;br /&gt;
 Kill all user’s running processes&lt;br /&gt;
 '''$ killall -u username '''&lt;br /&gt;
&lt;br /&gt;
 Another option is to use the -f (--force) option that tells userdel to forcefully remove the user account, even if the user is still logged in or if there are running processes that belong to the user.&lt;br /&gt;
 '''$ userdel -f username '''&lt;br /&gt;
&lt;br /&gt;
[https://linuxize.com/post/how-to-delete-users-in-linux-using-the-userdel-command/ How to Delete/Remove Users in Linux (userdel Command)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''usermod'''==&lt;br /&gt;
&lt;br /&gt;
https://linuxize.com/post/usermod-command-in-linux/#:~:text=By%20default%2C%20on%20most%20Linux%20systems%2C%20the%20default,name%20of%20the%20user%3A%20usermod%20-s%20SHELL%20USER&lt;br /&gt;
&lt;br /&gt;
https://linuxconfig.org/usermod#:~:text=usermod%20command%20in%20Linux%20Advanced%20Examples%201%20Use,given%20a%20unique%20ID%20when%20first%20created.%20&lt;br /&gt;
&lt;br /&gt;
https://wiki.ubuntuusers.de/usermod/&lt;br /&gt;
&lt;br /&gt;
== '''GROUP, USER | GROUP VS PASSWD''' ==&lt;br /&gt;
&lt;br /&gt;
 https://teaching.idallen.com/cst8207/12f/notes/600_users_and_groups.html&lt;br /&gt;
&lt;br /&gt;
 https://www.unix.com/unix-for-dummies-questions-and-answers/162563-inconsistency-between-passwd-group.html&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/55107/why-dont-etc-group-and-etc-password-match&lt;br /&gt;
&lt;br /&gt;
 https://www.man7.org/linux/man-pages/man3/initgroups.3.html&lt;br /&gt;
&lt;br /&gt;
== chown ==&lt;br /&gt;
&lt;br /&gt;
 https://wiki.ubuntuusers.de/chown/&lt;br /&gt;
&lt;br /&gt;
== chmod ==&lt;br /&gt;
&lt;br /&gt;
 https://wiki.ubuntuusers.de/chmod/&lt;br /&gt;
&lt;br /&gt;
== chattr ==&lt;br /&gt;
 &lt;br /&gt;
 https://wiki.ubuntuusers.de/chattr/&lt;br /&gt;
&lt;br /&gt;
 https://man7.org/linux/man-pages/man1/chattr.1.html&lt;br /&gt;
&lt;br /&gt;
== BASH USER INFOS ==&lt;br /&gt;
&lt;br /&gt;
 '''getent passwd &amp;quot;$LOGNAME&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
 '''grep passwd /etc/nsswitch.conf'''&lt;br /&gt;
&lt;br /&gt;
== rbash | Restricted Bash ==&lt;br /&gt;
 '''$ rbash '''&lt;br /&gt;
 '''$ bash -r'''&lt;br /&gt;
&lt;br /&gt;
 https://www.tecmint.com/rbash-a-restricted-bash-shell-explained-with-practical-examples/&lt;br /&gt;
 https://www.thegeekdiary.com/rbash-set-restricted-shell-in-linux/&lt;br /&gt;
&lt;br /&gt;
 https://www.howtogeek.com/718074/how-to-use-restricted-shell-to-limit-what-a-linux-user-cando/&lt;br /&gt;
 https://ostechnix.com/how-to-limit-users-access-to-the-linux-system/&lt;br /&gt;
 https://averagelinuxuser.com/creating-new-user-linux/&lt;br /&gt;
 https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/&lt;br /&gt;
 https://www.howtoforge.com/user_password_creating_with_a_bash_script&lt;br /&gt;
&lt;br /&gt;
== Simple Script Jail ==&lt;br /&gt;
&lt;br /&gt;
 This is are the default settings for the USER to login and run a bash shell:&lt;br /&gt;
 '''$  chsh -s /bin/bash [USER] ''' &lt;br /&gt;
 &lt;br /&gt;
 This for the simple jail:&lt;br /&gt;
 '''$ chsh -s /home/[USER]/./run [USER] '''&lt;br /&gt;
&lt;br /&gt;
== Disable history ==&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-bash-shell-commands-history-on-linux&lt;br /&gt;
 https://www.cyberciti.biz/faq/disable-bash-shell-history-linux/&lt;br /&gt;
 https://www.thegeeksearch.com/how-to-disable-and-clear-linux-command-line-history/&lt;br /&gt;
&lt;br /&gt;
== Disable LASTLOGIN ==&lt;br /&gt;
 '''$ touch /home/user/.hushlogin'''&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-last-login-message-on-rhel-linux&lt;br /&gt;
 https://www.heatware.net/linux-unix/linux-how-to-disable-last-login-welcome-message/&lt;br /&gt;
&lt;br /&gt;
== type | command check ==&lt;br /&gt;
&lt;br /&gt;
 Check whether a command is built-in or not&lt;br /&gt;
 '''$ type [COMMAND]'''&lt;br /&gt;
&lt;br /&gt;
== RANDOM NUMBERS ==&lt;br /&gt;
 '''$ echo $RANDOM'''&lt;br /&gt;
 '''$ echo $(( $RANDOM % 9 + 0 ))'''&lt;br /&gt;
&lt;br /&gt;
 '''$ echo $(shuf -i 0-9 -n1)'''&lt;br /&gt;
&lt;br /&gt;
 '''$ od /dev/urandom  -A n -t d -N 1 '''&lt;br /&gt;
&lt;br /&gt;
 https://linuxhint.com/generate-random-number-bash/&lt;br /&gt;
 https://linuxconfig.org/generating-random-numbers-in-bash-with-examples&lt;br /&gt;
 https://www.delftstack.com/howto/linux/random-number-generation-in-bash/&lt;br /&gt;
&lt;br /&gt;
== RANDOM STRINGS ==&lt;br /&gt;
 '''$ echo $RANDOM | md5sum | head -c 1; echo; ''' &lt;br /&gt;
 '''$ tr -dc A-Za-z0-9 &amp;lt;/dev/urandom | head -c 1 ; echo ' ' '''&lt;br /&gt;
&lt;br /&gt;
 https://gist.github.com/earthgecko/3089509&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/230673/how-to-generate-a-random-string&lt;br /&gt;
 https://linuxhint.com/generate-random-string-bash/&lt;br /&gt;
 https://www.saotn.org/bash-function-to-generate-a-random-alphanumeric-string/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/a/709895/515538&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Bash&amp;diff=1111</id>
		<title>Bash</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Bash&amp;diff=1111"/>
		<updated>2023-05-04T17:37:48Z</updated>

		<summary type="html">&lt;p&gt;Geist: /* chattr */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Script ==&lt;br /&gt;
 '''$ type script'''&lt;br /&gt;
 '''$ chmod +x script'''&lt;br /&gt;
 '''$ ./script'''&lt;br /&gt;
 '''$ .script'''&lt;br /&gt;
 '''$ source script'''&lt;br /&gt;
 '''$ bash script'''&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
&lt;br /&gt;
== Command Line ==&lt;br /&gt;
 '''Everything is a file'''&lt;br /&gt;
 '''255 Byte'''&lt;br /&gt;
 The maximum length for a file name is 255 bytes.&lt;br /&gt;
 The maximum combined length of both the file name and path name is 4096 bytes.&lt;br /&gt;
 This length matches the PATH_MAX that is supported by the operating system.&lt;br /&gt;
 '''Names are case-sensitive'''&lt;br /&gt;
&lt;br /&gt;
==== Special chars to avoid in names/filenames ====&lt;br /&gt;
 /   Never&lt;br /&gt;
 \   Escaped&lt;br /&gt;
 -   Never at beginning&lt;br /&gt;
 []  Escaped&lt;br /&gt;
 {}  Escaped&lt;br /&gt;
 *   Escaped&lt;br /&gt;
 '   Escaped&lt;br /&gt;
 &amp;quot;   Escaped&lt;br /&gt;
&lt;br /&gt;
==== Wildcards ====&lt;br /&gt;
 '''*'''  asterisk        | any char&lt;br /&gt;
 '''?'''  question mark   | single char&lt;br /&gt;
 '''[]''' square brackets | set of single char or a range of chars&lt;br /&gt;
&lt;br /&gt;
==== List files and folders ====&lt;br /&gt;
 '''$ ls'''&lt;br /&gt;
 '''$ ls folder'''&lt;br /&gt;
 '''$ ls ./folder'''&lt;br /&gt;
 '''$ ls /path/folder'''&lt;br /&gt;
 '''$ ls ~/folder'''&lt;br /&gt;
 '''$ ls ~/folder/*.jpg'''&lt;br /&gt;
 '''$ ls ~/folder/*txt*'''&lt;br /&gt;
 '''$ ls -R folder''' (list of subfolders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -l''' (single column)&lt;br /&gt;
  '''-''' regular file&lt;br /&gt;
  '''_''' executable&lt;br /&gt;
  '''d''' directory&lt;br /&gt;
  '''l''' symbolic link&lt;br /&gt;
  '''s''' socket&lt;br /&gt;
  '''b''' block device&lt;br /&gt;
  '''c''' character device&lt;br /&gt;
  '''p''' named pipe&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -m''' (comma-separated list)&lt;br /&gt;
 '''$ ls -a''' (hidden files and folders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -F''' (file type)&lt;br /&gt;
 Symbols and file types&lt;br /&gt;
  '''*''' Executable&lt;br /&gt;
  '''/''' Directory&lt;br /&gt;
  '''@''' Symbolic link&lt;br /&gt;
  '''|''' FIFO&lt;br /&gt;
  '''=''' Socket&lt;br /&gt;
&lt;br /&gt;
 '''$ ls --color (content in color)'''&lt;br /&gt;
 '''$ dircolors'''&lt;br /&gt;
 '''$ dircolors --print-database'''&lt;br /&gt;
 '''$ ls -F --color'''&lt;br /&gt;
 '''$ la -la'''&lt;br /&gt;
 '''$ ls -r'''&lt;br /&gt;
 '''$ ls -X''' (sort by extension)&lt;br /&gt;
 '''$ ls -t''' (sort by date)&lt;br /&gt;
 '''$ ls -S''' (sort by content)&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
 '''$ ls -laS'''&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
&lt;br /&gt;
 '''$ pwd''' (current path)&lt;br /&gt;
&lt;br /&gt;
==== Change directory with '''cd'''====&lt;br /&gt;
 '''$ cd folder'''&lt;br /&gt;
 '''$ cd ~'''&lt;br /&gt;
 '''$ cd -'''&lt;br /&gt;
 '''$ cd ..'''&lt;br /&gt;
&lt;br /&gt;
==== Create and change current time of file '''touch'''====&lt;br /&gt;
 create new, empty file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 update access and modification time for file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 any desired time for file&lt;br /&gt;
 '''$ touch -t [[CC]YY]MMDDhhmm[.ss]file'''&lt;br /&gt;
&lt;br /&gt;
==== Create directory with '''mkdir'''====&lt;br /&gt;
 new directory&lt;br /&gt;
 '''$ mkdir folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory with subdirectories&lt;br /&gt;
 '''$ mkdir -p test/sub/folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory and show steps&lt;br /&gt;
 '''$ mkdir -v test/sub/folder'''&lt;br /&gt;
 '''$ mkdir -pv test/sub/folder'''&lt;br /&gt;
 &lt;br /&gt;
== Count files and directories, summary size and '''EXCLUDE''' folders ==&lt;br /&gt;
'''[https://unix.stackexchange.com/q/691703/515538 '''bash count files and directory, summary size and EXCLUDE folders that are fuse|sshfs''']'''&lt;br /&gt;
&lt;br /&gt;
==== Full size of a folder with '''du'''====&lt;br /&gt;
 get the full size of workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs workdir'''&lt;br /&gt;
&lt;br /&gt;
 get the full size of workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs --exclude=mysshf workdir'''&lt;br /&gt;
&lt;br /&gt;
==== Count files in folder with '''find'''====&lt;br /&gt;
 count files in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune -o \( -type f -print \) | wc -l'''&lt;br /&gt;
&lt;br /&gt;
==== Count folders in folder with '''find'''====&lt;br /&gt;
 count folders in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune \( -type d -print \)  | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Building blocks ==&lt;br /&gt;
&lt;br /&gt;
==== run several commands sequentially with ''';''' and '''&amp;amp;&amp;amp;''' ====&lt;br /&gt;
 executed sequential no matter if successfully or unsucessfully&lt;br /&gt;
 ''';'''&lt;br /&gt;
 '''$ ls /home ; ls notfound; ls ~'''&lt;br /&gt;
&lt;br /&gt;
 executed sequential if successfully run next&lt;br /&gt;
 '''&amp;amp;&amp;amp;'''&lt;br /&gt;
 '''$ ls /home &amp;amp;&amp;amp; ls notfound &amp;amp;&amp;amp; ls ~'''&lt;br /&gt;
&lt;br /&gt;
== PORT SCAN with bash's built-in /dev/tcp ==&lt;br /&gt;
'''check if host response on a give port with bash's built-in /dev/tcp'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 HOST_PORT=&amp;quot;80&amp;quot;&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 exit; '''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 for HOST_PORT in {1..1000}&lt;br /&gt;
 do&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 declare -A PORT_ON&lt;br /&gt;
 for HOST_PORT in {1..65535}&lt;br /&gt;
 do&lt;br /&gt;
    if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
        PORT_ON[${HOST_PORT}]=&amp;quot;ON&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
 done&lt;br /&gt;
 for i in ${!PORT_ON[*]}&lt;br /&gt;
 do&lt;br /&gt;
    echo -e &amp;quot;$i : ${PORT_ON[$i]}&amp;quot;&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
== watch ==&lt;br /&gt;
&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo&amp;quot;'''&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
== Firefox bash output ==&lt;br /&gt;
&lt;br /&gt;
 For the usage in bash:&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -d -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
 Load a page and press F5 in the tab(again and again or hold the F5 button pressed) and watch&lt;br /&gt;
 When i kill the a tab with the right pid i get the message in the tab, that the tab is crashed now&lt;br /&gt;
 &lt;br /&gt;
 ''' In Firefox, about:performance'''&lt;br /&gt;
&lt;br /&gt;
 But check also this in bash if i close or open and load a page tab:&lt;br /&gt;
 '''$ pidof firefox'''&lt;br /&gt;
 '''$ pidof firefox-esr'''&lt;br /&gt;
 '''$ pgrep firefox get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
 '''$ pgrep firefox-esr get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
&lt;br /&gt;
 Get parentid and childid&lt;br /&gt;
 '''$ ps aux | grep [f]irefox'''&lt;br /&gt;
 '''$ ps aux | grep [f]irefox | grep tab'''&lt;br /&gt;
&lt;br /&gt;
 You see the parentBuildID and something of the child/tab&lt;br /&gt;
 It looks like that you can't close the child/tab only the parentBuildID, if you kill the child/tab the tab will crash but not close(but killed).&lt;br /&gt;
&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | wc -l'''&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | grep tab | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Create Symbolic Links ==&lt;br /&gt;
 [https://man7.org/linux/man-pages/man1/ln.1.html ln|Linux manual page]&lt;br /&gt;
 ''Symlink To a File''&lt;br /&gt;
 '''$ ln -s [OPTIONS] TARGET LINKNAME'''&lt;br /&gt;
 '''$ ln -s TARGET LINK_NAME''' &lt;br /&gt;
&lt;br /&gt;
 ''Symlinks To a Directory''&lt;br /&gt;
 '''$ ln -s /mnt/my_drive/movies ~/my_movies '''&lt;br /&gt;
&lt;br /&gt;
 ''Overwriting Symlinks''&lt;br /&gt;
 ''To overwrite the destination path of the symlink, use the -f (--force) option''&lt;br /&gt;
 '''$ ln -sf my_file.txt my_link.txt'''&lt;br /&gt;
&lt;br /&gt;
 ''Removing Symlinks ''&lt;br /&gt;
 '''$ unlink symlink_to_remove'''&lt;br /&gt;
 '''$ rm symlink_to_remove'''&lt;br /&gt;
&lt;br /&gt;
== List harddisk|usb|volume|partitions  ==&lt;br /&gt;
 ''Get label names:''&lt;br /&gt;
 '''$ e2label /dev/sdXx '''&lt;br /&gt;
 '''$ /sbin/blkid | grep sdXx''''&lt;br /&gt;
 '''$ blkid /dev/sdXx | awk -F'&amp;quot;' '{print $2}''''&lt;br /&gt;
&lt;br /&gt;
 ''Set label name:''&lt;br /&gt;
 '''$ e2label /dev/sdXx MYNAME'''&lt;br /&gt;
 '''$ tune2fs -L MYNAME /dev/sdXx '''&lt;br /&gt;
&lt;br /&gt;
== Create filesystem with '''mkfs.ext4'''  ==&lt;br /&gt;
 '''$ mkfs.ext4 /dev/sda1 -L MYNAME'''&lt;br /&gt;
&lt;br /&gt;
== Create/Add new USER '''useradd'''==&lt;br /&gt;
 Useradd is built-in Linux command that can be found on any Linux system. However, creating new users with this low-level is a tedious task because it doesn't create the home directory and user password by default.&lt;br /&gt;
&lt;br /&gt;
 Adduser is not a standard Linux command. It’s essentially a Perl script that uses the useradd command in the background. This high-level utility  is more efficient in properly creating new users on Linux. It gives you the option to create the home directory, and set password along with a few more parameters.&lt;br /&gt;
&lt;br /&gt;
 [https://linuxhandbook.com/useradd-vs-adduser/ Difference between adduser and useradd commands]&lt;br /&gt;
 [https://linuxconfig.org/add-user-linux-command adduser vs useradd in Linux] &lt;br /&gt;
&lt;br /&gt;
 '''$ useradd [OPTIONS] USERNAME'''&lt;br /&gt;
&lt;br /&gt;
 '''$ cat /etc/default/useradd'''&lt;br /&gt;
 '''$ ls -la /etc/skel/'''&lt;br /&gt;
 '''$ cat /etc/login.defs'''&lt;br /&gt;
&lt;br /&gt;
 View default options:&lt;br /&gt;
 '''$ useradd -D '''&lt;br /&gt;
&lt;br /&gt;
 Change the default login shell&lt;br /&gt;
 '''$ useradd -D -s /bin/bash '''&lt;br /&gt;
 '''$ useradd -D | grep -i shell '''&lt;br /&gt;
&lt;br /&gt;
 To create a user without home directory&lt;br /&gt;
 '''$ useradd -M user '''&lt;br /&gt;
&lt;br /&gt;
 Create a user with changed login shell &lt;br /&gt;
 '''$ useradd -s /bin/sh user '''&lt;br /&gt;
&lt;br /&gt;
 Option to create a user home directory &lt;br /&gt;
 '''--create-home'''&lt;br /&gt;
 '''-m '''&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -m -u 10000 USERNAME -s /bin/bash '''&lt;br /&gt;
&lt;br /&gt;
 There is an option for adding an encrypted password via the '''-p''' option on useradd&lt;br /&gt;
 Note that the '''-p''' option '''doesn't allow you to input a plaintext password''', it expects you to  encrypt it first. &lt;br /&gt;
 This is intentionally difficult, because you should not do it! &lt;br /&gt;
 Just use the '''passwd''' command or '''chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 '''passwd USER'''&lt;br /&gt;
 or&lt;br /&gt;
 '''echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 [https://stackoverflow.com/questions/2150882/how-to-automatically-add-user-account-and-password-with-a-bash-script How to automatically add user account AND password with a Bash script?]&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER'''&lt;br /&gt;
 Create USER + Homedirectory + Bash as Shell&lt;br /&gt;
&lt;br /&gt;
 USER+HOME+SHELL+PASSWORD&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER &amp;amp;&amp;amp; echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
== Delete USER '''userdel'''==&lt;br /&gt;
 '''$ userdel [OPTIONS] USERNAME '''&lt;br /&gt;
&lt;br /&gt;
 Use the -r (--remove) option to force userdel to remove the user’s home directory and mail spool:&lt;br /&gt;
 '''$ userdel -r username '''&lt;br /&gt;
&lt;br /&gt;
 Kill all user’s running processes&lt;br /&gt;
 '''$ killall -u username '''&lt;br /&gt;
&lt;br /&gt;
 Another option is to use the -f (--force) option that tells userdel to forcefully remove the user account, even if the user is still logged in or if there are running processes that belong to the user.&lt;br /&gt;
 '''$ userdel -f username '''&lt;br /&gt;
&lt;br /&gt;
[https://linuxize.com/post/how-to-delete-users-in-linux-using-the-userdel-command/ How to Delete/Remove Users in Linux (userdel Command)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''usermod'''==&lt;br /&gt;
&lt;br /&gt;
https://linuxize.com/post/usermod-command-in-linux/#:~:text=By%20default%2C%20on%20most%20Linux%20systems%2C%20the%20default,name%20of%20the%20user%3A%20usermod%20-s%20SHELL%20USER&lt;br /&gt;
&lt;br /&gt;
https://linuxconfig.org/usermod#:~:text=usermod%20command%20in%20Linux%20Advanced%20Examples%201%20Use,given%20a%20unique%20ID%20when%20first%20created.%20&lt;br /&gt;
&lt;br /&gt;
https://wiki.ubuntuusers.de/usermod/&lt;br /&gt;
&lt;br /&gt;
== '''GROUP, USER | GROUP VS PASSWD''' ==&lt;br /&gt;
&lt;br /&gt;
 https://teaching.idallen.com/cst8207/12f/notes/600_users_and_groups.html&lt;br /&gt;
&lt;br /&gt;
 https://www.unix.com/unix-for-dummies-questions-and-answers/162563-inconsistency-between-passwd-group.html&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/55107/why-dont-etc-group-and-etc-password-match&lt;br /&gt;
&lt;br /&gt;
 https://www.man7.org/linux/man-pages/man3/initgroups.3.html&lt;br /&gt;
&lt;br /&gt;
== chown ==&lt;br /&gt;
&lt;br /&gt;
 https://wiki.ubuntuusers.de/chown/&lt;br /&gt;
&lt;br /&gt;
== chmod ==&lt;br /&gt;
&lt;br /&gt;
 https://wiki.ubuntuusers.de/chmod/&lt;br /&gt;
&lt;br /&gt;
== chattr ==&lt;br /&gt;
 &lt;br /&gt;
 https://wiki.ubuntuusers.de/chattr/&lt;br /&gt;
&lt;br /&gt;
 https://man7.org/linux/man-pages/man1/chattr.1.html&lt;br /&gt;
&lt;br /&gt;
== BASH USER INFIS ==&lt;br /&gt;
&lt;br /&gt;
 '''getent passwd &amp;quot;$LOGNAME&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
 '''grep passwd /etc/nsswitch.conf'''&lt;br /&gt;
&lt;br /&gt;
== rbash | Restricted Bash ==&lt;br /&gt;
 '''$ rbash '''&lt;br /&gt;
 '''$ bash -r'''&lt;br /&gt;
&lt;br /&gt;
 https://www.tecmint.com/rbash-a-restricted-bash-shell-explained-with-practical-examples/&lt;br /&gt;
 https://www.thegeekdiary.com/rbash-set-restricted-shell-in-linux/&lt;br /&gt;
&lt;br /&gt;
 https://www.howtogeek.com/718074/how-to-use-restricted-shell-to-limit-what-a-linux-user-cando/&lt;br /&gt;
 https://ostechnix.com/how-to-limit-users-access-to-the-linux-system/&lt;br /&gt;
 https://averagelinuxuser.com/creating-new-user-linux/&lt;br /&gt;
 https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/&lt;br /&gt;
 https://www.howtoforge.com/user_password_creating_with_a_bash_script&lt;br /&gt;
&lt;br /&gt;
== Simple Script Jail ==&lt;br /&gt;
&lt;br /&gt;
 This is are the default settings for the USER to login and run a bash shell:&lt;br /&gt;
 '''$  chsh -s /bin/bash [USER] ''' &lt;br /&gt;
 &lt;br /&gt;
 This for the simple jail:&lt;br /&gt;
 '''$ chsh -s /home/[USER]/./run [USER] '''&lt;br /&gt;
&lt;br /&gt;
== Disable history ==&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-bash-shell-commands-history-on-linux&lt;br /&gt;
 https://www.cyberciti.biz/faq/disable-bash-shell-history-linux/&lt;br /&gt;
 https://www.thegeeksearch.com/how-to-disable-and-clear-linux-command-line-history/&lt;br /&gt;
&lt;br /&gt;
== Disable LASTLOGIN ==&lt;br /&gt;
 '''$ touch /home/user/.hushlogin'''&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-last-login-message-on-rhel-linux&lt;br /&gt;
 https://www.heatware.net/linux-unix/linux-how-to-disable-last-login-welcome-message/&lt;br /&gt;
&lt;br /&gt;
== type | command check ==&lt;br /&gt;
&lt;br /&gt;
 Check whether a command is built-in or not&lt;br /&gt;
 '''$ type [COMMAND]'''&lt;br /&gt;
&lt;br /&gt;
== RANDOM NUMBERS ==&lt;br /&gt;
 '''$ echo $RANDOM'''&lt;br /&gt;
 '''$ echo $(( $RANDOM % 9 + 0 ))'''&lt;br /&gt;
&lt;br /&gt;
 '''$ echo $(shuf -i 0-9 -n1)'''&lt;br /&gt;
&lt;br /&gt;
 '''$ od /dev/urandom  -A n -t d -N 1 '''&lt;br /&gt;
&lt;br /&gt;
 https://linuxhint.com/generate-random-number-bash/&lt;br /&gt;
 https://linuxconfig.org/generating-random-numbers-in-bash-with-examples&lt;br /&gt;
 https://www.delftstack.com/howto/linux/random-number-generation-in-bash/&lt;br /&gt;
&lt;br /&gt;
== RANDOM STRINGS ==&lt;br /&gt;
 '''$ echo $RANDOM | md5sum | head -c 1; echo; ''' &lt;br /&gt;
 '''$ tr -dc A-Za-z0-9 &amp;lt;/dev/urandom | head -c 1 ; echo ' ' '''&lt;br /&gt;
&lt;br /&gt;
 https://gist.github.com/earthgecko/3089509&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/230673/how-to-generate-a-random-string&lt;br /&gt;
 https://linuxhint.com/generate-random-string-bash/&lt;br /&gt;
 https://www.saotn.org/bash-function-to-generate-a-random-alphanumeric-string/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/a/709895/515538&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Bash&amp;diff=1110</id>
		<title>Bash</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Bash&amp;diff=1110"/>
		<updated>2023-05-04T08:44:08Z</updated>

		<summary type="html">&lt;p&gt;Geist: /* Delete USER userdel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Script ==&lt;br /&gt;
 '''$ type script'''&lt;br /&gt;
 '''$ chmod +x script'''&lt;br /&gt;
 '''$ ./script'''&lt;br /&gt;
 '''$ .script'''&lt;br /&gt;
 '''$ source script'''&lt;br /&gt;
 '''$ bash script'''&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
&lt;br /&gt;
== Command Line ==&lt;br /&gt;
 '''Everything is a file'''&lt;br /&gt;
 '''255 Byte'''&lt;br /&gt;
 The maximum length for a file name is 255 bytes.&lt;br /&gt;
 The maximum combined length of both the file name and path name is 4096 bytes.&lt;br /&gt;
 This length matches the PATH_MAX that is supported by the operating system.&lt;br /&gt;
 '''Names are case-sensitive'''&lt;br /&gt;
&lt;br /&gt;
==== Special chars to avoid in names/filenames ====&lt;br /&gt;
 /   Never&lt;br /&gt;
 \   Escaped&lt;br /&gt;
 -   Never at beginning&lt;br /&gt;
 []  Escaped&lt;br /&gt;
 {}  Escaped&lt;br /&gt;
 *   Escaped&lt;br /&gt;
 '   Escaped&lt;br /&gt;
 &amp;quot;   Escaped&lt;br /&gt;
&lt;br /&gt;
==== Wildcards ====&lt;br /&gt;
 '''*'''  asterisk        | any char&lt;br /&gt;
 '''?'''  question mark   | single char&lt;br /&gt;
 '''[]''' square brackets | set of single char or a range of chars&lt;br /&gt;
&lt;br /&gt;
==== List files and folders ====&lt;br /&gt;
 '''$ ls'''&lt;br /&gt;
 '''$ ls folder'''&lt;br /&gt;
 '''$ ls ./folder'''&lt;br /&gt;
 '''$ ls /path/folder'''&lt;br /&gt;
 '''$ ls ~/folder'''&lt;br /&gt;
 '''$ ls ~/folder/*.jpg'''&lt;br /&gt;
 '''$ ls ~/folder/*txt*'''&lt;br /&gt;
 '''$ ls -R folder''' (list of subfolders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -l''' (single column)&lt;br /&gt;
  '''-''' regular file&lt;br /&gt;
  '''_''' executable&lt;br /&gt;
  '''d''' directory&lt;br /&gt;
  '''l''' symbolic link&lt;br /&gt;
  '''s''' socket&lt;br /&gt;
  '''b''' block device&lt;br /&gt;
  '''c''' character device&lt;br /&gt;
  '''p''' named pipe&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -m''' (comma-separated list)&lt;br /&gt;
 '''$ ls -a''' (hidden files and folders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -F''' (file type)&lt;br /&gt;
 Symbols and file types&lt;br /&gt;
  '''*''' Executable&lt;br /&gt;
  '''/''' Directory&lt;br /&gt;
  '''@''' Symbolic link&lt;br /&gt;
  '''|''' FIFO&lt;br /&gt;
  '''=''' Socket&lt;br /&gt;
&lt;br /&gt;
 '''$ ls --color (content in color)'''&lt;br /&gt;
 '''$ dircolors'''&lt;br /&gt;
 '''$ dircolors --print-database'''&lt;br /&gt;
 '''$ ls -F --color'''&lt;br /&gt;
 '''$ la -la'''&lt;br /&gt;
 '''$ ls -r'''&lt;br /&gt;
 '''$ ls -X''' (sort by extension)&lt;br /&gt;
 '''$ ls -t''' (sort by date)&lt;br /&gt;
 '''$ ls -S''' (sort by content)&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
 '''$ ls -laS'''&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
&lt;br /&gt;
 '''$ pwd''' (current path)&lt;br /&gt;
&lt;br /&gt;
==== Change directory with '''cd'''====&lt;br /&gt;
 '''$ cd folder'''&lt;br /&gt;
 '''$ cd ~'''&lt;br /&gt;
 '''$ cd -'''&lt;br /&gt;
 '''$ cd ..'''&lt;br /&gt;
&lt;br /&gt;
==== Create and change current time of file '''touch'''====&lt;br /&gt;
 create new, empty file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 update access and modification time for file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 any desired time for file&lt;br /&gt;
 '''$ touch -t [[CC]YY]MMDDhhmm[.ss]file'''&lt;br /&gt;
&lt;br /&gt;
==== Create directory with '''mkdir'''====&lt;br /&gt;
 new directory&lt;br /&gt;
 '''$ mkdir folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory with subdirectories&lt;br /&gt;
 '''$ mkdir -p test/sub/folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory and show steps&lt;br /&gt;
 '''$ mkdir -v test/sub/folder'''&lt;br /&gt;
 '''$ mkdir -pv test/sub/folder'''&lt;br /&gt;
 &lt;br /&gt;
== Count files and directories, summary size and '''EXCLUDE''' folders ==&lt;br /&gt;
'''[https://unix.stackexchange.com/q/691703/515538 '''bash count files and directory, summary size and EXCLUDE folders that are fuse|sshfs''']'''&lt;br /&gt;
&lt;br /&gt;
==== Full size of a folder with '''du'''====&lt;br /&gt;
 get the full size of workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs workdir'''&lt;br /&gt;
&lt;br /&gt;
 get the full size of workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs --exclude=mysshf workdir'''&lt;br /&gt;
&lt;br /&gt;
==== Count files in folder with '''find'''====&lt;br /&gt;
 count files in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune -o \( -type f -print \) | wc -l'''&lt;br /&gt;
&lt;br /&gt;
==== Count folders in folder with '''find'''====&lt;br /&gt;
 count folders in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune \( -type d -print \)  | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Building blocks ==&lt;br /&gt;
&lt;br /&gt;
==== run several commands sequentially with ''';''' and '''&amp;amp;&amp;amp;''' ====&lt;br /&gt;
 executed sequential no matter if successfully or unsucessfully&lt;br /&gt;
 ''';'''&lt;br /&gt;
 '''$ ls /home ; ls notfound; ls ~'''&lt;br /&gt;
&lt;br /&gt;
 executed sequential if successfully run next&lt;br /&gt;
 '''&amp;amp;&amp;amp;'''&lt;br /&gt;
 '''$ ls /home &amp;amp;&amp;amp; ls notfound &amp;amp;&amp;amp; ls ~'''&lt;br /&gt;
&lt;br /&gt;
== PORT SCAN with bash's built-in /dev/tcp ==&lt;br /&gt;
'''check if host response on a give port with bash's built-in /dev/tcp'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 HOST_PORT=&amp;quot;80&amp;quot;&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 exit; '''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 for HOST_PORT in {1..1000}&lt;br /&gt;
 do&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 declare -A PORT_ON&lt;br /&gt;
 for HOST_PORT in {1..65535}&lt;br /&gt;
 do&lt;br /&gt;
    if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
        PORT_ON[${HOST_PORT}]=&amp;quot;ON&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
 done&lt;br /&gt;
 for i in ${!PORT_ON[*]}&lt;br /&gt;
 do&lt;br /&gt;
    echo -e &amp;quot;$i : ${PORT_ON[$i]}&amp;quot;&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
== watch ==&lt;br /&gt;
&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo&amp;quot;'''&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
== Firefox bash output ==&lt;br /&gt;
&lt;br /&gt;
 For the usage in bash:&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -d -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
 Load a page and press F5 in the tab(again and again or hold the F5 button pressed) and watch&lt;br /&gt;
 When i kill the a tab with the right pid i get the message in the tab, that the tab is crashed now&lt;br /&gt;
 &lt;br /&gt;
 ''' In Firefox, about:performance'''&lt;br /&gt;
&lt;br /&gt;
 But check also this in bash if i close or open and load a page tab:&lt;br /&gt;
 '''$ pidof firefox'''&lt;br /&gt;
 '''$ pidof firefox-esr'''&lt;br /&gt;
 '''$ pgrep firefox get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
 '''$ pgrep firefox-esr get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
&lt;br /&gt;
 Get parentid and childid&lt;br /&gt;
 '''$ ps aux | grep [f]irefox'''&lt;br /&gt;
 '''$ ps aux | grep [f]irefox | grep tab'''&lt;br /&gt;
&lt;br /&gt;
 You see the parentBuildID and something of the child/tab&lt;br /&gt;
 It looks like that you can't close the child/tab only the parentBuildID, if you kill the child/tab the tab will crash but not close(but killed).&lt;br /&gt;
&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | wc -l'''&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | grep tab | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Create Symbolic Links ==&lt;br /&gt;
 [https://man7.org/linux/man-pages/man1/ln.1.html ln|Linux manual page]&lt;br /&gt;
 ''Symlink To a File''&lt;br /&gt;
 '''$ ln -s [OPTIONS] TARGET LINKNAME'''&lt;br /&gt;
 '''$ ln -s TARGET LINK_NAME''' &lt;br /&gt;
&lt;br /&gt;
 ''Symlinks To a Directory''&lt;br /&gt;
 '''$ ln -s /mnt/my_drive/movies ~/my_movies '''&lt;br /&gt;
&lt;br /&gt;
 ''Overwriting Symlinks''&lt;br /&gt;
 ''To overwrite the destination path of the symlink, use the -f (--force) option''&lt;br /&gt;
 '''$ ln -sf my_file.txt my_link.txt'''&lt;br /&gt;
&lt;br /&gt;
 ''Removing Symlinks ''&lt;br /&gt;
 '''$ unlink symlink_to_remove'''&lt;br /&gt;
 '''$ rm symlink_to_remove'''&lt;br /&gt;
&lt;br /&gt;
== List harddisk|usb|volume|partitions  ==&lt;br /&gt;
 ''Get label names:''&lt;br /&gt;
 '''$ e2label /dev/sdXx '''&lt;br /&gt;
 '''$ /sbin/blkid | grep sdXx''''&lt;br /&gt;
 '''$ blkid /dev/sdXx | awk -F'&amp;quot;' '{print $2}''''&lt;br /&gt;
&lt;br /&gt;
 ''Set label name:''&lt;br /&gt;
 '''$ e2label /dev/sdXx MYNAME'''&lt;br /&gt;
 '''$ tune2fs -L MYNAME /dev/sdXx '''&lt;br /&gt;
&lt;br /&gt;
== Create filesystem with '''mkfs.ext4'''  ==&lt;br /&gt;
 '''$ mkfs.ext4 /dev/sda1 -L MYNAME'''&lt;br /&gt;
&lt;br /&gt;
== Create/Add new USER '''useradd'''==&lt;br /&gt;
 Useradd is built-in Linux command that can be found on any Linux system. However, creating new users with this low-level is a tedious task because it doesn't create the home directory and user password by default.&lt;br /&gt;
&lt;br /&gt;
 Adduser is not a standard Linux command. It’s essentially a Perl script that uses the useradd command in the background. This high-level utility  is more efficient in properly creating new users on Linux. It gives you the option to create the home directory, and set password along with a few more parameters.&lt;br /&gt;
&lt;br /&gt;
 [https://linuxhandbook.com/useradd-vs-adduser/ Difference between adduser and useradd commands]&lt;br /&gt;
 [https://linuxconfig.org/add-user-linux-command adduser vs useradd in Linux] &lt;br /&gt;
&lt;br /&gt;
 '''$ useradd [OPTIONS] USERNAME'''&lt;br /&gt;
&lt;br /&gt;
 '''$ cat /etc/default/useradd'''&lt;br /&gt;
 '''$ ls -la /etc/skel/'''&lt;br /&gt;
 '''$ cat /etc/login.defs'''&lt;br /&gt;
&lt;br /&gt;
 View default options:&lt;br /&gt;
 '''$ useradd -D '''&lt;br /&gt;
&lt;br /&gt;
 Change the default login shell&lt;br /&gt;
 '''$ useradd -D -s /bin/bash '''&lt;br /&gt;
 '''$ useradd -D | grep -i shell '''&lt;br /&gt;
&lt;br /&gt;
 To create a user without home directory&lt;br /&gt;
 '''$ useradd -M user '''&lt;br /&gt;
&lt;br /&gt;
 Create a user with changed login shell &lt;br /&gt;
 '''$ useradd -s /bin/sh user '''&lt;br /&gt;
&lt;br /&gt;
 Option to create a user home directory &lt;br /&gt;
 '''--create-home'''&lt;br /&gt;
 '''-m '''&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -m -u 10000 USERNAME -s /bin/bash '''&lt;br /&gt;
&lt;br /&gt;
 There is an option for adding an encrypted password via the '''-p''' option on useradd&lt;br /&gt;
 Note that the '''-p''' option '''doesn't allow you to input a plaintext password''', it expects you to  encrypt it first. &lt;br /&gt;
 This is intentionally difficult, because you should not do it! &lt;br /&gt;
 Just use the '''passwd''' command or '''chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 '''passwd USER'''&lt;br /&gt;
 or&lt;br /&gt;
 '''echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 [https://stackoverflow.com/questions/2150882/how-to-automatically-add-user-account-and-password-with-a-bash-script How to automatically add user account AND password with a Bash script?]&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER'''&lt;br /&gt;
 Create USER + Homedirectory + Bash as Shell&lt;br /&gt;
&lt;br /&gt;
 USER+HOME+SHELL+PASSWORD&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER &amp;amp;&amp;amp; echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
== Delete USER '''userdel'''==&lt;br /&gt;
 '''$ userdel [OPTIONS] USERNAME '''&lt;br /&gt;
&lt;br /&gt;
 Use the -r (--remove) option to force userdel to remove the user’s home directory and mail spool:&lt;br /&gt;
 '''$ userdel -r username '''&lt;br /&gt;
&lt;br /&gt;
 Kill all user’s running processes&lt;br /&gt;
 '''$ killall -u username '''&lt;br /&gt;
&lt;br /&gt;
 Another option is to use the -f (--force) option that tells userdel to forcefully remove the user account, even if the user is still logged in or if there are running processes that belong to the user.&lt;br /&gt;
 '''$ userdel -f username '''&lt;br /&gt;
&lt;br /&gt;
[https://linuxize.com/post/how-to-delete-users-in-linux-using-the-userdel-command/ How to Delete/Remove Users in Linux (userdel Command)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''usermod'''==&lt;br /&gt;
&lt;br /&gt;
https://linuxize.com/post/usermod-command-in-linux/#:~:text=By%20default%2C%20on%20most%20Linux%20systems%2C%20the%20default,name%20of%20the%20user%3A%20usermod%20-s%20SHELL%20USER&lt;br /&gt;
&lt;br /&gt;
https://linuxconfig.org/usermod#:~:text=usermod%20command%20in%20Linux%20Advanced%20Examples%201%20Use,given%20a%20unique%20ID%20when%20first%20created.%20&lt;br /&gt;
&lt;br /&gt;
https://wiki.ubuntuusers.de/usermod/&lt;br /&gt;
&lt;br /&gt;
== '''GROUP, USER | GROUP VS PASSWD''' ==&lt;br /&gt;
&lt;br /&gt;
 https://teaching.idallen.com/cst8207/12f/notes/600_users_and_groups.html&lt;br /&gt;
&lt;br /&gt;
 https://www.unix.com/unix-for-dummies-questions-and-answers/162563-inconsistency-between-passwd-group.html&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/55107/why-dont-etc-group-and-etc-password-match&lt;br /&gt;
&lt;br /&gt;
 https://www.man7.org/linux/man-pages/man3/initgroups.3.html&lt;br /&gt;
&lt;br /&gt;
== chown ==&lt;br /&gt;
&lt;br /&gt;
 https://wiki.ubuntuusers.de/chown/&lt;br /&gt;
&lt;br /&gt;
== chmod ==&lt;br /&gt;
&lt;br /&gt;
 https://wiki.ubuntuusers.de/chmod/&lt;br /&gt;
&lt;br /&gt;
== chattr ==&lt;br /&gt;
 &lt;br /&gt;
 https://wiki.ubuntuusers.de/chattr/&lt;br /&gt;
&lt;br /&gt;
 https://man7.org/linux/man-pages/man1/chattr.1.html&lt;br /&gt;
&lt;br /&gt;
== rbash | Restricted Bash ==&lt;br /&gt;
 '''$ rbash '''&lt;br /&gt;
 '''$ bash -r'''&lt;br /&gt;
&lt;br /&gt;
 https://www.tecmint.com/rbash-a-restricted-bash-shell-explained-with-practical-examples/&lt;br /&gt;
 https://www.thegeekdiary.com/rbash-set-restricted-shell-in-linux/&lt;br /&gt;
&lt;br /&gt;
 https://www.howtogeek.com/718074/how-to-use-restricted-shell-to-limit-what-a-linux-user-cando/&lt;br /&gt;
 https://ostechnix.com/how-to-limit-users-access-to-the-linux-system/&lt;br /&gt;
 https://averagelinuxuser.com/creating-new-user-linux/&lt;br /&gt;
 https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/&lt;br /&gt;
 https://www.howtoforge.com/user_password_creating_with_a_bash_script&lt;br /&gt;
&lt;br /&gt;
== Simple Script Jail ==&lt;br /&gt;
&lt;br /&gt;
 This is are the default settings for the USER to login and run a bash shell:&lt;br /&gt;
 '''$  chsh -s /bin/bash [USER] ''' &lt;br /&gt;
 &lt;br /&gt;
 This for the simple jail:&lt;br /&gt;
 '''$ chsh -s /home/[USER]/./run [USER] '''&lt;br /&gt;
&lt;br /&gt;
== Disable history ==&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-bash-shell-commands-history-on-linux&lt;br /&gt;
 https://www.cyberciti.biz/faq/disable-bash-shell-history-linux/&lt;br /&gt;
 https://www.thegeeksearch.com/how-to-disable-and-clear-linux-command-line-history/&lt;br /&gt;
&lt;br /&gt;
== Disable LASTLOGIN ==&lt;br /&gt;
 '''$ touch /home/user/.hushlogin'''&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-last-login-message-on-rhel-linux&lt;br /&gt;
 https://www.heatware.net/linux-unix/linux-how-to-disable-last-login-welcome-message/&lt;br /&gt;
&lt;br /&gt;
== type | command check ==&lt;br /&gt;
&lt;br /&gt;
 Check whether a command is built-in or not&lt;br /&gt;
 '''$ type [COMMAND]'''&lt;br /&gt;
&lt;br /&gt;
== RANDOM NUMBERS ==&lt;br /&gt;
 '''$ echo $RANDOM'''&lt;br /&gt;
 '''$ echo $(( $RANDOM % 9 + 0 ))'''&lt;br /&gt;
&lt;br /&gt;
 '''$ echo $(shuf -i 0-9 -n1)'''&lt;br /&gt;
&lt;br /&gt;
 '''$ od /dev/urandom  -A n -t d -N 1 '''&lt;br /&gt;
&lt;br /&gt;
 https://linuxhint.com/generate-random-number-bash/&lt;br /&gt;
 https://linuxconfig.org/generating-random-numbers-in-bash-with-examples&lt;br /&gt;
 https://www.delftstack.com/howto/linux/random-number-generation-in-bash/&lt;br /&gt;
&lt;br /&gt;
== RANDOM STRINGS ==&lt;br /&gt;
 '''$ echo $RANDOM | md5sum | head -c 1; echo; ''' &lt;br /&gt;
 '''$ tr -dc A-Za-z0-9 &amp;lt;/dev/urandom | head -c 1 ; echo ' ' '''&lt;br /&gt;
&lt;br /&gt;
 https://gist.github.com/earthgecko/3089509&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/230673/how-to-generate-a-random-string&lt;br /&gt;
 https://linuxhint.com/generate-random-string-bash/&lt;br /&gt;
 https://www.saotn.org/bash-function-to-generate-a-random-alphanumeric-string/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/a/709895/515538&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Bash&amp;diff=1109</id>
		<title>Bash</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Bash&amp;diff=1109"/>
		<updated>2023-05-03T07:32:28Z</updated>

		<summary type="html">&lt;p&gt;Geist: /* chmod */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Script ==&lt;br /&gt;
 '''$ type script'''&lt;br /&gt;
 '''$ chmod +x script'''&lt;br /&gt;
 '''$ ./script'''&lt;br /&gt;
 '''$ .script'''&lt;br /&gt;
 '''$ source script'''&lt;br /&gt;
 '''$ bash script'''&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
&lt;br /&gt;
== Command Line ==&lt;br /&gt;
 '''Everything is a file'''&lt;br /&gt;
 '''255 Byte'''&lt;br /&gt;
 The maximum length for a file name is 255 bytes.&lt;br /&gt;
 The maximum combined length of both the file name and path name is 4096 bytes.&lt;br /&gt;
 This length matches the PATH_MAX that is supported by the operating system.&lt;br /&gt;
 '''Names are case-sensitive'''&lt;br /&gt;
&lt;br /&gt;
==== Special chars to avoid in names/filenames ====&lt;br /&gt;
 /   Never&lt;br /&gt;
 \   Escaped&lt;br /&gt;
 -   Never at beginning&lt;br /&gt;
 []  Escaped&lt;br /&gt;
 {}  Escaped&lt;br /&gt;
 *   Escaped&lt;br /&gt;
 '   Escaped&lt;br /&gt;
 &amp;quot;   Escaped&lt;br /&gt;
&lt;br /&gt;
==== Wildcards ====&lt;br /&gt;
 '''*'''  asterisk        | any char&lt;br /&gt;
 '''?'''  question mark   | single char&lt;br /&gt;
 '''[]''' square brackets | set of single char or a range of chars&lt;br /&gt;
&lt;br /&gt;
==== List files and folders ====&lt;br /&gt;
 '''$ ls'''&lt;br /&gt;
 '''$ ls folder'''&lt;br /&gt;
 '''$ ls ./folder'''&lt;br /&gt;
 '''$ ls /path/folder'''&lt;br /&gt;
 '''$ ls ~/folder'''&lt;br /&gt;
 '''$ ls ~/folder/*.jpg'''&lt;br /&gt;
 '''$ ls ~/folder/*txt*'''&lt;br /&gt;
 '''$ ls -R folder''' (list of subfolders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -l''' (single column)&lt;br /&gt;
  '''-''' regular file&lt;br /&gt;
  '''_''' executable&lt;br /&gt;
  '''d''' directory&lt;br /&gt;
  '''l''' symbolic link&lt;br /&gt;
  '''s''' socket&lt;br /&gt;
  '''b''' block device&lt;br /&gt;
  '''c''' character device&lt;br /&gt;
  '''p''' named pipe&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -m''' (comma-separated list)&lt;br /&gt;
 '''$ ls -a''' (hidden files and folders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -F''' (file type)&lt;br /&gt;
 Symbols and file types&lt;br /&gt;
  '''*''' Executable&lt;br /&gt;
  '''/''' Directory&lt;br /&gt;
  '''@''' Symbolic link&lt;br /&gt;
  '''|''' FIFO&lt;br /&gt;
  '''=''' Socket&lt;br /&gt;
&lt;br /&gt;
 '''$ ls --color (content in color)'''&lt;br /&gt;
 '''$ dircolors'''&lt;br /&gt;
 '''$ dircolors --print-database'''&lt;br /&gt;
 '''$ ls -F --color'''&lt;br /&gt;
 '''$ la -la'''&lt;br /&gt;
 '''$ ls -r'''&lt;br /&gt;
 '''$ ls -X''' (sort by extension)&lt;br /&gt;
 '''$ ls -t''' (sort by date)&lt;br /&gt;
 '''$ ls -S''' (sort by content)&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
 '''$ ls -laS'''&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
&lt;br /&gt;
 '''$ pwd''' (current path)&lt;br /&gt;
&lt;br /&gt;
==== Change directory with '''cd'''====&lt;br /&gt;
 '''$ cd folder'''&lt;br /&gt;
 '''$ cd ~'''&lt;br /&gt;
 '''$ cd -'''&lt;br /&gt;
 '''$ cd ..'''&lt;br /&gt;
&lt;br /&gt;
==== Create and change current time of file '''touch'''====&lt;br /&gt;
 create new, empty file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 update access and modification time for file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 any desired time for file&lt;br /&gt;
 '''$ touch -t [[CC]YY]MMDDhhmm[.ss]file'''&lt;br /&gt;
&lt;br /&gt;
==== Create directory with '''mkdir'''====&lt;br /&gt;
 new directory&lt;br /&gt;
 '''$ mkdir folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory with subdirectories&lt;br /&gt;
 '''$ mkdir -p test/sub/folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory and show steps&lt;br /&gt;
 '''$ mkdir -v test/sub/folder'''&lt;br /&gt;
 '''$ mkdir -pv test/sub/folder'''&lt;br /&gt;
 &lt;br /&gt;
== Count files and directories, summary size and '''EXCLUDE''' folders ==&lt;br /&gt;
'''[https://unix.stackexchange.com/q/691703/515538 '''bash count files and directory, summary size and EXCLUDE folders that are fuse|sshfs''']'''&lt;br /&gt;
&lt;br /&gt;
==== Full size of a folder with '''du'''====&lt;br /&gt;
 get the full size of workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs workdir'''&lt;br /&gt;
&lt;br /&gt;
 get the full size of workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs --exclude=mysshf workdir'''&lt;br /&gt;
&lt;br /&gt;
==== Count files in folder with '''find'''====&lt;br /&gt;
 count files in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune -o \( -type f -print \) | wc -l'''&lt;br /&gt;
&lt;br /&gt;
==== Count folders in folder with '''find'''====&lt;br /&gt;
 count folders in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune \( -type d -print \)  | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Building blocks ==&lt;br /&gt;
&lt;br /&gt;
==== run several commands sequentially with ''';''' and '''&amp;amp;&amp;amp;''' ====&lt;br /&gt;
 executed sequential no matter if successfully or unsucessfully&lt;br /&gt;
 ''';'''&lt;br /&gt;
 '''$ ls /home ; ls notfound; ls ~'''&lt;br /&gt;
&lt;br /&gt;
 executed sequential if successfully run next&lt;br /&gt;
 '''&amp;amp;&amp;amp;'''&lt;br /&gt;
 '''$ ls /home &amp;amp;&amp;amp; ls notfound &amp;amp;&amp;amp; ls ~'''&lt;br /&gt;
&lt;br /&gt;
== PORT SCAN with bash's built-in /dev/tcp ==&lt;br /&gt;
'''check if host response on a give port with bash's built-in /dev/tcp'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 HOST_PORT=&amp;quot;80&amp;quot;&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 exit; '''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 for HOST_PORT in {1..1000}&lt;br /&gt;
 do&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 declare -A PORT_ON&lt;br /&gt;
 for HOST_PORT in {1..65535}&lt;br /&gt;
 do&lt;br /&gt;
    if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
        PORT_ON[${HOST_PORT}]=&amp;quot;ON&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
 done&lt;br /&gt;
 for i in ${!PORT_ON[*]}&lt;br /&gt;
 do&lt;br /&gt;
    echo -e &amp;quot;$i : ${PORT_ON[$i]}&amp;quot;&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
== watch ==&lt;br /&gt;
&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo&amp;quot;'''&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
== Firefox bash output ==&lt;br /&gt;
&lt;br /&gt;
 For the usage in bash:&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -d -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
 Load a page and press F5 in the tab(again and again or hold the F5 button pressed) and watch&lt;br /&gt;
 When i kill the a tab with the right pid i get the message in the tab, that the tab is crashed now&lt;br /&gt;
 &lt;br /&gt;
 ''' In Firefox, about:performance'''&lt;br /&gt;
&lt;br /&gt;
 But check also this in bash if i close or open and load a page tab:&lt;br /&gt;
 '''$ pidof firefox'''&lt;br /&gt;
 '''$ pidof firefox-esr'''&lt;br /&gt;
 '''$ pgrep firefox get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
 '''$ pgrep firefox-esr get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
&lt;br /&gt;
 Get parentid and childid&lt;br /&gt;
 '''$ ps aux | grep [f]irefox'''&lt;br /&gt;
 '''$ ps aux | grep [f]irefox | grep tab'''&lt;br /&gt;
&lt;br /&gt;
 You see the parentBuildID and something of the child/tab&lt;br /&gt;
 It looks like that you can't close the child/tab only the parentBuildID, if you kill the child/tab the tab will crash but not close(but killed).&lt;br /&gt;
&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | wc -l'''&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | grep tab | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Create Symbolic Links ==&lt;br /&gt;
 [https://man7.org/linux/man-pages/man1/ln.1.html ln|Linux manual page]&lt;br /&gt;
 ''Symlink To a File''&lt;br /&gt;
 '''$ ln -s [OPTIONS] TARGET LINKNAME'''&lt;br /&gt;
 '''$ ln -s TARGET LINK_NAME''' &lt;br /&gt;
&lt;br /&gt;
 ''Symlinks To a Directory''&lt;br /&gt;
 '''$ ln -s /mnt/my_drive/movies ~/my_movies '''&lt;br /&gt;
&lt;br /&gt;
 ''Overwriting Symlinks''&lt;br /&gt;
 ''To overwrite the destination path of the symlink, use the -f (--force) option''&lt;br /&gt;
 '''$ ln -sf my_file.txt my_link.txt'''&lt;br /&gt;
&lt;br /&gt;
 ''Removing Symlinks ''&lt;br /&gt;
 '''$ unlink symlink_to_remove'''&lt;br /&gt;
 '''$ rm symlink_to_remove'''&lt;br /&gt;
&lt;br /&gt;
== List harddisk|usb|volume|partitions  ==&lt;br /&gt;
 ''Get label names:''&lt;br /&gt;
 '''$ e2label /dev/sdXx '''&lt;br /&gt;
 '''$ /sbin/blkid | grep sdXx''''&lt;br /&gt;
 '''$ blkid /dev/sdXx | awk -F'&amp;quot;' '{print $2}''''&lt;br /&gt;
&lt;br /&gt;
 ''Set label name:''&lt;br /&gt;
 '''$ e2label /dev/sdXx MYNAME'''&lt;br /&gt;
 '''$ tune2fs -L MYNAME /dev/sdXx '''&lt;br /&gt;
&lt;br /&gt;
== Create filesystem with '''mkfs.ext4'''  ==&lt;br /&gt;
 '''$ mkfs.ext4 /dev/sda1 -L MYNAME'''&lt;br /&gt;
&lt;br /&gt;
== Create/Add new USER '''useradd'''==&lt;br /&gt;
 Useradd is built-in Linux command that can be found on any Linux system. However, creating new users with this low-level is a tedious task because it doesn't create the home directory and user password by default.&lt;br /&gt;
&lt;br /&gt;
 Adduser is not a standard Linux command. It’s essentially a Perl script that uses the useradd command in the background. This high-level utility  is more efficient in properly creating new users on Linux. It gives you the option to create the home directory, and set password along with a few more parameters.&lt;br /&gt;
&lt;br /&gt;
 [https://linuxhandbook.com/useradd-vs-adduser/ Difference between adduser and useradd commands]&lt;br /&gt;
 [https://linuxconfig.org/add-user-linux-command adduser vs useradd in Linux] &lt;br /&gt;
&lt;br /&gt;
 '''$ useradd [OPTIONS] USERNAME'''&lt;br /&gt;
&lt;br /&gt;
 '''$ cat /etc/default/useradd'''&lt;br /&gt;
 '''$ ls -la /etc/skel/'''&lt;br /&gt;
 '''$ cat /etc/login.defs'''&lt;br /&gt;
&lt;br /&gt;
 View default options:&lt;br /&gt;
 '''$ useradd -D '''&lt;br /&gt;
&lt;br /&gt;
 Change the default login shell&lt;br /&gt;
 '''$ useradd -D -s /bin/bash '''&lt;br /&gt;
 '''$ useradd -D | grep -i shell '''&lt;br /&gt;
&lt;br /&gt;
 To create a user without home directory&lt;br /&gt;
 '''$ useradd -M user '''&lt;br /&gt;
&lt;br /&gt;
 Create a user with changed login shell &lt;br /&gt;
 '''$ useradd -s /bin/sh user '''&lt;br /&gt;
&lt;br /&gt;
 Option to create a user home directory &lt;br /&gt;
 '''--create-home'''&lt;br /&gt;
 '''-m '''&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -m -u 10000 USERNAME -s /bin/bash '''&lt;br /&gt;
&lt;br /&gt;
 There is an option for adding an encrypted password via the '''-p''' option on useradd&lt;br /&gt;
 Note that the '''-p''' option '''doesn't allow you to input a plaintext password''', it expects you to  encrypt it first. &lt;br /&gt;
 This is intentionally difficult, because you should not do it! &lt;br /&gt;
 Just use the '''passwd''' command or '''chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 '''passwd USER'''&lt;br /&gt;
 or&lt;br /&gt;
 '''echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 [https://stackoverflow.com/questions/2150882/how-to-automatically-add-user-account-and-password-with-a-bash-script How to automatically add user account AND password with a Bash script?]&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER'''&lt;br /&gt;
 Create USER + Homedirectory + Bash as Shell&lt;br /&gt;
&lt;br /&gt;
 USER+HOME+SHELL+PASSWORD&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER &amp;amp;&amp;amp; echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
== Delete USER '''userdel'''==&lt;br /&gt;
 '''$ userdel [OPTIONS] USERNAME '''&lt;br /&gt;
&lt;br /&gt;
 Use the -r (--remove) option to force userdel to remove the user’s home directory and mail spool:&lt;br /&gt;
 '''$ userdel -r username '''&lt;br /&gt;
&lt;br /&gt;
 Kill all user’s running processes&lt;br /&gt;
 '''$ killall -u username '''&lt;br /&gt;
&lt;br /&gt;
 Another option is to use the -f (--force) option that tells userdel to forcefully remove the user account, even if the user is still logged in or if there are running processes that belong to the user.&lt;br /&gt;
 '''$ userdel -f username '''&lt;br /&gt;
&lt;br /&gt;
[https://linuxize.com/post/how-to-delete-users-in-linux-using-the-userdel-command/ How to Delete/Remove Users in Linux (userdel Command)]&lt;br /&gt;
&lt;br /&gt;
== '''GROUP, USER | GROUP VS PASSWD''' ==&lt;br /&gt;
&lt;br /&gt;
 https://teaching.idallen.com/cst8207/12f/notes/600_users_and_groups.html&lt;br /&gt;
&lt;br /&gt;
 https://www.unix.com/unix-for-dummies-questions-and-answers/162563-inconsistency-between-passwd-group.html&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/55107/why-dont-etc-group-and-etc-password-match&lt;br /&gt;
&lt;br /&gt;
 https://www.man7.org/linux/man-pages/man3/initgroups.3.html&lt;br /&gt;
&lt;br /&gt;
== chown ==&lt;br /&gt;
&lt;br /&gt;
 https://wiki.ubuntuusers.de/chown/&lt;br /&gt;
&lt;br /&gt;
== chmod ==&lt;br /&gt;
&lt;br /&gt;
 https://wiki.ubuntuusers.de/chmod/&lt;br /&gt;
&lt;br /&gt;
== chattr ==&lt;br /&gt;
 &lt;br /&gt;
 https://wiki.ubuntuusers.de/chattr/&lt;br /&gt;
&lt;br /&gt;
 https://man7.org/linux/man-pages/man1/chattr.1.html&lt;br /&gt;
&lt;br /&gt;
== rbash | Restricted Bash ==&lt;br /&gt;
 '''$ rbash '''&lt;br /&gt;
 '''$ bash -r'''&lt;br /&gt;
&lt;br /&gt;
 https://www.tecmint.com/rbash-a-restricted-bash-shell-explained-with-practical-examples/&lt;br /&gt;
 https://www.thegeekdiary.com/rbash-set-restricted-shell-in-linux/&lt;br /&gt;
&lt;br /&gt;
 https://www.howtogeek.com/718074/how-to-use-restricted-shell-to-limit-what-a-linux-user-cando/&lt;br /&gt;
 https://ostechnix.com/how-to-limit-users-access-to-the-linux-system/&lt;br /&gt;
 https://averagelinuxuser.com/creating-new-user-linux/&lt;br /&gt;
 https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/&lt;br /&gt;
 https://www.howtoforge.com/user_password_creating_with_a_bash_script&lt;br /&gt;
&lt;br /&gt;
== Simple Script Jail ==&lt;br /&gt;
&lt;br /&gt;
 This is are the default settings for the USER to login and run a bash shell:&lt;br /&gt;
 '''$  chsh -s /bin/bash [USER] ''' &lt;br /&gt;
 &lt;br /&gt;
 This for the simple jail:&lt;br /&gt;
 '''$ chsh -s /home/[USER]/./run [USER] '''&lt;br /&gt;
&lt;br /&gt;
== Disable history ==&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-bash-shell-commands-history-on-linux&lt;br /&gt;
 https://www.cyberciti.biz/faq/disable-bash-shell-history-linux/&lt;br /&gt;
 https://www.thegeeksearch.com/how-to-disable-and-clear-linux-command-line-history/&lt;br /&gt;
&lt;br /&gt;
== Disable LASTLOGIN ==&lt;br /&gt;
 '''$ touch /home/user/.hushlogin'''&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-last-login-message-on-rhel-linux&lt;br /&gt;
 https://www.heatware.net/linux-unix/linux-how-to-disable-last-login-welcome-message/&lt;br /&gt;
&lt;br /&gt;
== type | command check ==&lt;br /&gt;
&lt;br /&gt;
 Check whether a command is built-in or not&lt;br /&gt;
 '''$ type [COMMAND]'''&lt;br /&gt;
&lt;br /&gt;
== RANDOM NUMBERS ==&lt;br /&gt;
 '''$ echo $RANDOM'''&lt;br /&gt;
 '''$ echo $(( $RANDOM % 9 + 0 ))'''&lt;br /&gt;
&lt;br /&gt;
 '''$ echo $(shuf -i 0-9 -n1)'''&lt;br /&gt;
&lt;br /&gt;
 '''$ od /dev/urandom  -A n -t d -N 1 '''&lt;br /&gt;
&lt;br /&gt;
 https://linuxhint.com/generate-random-number-bash/&lt;br /&gt;
 https://linuxconfig.org/generating-random-numbers-in-bash-with-examples&lt;br /&gt;
 https://www.delftstack.com/howto/linux/random-number-generation-in-bash/&lt;br /&gt;
&lt;br /&gt;
== RANDOM STRINGS ==&lt;br /&gt;
 '''$ echo $RANDOM | md5sum | head -c 1; echo; ''' &lt;br /&gt;
 '''$ tr -dc A-Za-z0-9 &amp;lt;/dev/urandom | head -c 1 ; echo ' ' '''&lt;br /&gt;
&lt;br /&gt;
 https://gist.github.com/earthgecko/3089509&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/230673/how-to-generate-a-random-string&lt;br /&gt;
 https://linuxhint.com/generate-random-string-bash/&lt;br /&gt;
 https://www.saotn.org/bash-function-to-generate-a-random-alphanumeric-string/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/a/709895/515538&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Bash&amp;diff=1108</id>
		<title>Bash</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Bash&amp;diff=1108"/>
		<updated>2023-05-03T07:31:18Z</updated>

		<summary type="html">&lt;p&gt;Geist: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Script ==&lt;br /&gt;
 '''$ type script'''&lt;br /&gt;
 '''$ chmod +x script'''&lt;br /&gt;
 '''$ ./script'''&lt;br /&gt;
 '''$ .script'''&lt;br /&gt;
 '''$ source script'''&lt;br /&gt;
 '''$ bash script'''&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
&lt;br /&gt;
== Command Line ==&lt;br /&gt;
 '''Everything is a file'''&lt;br /&gt;
 '''255 Byte'''&lt;br /&gt;
 The maximum length for a file name is 255 bytes.&lt;br /&gt;
 The maximum combined length of both the file name and path name is 4096 bytes.&lt;br /&gt;
 This length matches the PATH_MAX that is supported by the operating system.&lt;br /&gt;
 '''Names are case-sensitive'''&lt;br /&gt;
&lt;br /&gt;
==== Special chars to avoid in names/filenames ====&lt;br /&gt;
 /   Never&lt;br /&gt;
 \   Escaped&lt;br /&gt;
 -   Never at beginning&lt;br /&gt;
 []  Escaped&lt;br /&gt;
 {}  Escaped&lt;br /&gt;
 *   Escaped&lt;br /&gt;
 '   Escaped&lt;br /&gt;
 &amp;quot;   Escaped&lt;br /&gt;
&lt;br /&gt;
==== Wildcards ====&lt;br /&gt;
 '''*'''  asterisk        | any char&lt;br /&gt;
 '''?'''  question mark   | single char&lt;br /&gt;
 '''[]''' square brackets | set of single char or a range of chars&lt;br /&gt;
&lt;br /&gt;
==== List files and folders ====&lt;br /&gt;
 '''$ ls'''&lt;br /&gt;
 '''$ ls folder'''&lt;br /&gt;
 '''$ ls ./folder'''&lt;br /&gt;
 '''$ ls /path/folder'''&lt;br /&gt;
 '''$ ls ~/folder'''&lt;br /&gt;
 '''$ ls ~/folder/*.jpg'''&lt;br /&gt;
 '''$ ls ~/folder/*txt*'''&lt;br /&gt;
 '''$ ls -R folder''' (list of subfolders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -l''' (single column)&lt;br /&gt;
  '''-''' regular file&lt;br /&gt;
  '''_''' executable&lt;br /&gt;
  '''d''' directory&lt;br /&gt;
  '''l''' symbolic link&lt;br /&gt;
  '''s''' socket&lt;br /&gt;
  '''b''' block device&lt;br /&gt;
  '''c''' character device&lt;br /&gt;
  '''p''' named pipe&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -m''' (comma-separated list)&lt;br /&gt;
 '''$ ls -a''' (hidden files and folders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -F''' (file type)&lt;br /&gt;
 Symbols and file types&lt;br /&gt;
  '''*''' Executable&lt;br /&gt;
  '''/''' Directory&lt;br /&gt;
  '''@''' Symbolic link&lt;br /&gt;
  '''|''' FIFO&lt;br /&gt;
  '''=''' Socket&lt;br /&gt;
&lt;br /&gt;
 '''$ ls --color (content in color)'''&lt;br /&gt;
 '''$ dircolors'''&lt;br /&gt;
 '''$ dircolors --print-database'''&lt;br /&gt;
 '''$ ls -F --color'''&lt;br /&gt;
 '''$ la -la'''&lt;br /&gt;
 '''$ ls -r'''&lt;br /&gt;
 '''$ ls -X''' (sort by extension)&lt;br /&gt;
 '''$ ls -t''' (sort by date)&lt;br /&gt;
 '''$ ls -S''' (sort by content)&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
 '''$ ls -laS'''&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
&lt;br /&gt;
 '''$ pwd''' (current path)&lt;br /&gt;
&lt;br /&gt;
==== Change directory with '''cd'''====&lt;br /&gt;
 '''$ cd folder'''&lt;br /&gt;
 '''$ cd ~'''&lt;br /&gt;
 '''$ cd -'''&lt;br /&gt;
 '''$ cd ..'''&lt;br /&gt;
&lt;br /&gt;
==== Create and change current time of file '''touch'''====&lt;br /&gt;
 create new, empty file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 update access and modification time for file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 any desired time for file&lt;br /&gt;
 '''$ touch -t [[CC]YY]MMDDhhmm[.ss]file'''&lt;br /&gt;
&lt;br /&gt;
==== Create directory with '''mkdir'''====&lt;br /&gt;
 new directory&lt;br /&gt;
 '''$ mkdir folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory with subdirectories&lt;br /&gt;
 '''$ mkdir -p test/sub/folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory and show steps&lt;br /&gt;
 '''$ mkdir -v test/sub/folder'''&lt;br /&gt;
 '''$ mkdir -pv test/sub/folder'''&lt;br /&gt;
 &lt;br /&gt;
== Count files and directories, summary size and '''EXCLUDE''' folders ==&lt;br /&gt;
'''[https://unix.stackexchange.com/q/691703/515538 '''bash count files and directory, summary size and EXCLUDE folders that are fuse|sshfs''']'''&lt;br /&gt;
&lt;br /&gt;
==== Full size of a folder with '''du'''====&lt;br /&gt;
 get the full size of workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs workdir'''&lt;br /&gt;
&lt;br /&gt;
 get the full size of workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs --exclude=mysshf workdir'''&lt;br /&gt;
&lt;br /&gt;
==== Count files in folder with '''find'''====&lt;br /&gt;
 count files in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune -o \( -type f -print \) | wc -l'''&lt;br /&gt;
&lt;br /&gt;
==== Count folders in folder with '''find'''====&lt;br /&gt;
 count folders in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune \( -type d -print \)  | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Building blocks ==&lt;br /&gt;
&lt;br /&gt;
==== run several commands sequentially with ''';''' and '''&amp;amp;&amp;amp;''' ====&lt;br /&gt;
 executed sequential no matter if successfully or unsucessfully&lt;br /&gt;
 ''';'''&lt;br /&gt;
 '''$ ls /home ; ls notfound; ls ~'''&lt;br /&gt;
&lt;br /&gt;
 executed sequential if successfully run next&lt;br /&gt;
 '''&amp;amp;&amp;amp;'''&lt;br /&gt;
 '''$ ls /home &amp;amp;&amp;amp; ls notfound &amp;amp;&amp;amp; ls ~'''&lt;br /&gt;
&lt;br /&gt;
== PORT SCAN with bash's built-in /dev/tcp ==&lt;br /&gt;
'''check if host response on a give port with bash's built-in /dev/tcp'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 HOST_PORT=&amp;quot;80&amp;quot;&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 exit; '''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 for HOST_PORT in {1..1000}&lt;br /&gt;
 do&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 declare -A PORT_ON&lt;br /&gt;
 for HOST_PORT in {1..65535}&lt;br /&gt;
 do&lt;br /&gt;
    if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
        PORT_ON[${HOST_PORT}]=&amp;quot;ON&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
 done&lt;br /&gt;
 for i in ${!PORT_ON[*]}&lt;br /&gt;
 do&lt;br /&gt;
    echo -e &amp;quot;$i : ${PORT_ON[$i]}&amp;quot;&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
== watch ==&lt;br /&gt;
&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo&amp;quot;'''&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
== Firefox bash output ==&lt;br /&gt;
&lt;br /&gt;
 For the usage in bash:&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -d -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
 Load a page and press F5 in the tab(again and again or hold the F5 button pressed) and watch&lt;br /&gt;
 When i kill the a tab with the right pid i get the message in the tab, that the tab is crashed now&lt;br /&gt;
 &lt;br /&gt;
 ''' In Firefox, about:performance'''&lt;br /&gt;
&lt;br /&gt;
 But check also this in bash if i close or open and load a page tab:&lt;br /&gt;
 '''$ pidof firefox'''&lt;br /&gt;
 '''$ pidof firefox-esr'''&lt;br /&gt;
 '''$ pgrep firefox get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
 '''$ pgrep firefox-esr get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
&lt;br /&gt;
 Get parentid and childid&lt;br /&gt;
 '''$ ps aux | grep [f]irefox'''&lt;br /&gt;
 '''$ ps aux | grep [f]irefox | grep tab'''&lt;br /&gt;
&lt;br /&gt;
 You see the parentBuildID and something of the child/tab&lt;br /&gt;
 It looks like that you can't close the child/tab only the parentBuildID, if you kill the child/tab the tab will crash but not close(but killed).&lt;br /&gt;
&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | wc -l'''&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | grep tab | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Create Symbolic Links ==&lt;br /&gt;
 [https://man7.org/linux/man-pages/man1/ln.1.html ln|Linux manual page]&lt;br /&gt;
 ''Symlink To a File''&lt;br /&gt;
 '''$ ln -s [OPTIONS] TARGET LINKNAME'''&lt;br /&gt;
 '''$ ln -s TARGET LINK_NAME''' &lt;br /&gt;
&lt;br /&gt;
 ''Symlinks To a Directory''&lt;br /&gt;
 '''$ ln -s /mnt/my_drive/movies ~/my_movies '''&lt;br /&gt;
&lt;br /&gt;
 ''Overwriting Symlinks''&lt;br /&gt;
 ''To overwrite the destination path of the symlink, use the -f (--force) option''&lt;br /&gt;
 '''$ ln -sf my_file.txt my_link.txt'''&lt;br /&gt;
&lt;br /&gt;
 ''Removing Symlinks ''&lt;br /&gt;
 '''$ unlink symlink_to_remove'''&lt;br /&gt;
 '''$ rm symlink_to_remove'''&lt;br /&gt;
&lt;br /&gt;
== List harddisk|usb|volume|partitions  ==&lt;br /&gt;
 ''Get label names:''&lt;br /&gt;
 '''$ e2label /dev/sdXx '''&lt;br /&gt;
 '''$ /sbin/blkid | grep sdXx''''&lt;br /&gt;
 '''$ blkid /dev/sdXx | awk -F'&amp;quot;' '{print $2}''''&lt;br /&gt;
&lt;br /&gt;
 ''Set label name:''&lt;br /&gt;
 '''$ e2label /dev/sdXx MYNAME'''&lt;br /&gt;
 '''$ tune2fs -L MYNAME /dev/sdXx '''&lt;br /&gt;
&lt;br /&gt;
== Create filesystem with '''mkfs.ext4'''  ==&lt;br /&gt;
 '''$ mkfs.ext4 /dev/sda1 -L MYNAME'''&lt;br /&gt;
&lt;br /&gt;
== Create/Add new USER '''useradd'''==&lt;br /&gt;
 Useradd is built-in Linux command that can be found on any Linux system. However, creating new users with this low-level is a tedious task because it doesn't create the home directory and user password by default.&lt;br /&gt;
&lt;br /&gt;
 Adduser is not a standard Linux command. It’s essentially a Perl script that uses the useradd command in the background. This high-level utility  is more efficient in properly creating new users on Linux. It gives you the option to create the home directory, and set password along with a few more parameters.&lt;br /&gt;
&lt;br /&gt;
 [https://linuxhandbook.com/useradd-vs-adduser/ Difference between adduser and useradd commands]&lt;br /&gt;
 [https://linuxconfig.org/add-user-linux-command adduser vs useradd in Linux] &lt;br /&gt;
&lt;br /&gt;
 '''$ useradd [OPTIONS] USERNAME'''&lt;br /&gt;
&lt;br /&gt;
 '''$ cat /etc/default/useradd'''&lt;br /&gt;
 '''$ ls -la /etc/skel/'''&lt;br /&gt;
 '''$ cat /etc/login.defs'''&lt;br /&gt;
&lt;br /&gt;
 View default options:&lt;br /&gt;
 '''$ useradd -D '''&lt;br /&gt;
&lt;br /&gt;
 Change the default login shell&lt;br /&gt;
 '''$ useradd -D -s /bin/bash '''&lt;br /&gt;
 '''$ useradd -D | grep -i shell '''&lt;br /&gt;
&lt;br /&gt;
 To create a user without home directory&lt;br /&gt;
 '''$ useradd -M user '''&lt;br /&gt;
&lt;br /&gt;
 Create a user with changed login shell &lt;br /&gt;
 '''$ useradd -s /bin/sh user '''&lt;br /&gt;
&lt;br /&gt;
 Option to create a user home directory &lt;br /&gt;
 '''--create-home'''&lt;br /&gt;
 '''-m '''&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -m -u 10000 USERNAME -s /bin/bash '''&lt;br /&gt;
&lt;br /&gt;
 There is an option for adding an encrypted password via the '''-p''' option on useradd&lt;br /&gt;
 Note that the '''-p''' option '''doesn't allow you to input a plaintext password''', it expects you to  encrypt it first. &lt;br /&gt;
 This is intentionally difficult, because you should not do it! &lt;br /&gt;
 Just use the '''passwd''' command or '''chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 '''passwd USER'''&lt;br /&gt;
 or&lt;br /&gt;
 '''echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 [https://stackoverflow.com/questions/2150882/how-to-automatically-add-user-account-and-password-with-a-bash-script How to automatically add user account AND password with a Bash script?]&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER'''&lt;br /&gt;
 Create USER + Homedirectory + Bash as Shell&lt;br /&gt;
&lt;br /&gt;
 USER+HOME+SHELL+PASSWORD&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER &amp;amp;&amp;amp; echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
== Delete USER '''userdel'''==&lt;br /&gt;
 '''$ userdel [OPTIONS] USERNAME '''&lt;br /&gt;
&lt;br /&gt;
 Use the -r (--remove) option to force userdel to remove the user’s home directory and mail spool:&lt;br /&gt;
 '''$ userdel -r username '''&lt;br /&gt;
&lt;br /&gt;
 Kill all user’s running processes&lt;br /&gt;
 '''$ killall -u username '''&lt;br /&gt;
&lt;br /&gt;
 Another option is to use the -f (--force) option that tells userdel to forcefully remove the user account, even if the user is still logged in or if there are running processes that belong to the user.&lt;br /&gt;
 '''$ userdel -f username '''&lt;br /&gt;
&lt;br /&gt;
[https://linuxize.com/post/how-to-delete-users-in-linux-using-the-userdel-command/ How to Delete/Remove Users in Linux (userdel Command)]&lt;br /&gt;
&lt;br /&gt;
== '''GROUP, USER | GROUP VS PASSWD''' ==&lt;br /&gt;
&lt;br /&gt;
 https://teaching.idallen.com/cst8207/12f/notes/600_users_and_groups.html&lt;br /&gt;
&lt;br /&gt;
 https://www.unix.com/unix-for-dummies-questions-and-answers/162563-inconsistency-between-passwd-group.html&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/55107/why-dont-etc-group-and-etc-password-match&lt;br /&gt;
&lt;br /&gt;
 https://www.man7.org/linux/man-pages/man3/initgroups.3.html&lt;br /&gt;
&lt;br /&gt;
== chown ==&lt;br /&gt;
&lt;br /&gt;
 https://wiki.ubuntuusers.de/chown/&lt;br /&gt;
&lt;br /&gt;
== chmod ==&lt;br /&gt;
&lt;br /&gt;
 https://wiki.ubuntuusers.de/chmod/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== rbash | Restricted Bash ==&lt;br /&gt;
 '''$ rbash '''&lt;br /&gt;
 '''$ bash -r'''&lt;br /&gt;
&lt;br /&gt;
 https://www.tecmint.com/rbash-a-restricted-bash-shell-explained-with-practical-examples/&lt;br /&gt;
 https://www.thegeekdiary.com/rbash-set-restricted-shell-in-linux/&lt;br /&gt;
&lt;br /&gt;
 https://www.howtogeek.com/718074/how-to-use-restricted-shell-to-limit-what-a-linux-user-cando/&lt;br /&gt;
 https://ostechnix.com/how-to-limit-users-access-to-the-linux-system/&lt;br /&gt;
 https://averagelinuxuser.com/creating-new-user-linux/&lt;br /&gt;
 https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/&lt;br /&gt;
 https://www.howtoforge.com/user_password_creating_with_a_bash_script&lt;br /&gt;
&lt;br /&gt;
== Simple Script Jail ==&lt;br /&gt;
&lt;br /&gt;
 This is are the default settings for the USER to login and run a bash shell:&lt;br /&gt;
 '''$  chsh -s /bin/bash [USER] ''' &lt;br /&gt;
 &lt;br /&gt;
 This for the simple jail:&lt;br /&gt;
 '''$ chsh -s /home/[USER]/./run [USER] '''&lt;br /&gt;
&lt;br /&gt;
== Disable history ==&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-bash-shell-commands-history-on-linux&lt;br /&gt;
 https://www.cyberciti.biz/faq/disable-bash-shell-history-linux/&lt;br /&gt;
 https://www.thegeeksearch.com/how-to-disable-and-clear-linux-command-line-history/&lt;br /&gt;
&lt;br /&gt;
== Disable LASTLOGIN ==&lt;br /&gt;
 '''$ touch /home/user/.hushlogin'''&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-last-login-message-on-rhel-linux&lt;br /&gt;
 https://www.heatware.net/linux-unix/linux-how-to-disable-last-login-welcome-message/&lt;br /&gt;
&lt;br /&gt;
== type | command check ==&lt;br /&gt;
&lt;br /&gt;
 Check whether a command is built-in or not&lt;br /&gt;
 '''$ type [COMMAND]'''&lt;br /&gt;
&lt;br /&gt;
== RANDOM NUMBERS ==&lt;br /&gt;
 '''$ echo $RANDOM'''&lt;br /&gt;
 '''$ echo $(( $RANDOM % 9 + 0 ))'''&lt;br /&gt;
&lt;br /&gt;
 '''$ echo $(shuf -i 0-9 -n1)'''&lt;br /&gt;
&lt;br /&gt;
 '''$ od /dev/urandom  -A n -t d -N 1 '''&lt;br /&gt;
&lt;br /&gt;
 https://linuxhint.com/generate-random-number-bash/&lt;br /&gt;
 https://linuxconfig.org/generating-random-numbers-in-bash-with-examples&lt;br /&gt;
 https://www.delftstack.com/howto/linux/random-number-generation-in-bash/&lt;br /&gt;
&lt;br /&gt;
== RANDOM STRINGS ==&lt;br /&gt;
 '''$ echo $RANDOM | md5sum | head -c 1; echo; ''' &lt;br /&gt;
 '''$ tr -dc A-Za-z0-9 &amp;lt;/dev/urandom | head -c 1 ; echo ' ' '''&lt;br /&gt;
&lt;br /&gt;
 https://gist.github.com/earthgecko/3089509&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/230673/how-to-generate-a-random-string&lt;br /&gt;
 https://linuxhint.com/generate-random-string-bash/&lt;br /&gt;
 https://www.saotn.org/bash-function-to-generate-a-random-alphanumeric-string/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/a/709895/515538&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Bash&amp;diff=1107</id>
		<title>Bash</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Bash&amp;diff=1107"/>
		<updated>2023-05-03T07:27:48Z</updated>

		<summary type="html">&lt;p&gt;Geist: /* Create/Add new USER useradd */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Script ==&lt;br /&gt;
 '''$ type script'''&lt;br /&gt;
 '''$ chmod +x script'''&lt;br /&gt;
 '''$ ./script'''&lt;br /&gt;
 '''$ .script'''&lt;br /&gt;
 '''$ source script'''&lt;br /&gt;
 '''$ bash script'''&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
&lt;br /&gt;
== Command Line ==&lt;br /&gt;
 '''Everything is a file'''&lt;br /&gt;
 '''255 Byte'''&lt;br /&gt;
 The maximum length for a file name is 255 bytes.&lt;br /&gt;
 The maximum combined length of both the file name and path name is 4096 bytes.&lt;br /&gt;
 This length matches the PATH_MAX that is supported by the operating system.&lt;br /&gt;
 '''Names are case-sensitive'''&lt;br /&gt;
&lt;br /&gt;
==== Special chars to avoid in names/filenames ====&lt;br /&gt;
 /   Never&lt;br /&gt;
 \   Escaped&lt;br /&gt;
 -   Never at beginning&lt;br /&gt;
 []  Escaped&lt;br /&gt;
 {}  Escaped&lt;br /&gt;
 *   Escaped&lt;br /&gt;
 '   Escaped&lt;br /&gt;
 &amp;quot;   Escaped&lt;br /&gt;
&lt;br /&gt;
==== Wildcards ====&lt;br /&gt;
 '''*'''  asterisk        | any char&lt;br /&gt;
 '''?'''  question mark   | single char&lt;br /&gt;
 '''[]''' square brackets | set of single char or a range of chars&lt;br /&gt;
&lt;br /&gt;
==== List files and folders ====&lt;br /&gt;
 '''$ ls'''&lt;br /&gt;
 '''$ ls folder'''&lt;br /&gt;
 '''$ ls ./folder'''&lt;br /&gt;
 '''$ ls /path/folder'''&lt;br /&gt;
 '''$ ls ~/folder'''&lt;br /&gt;
 '''$ ls ~/folder/*.jpg'''&lt;br /&gt;
 '''$ ls ~/folder/*txt*'''&lt;br /&gt;
 '''$ ls -R folder''' (list of subfolders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -l''' (single column)&lt;br /&gt;
  '''-''' regular file&lt;br /&gt;
  '''_''' executable&lt;br /&gt;
  '''d''' directory&lt;br /&gt;
  '''l''' symbolic link&lt;br /&gt;
  '''s''' socket&lt;br /&gt;
  '''b''' block device&lt;br /&gt;
  '''c''' character device&lt;br /&gt;
  '''p''' named pipe&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -m''' (comma-separated list)&lt;br /&gt;
 '''$ ls -a''' (hidden files and folders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -F''' (file type)&lt;br /&gt;
 Symbols and file types&lt;br /&gt;
  '''*''' Executable&lt;br /&gt;
  '''/''' Directory&lt;br /&gt;
  '''@''' Symbolic link&lt;br /&gt;
  '''|''' FIFO&lt;br /&gt;
  '''=''' Socket&lt;br /&gt;
&lt;br /&gt;
 '''$ ls --color (content in color)'''&lt;br /&gt;
 '''$ dircolors'''&lt;br /&gt;
 '''$ dircolors --print-database'''&lt;br /&gt;
 '''$ ls -F --color'''&lt;br /&gt;
 '''$ la -la'''&lt;br /&gt;
 '''$ ls -r'''&lt;br /&gt;
 '''$ ls -X''' (sort by extension)&lt;br /&gt;
 '''$ ls -t''' (sort by date)&lt;br /&gt;
 '''$ ls -S''' (sort by content)&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
 '''$ ls -laS'''&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
&lt;br /&gt;
 '''$ pwd''' (current path)&lt;br /&gt;
&lt;br /&gt;
==== Change directory with '''cd'''====&lt;br /&gt;
 '''$ cd folder'''&lt;br /&gt;
 '''$ cd ~'''&lt;br /&gt;
 '''$ cd -'''&lt;br /&gt;
 '''$ cd ..'''&lt;br /&gt;
&lt;br /&gt;
==== Create and change current time of file '''touch'''====&lt;br /&gt;
 create new, empty file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 update access and modification time for file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 any desired time for file&lt;br /&gt;
 '''$ touch -t [[CC]YY]MMDDhhmm[.ss]file'''&lt;br /&gt;
&lt;br /&gt;
==== Create directory with '''mkdir'''====&lt;br /&gt;
 new directory&lt;br /&gt;
 '''$ mkdir folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory with subdirectories&lt;br /&gt;
 '''$ mkdir -p test/sub/folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory and show steps&lt;br /&gt;
 '''$ mkdir -v test/sub/folder'''&lt;br /&gt;
 '''$ mkdir -pv test/sub/folder'''&lt;br /&gt;
 &lt;br /&gt;
== Count files and directories, summary size and '''EXCLUDE''' folders ==&lt;br /&gt;
'''[https://unix.stackexchange.com/q/691703/515538 '''bash count files and directory, summary size and EXCLUDE folders that are fuse|sshfs''']'''&lt;br /&gt;
&lt;br /&gt;
==== Full size of a folder with '''du'''====&lt;br /&gt;
 get the full size of workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs workdir'''&lt;br /&gt;
&lt;br /&gt;
 get the full size of workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs --exclude=mysshf workdir'''&lt;br /&gt;
&lt;br /&gt;
==== Count files in folder with '''find'''====&lt;br /&gt;
 count files in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune -o \( -type f -print \) | wc -l'''&lt;br /&gt;
&lt;br /&gt;
==== Count folders in folder with '''find'''====&lt;br /&gt;
 count folders in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune \( -type d -print \)  | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Building blocks ==&lt;br /&gt;
&lt;br /&gt;
==== run several commands sequentially with ''';''' and '''&amp;amp;&amp;amp;''' ====&lt;br /&gt;
 executed sequential no matter if successfully or unsucessfully&lt;br /&gt;
 ''';'''&lt;br /&gt;
 '''$ ls /home ; ls notfound; ls ~'''&lt;br /&gt;
&lt;br /&gt;
 executed sequential if successfully run next&lt;br /&gt;
 '''&amp;amp;&amp;amp;'''&lt;br /&gt;
 '''$ ls /home &amp;amp;&amp;amp; ls notfound &amp;amp;&amp;amp; ls ~'''&lt;br /&gt;
&lt;br /&gt;
== PORT SCAN with bash's built-in /dev/tcp ==&lt;br /&gt;
'''check if host response on a give port with bash's built-in /dev/tcp'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 HOST_PORT=&amp;quot;80&amp;quot;&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 exit; '''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 for HOST_PORT in {1..1000}&lt;br /&gt;
 do&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 declare -A PORT_ON&lt;br /&gt;
 for HOST_PORT in {1..65535}&lt;br /&gt;
 do&lt;br /&gt;
    if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
        PORT_ON[${HOST_PORT}]=&amp;quot;ON&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
 done&lt;br /&gt;
 for i in ${!PORT_ON[*]}&lt;br /&gt;
 do&lt;br /&gt;
    echo -e &amp;quot;$i : ${PORT_ON[$i]}&amp;quot;&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
== watch ==&lt;br /&gt;
&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo&amp;quot;'''&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
== Firefox bash output ==&lt;br /&gt;
&lt;br /&gt;
 For the usage in bash:&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -d -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
 Load a page and press F5 in the tab(again and again or hold the F5 button pressed) and watch&lt;br /&gt;
 When i kill the a tab with the right pid i get the message in the tab, that the tab is crashed now&lt;br /&gt;
 &lt;br /&gt;
 ''' In Firefox, about:performance'''&lt;br /&gt;
&lt;br /&gt;
 But check also this in bash if i close or open and load a page tab:&lt;br /&gt;
 '''$ pidof firefox'''&lt;br /&gt;
 '''$ pidof firefox-esr'''&lt;br /&gt;
 '''$ pgrep firefox get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
 '''$ pgrep firefox-esr get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
&lt;br /&gt;
 Get parentid and childid&lt;br /&gt;
 '''$ ps aux | grep [f]irefox'''&lt;br /&gt;
 '''$ ps aux | grep [f]irefox | grep tab'''&lt;br /&gt;
&lt;br /&gt;
 You see the parentBuildID and something of the child/tab&lt;br /&gt;
 It looks like that you can't close the child/tab only the parentBuildID, if you kill the child/tab the tab will crash but not close(but killed).&lt;br /&gt;
&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | wc -l'''&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | grep tab | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Create Symbolic Links ==&lt;br /&gt;
 [https://man7.org/linux/man-pages/man1/ln.1.html ln|Linux manual page]&lt;br /&gt;
 ''Symlink To a File''&lt;br /&gt;
 '''$ ln -s [OPTIONS] TARGET LINKNAME'''&lt;br /&gt;
 '''$ ln -s TARGET LINK_NAME''' &lt;br /&gt;
&lt;br /&gt;
 ''Symlinks To a Directory''&lt;br /&gt;
 '''$ ln -s /mnt/my_drive/movies ~/my_movies '''&lt;br /&gt;
&lt;br /&gt;
 ''Overwriting Symlinks''&lt;br /&gt;
 ''To overwrite the destination path of the symlink, use the -f (--force) option''&lt;br /&gt;
 '''$ ln -sf my_file.txt my_link.txt'''&lt;br /&gt;
&lt;br /&gt;
 ''Removing Symlinks ''&lt;br /&gt;
 '''$ unlink symlink_to_remove'''&lt;br /&gt;
 '''$ rm symlink_to_remove'''&lt;br /&gt;
&lt;br /&gt;
== List harddisk|usb|volume|partitions  ==&lt;br /&gt;
 ''Get label names:''&lt;br /&gt;
 '''$ e2label /dev/sdXx '''&lt;br /&gt;
 '''$ /sbin/blkid | grep sdXx''''&lt;br /&gt;
 '''$ blkid /dev/sdXx | awk -F'&amp;quot;' '{print $2}''''&lt;br /&gt;
&lt;br /&gt;
 ''Set label name:''&lt;br /&gt;
 '''$ e2label /dev/sdXx MYNAME'''&lt;br /&gt;
 '''$ tune2fs -L MYNAME /dev/sdXx '''&lt;br /&gt;
&lt;br /&gt;
== Create filesystem with '''mkfs.ext4'''  ==&lt;br /&gt;
 '''$ mkfs.ext4 /dev/sda1 -L MYNAME'''&lt;br /&gt;
&lt;br /&gt;
== Create/Add new USER '''useradd'''==&lt;br /&gt;
 Useradd is built-in Linux command that can be found on any Linux system. However, creating new users with this low-level is a tedious task because it doesn't create the home directory and user password by default.&lt;br /&gt;
&lt;br /&gt;
 Adduser is not a standard Linux command. It’s essentially a Perl script that uses the useradd command in the background. This high-level utility  is more efficient in properly creating new users on Linux. It gives you the option to create the home directory, and set password along with a few more parameters.&lt;br /&gt;
&lt;br /&gt;
 [https://linuxhandbook.com/useradd-vs-adduser/ Difference between adduser and useradd commands]&lt;br /&gt;
 [https://linuxconfig.org/add-user-linux-command adduser vs useradd in Linux] &lt;br /&gt;
&lt;br /&gt;
 '''$ useradd [OPTIONS] USERNAME'''&lt;br /&gt;
&lt;br /&gt;
 '''$ cat /etc/default/useradd'''&lt;br /&gt;
 '''$ ls -la /etc/skel/'''&lt;br /&gt;
 '''$ cat /etc/login.defs'''&lt;br /&gt;
&lt;br /&gt;
 View default options:&lt;br /&gt;
 '''$ useradd -D '''&lt;br /&gt;
&lt;br /&gt;
 Change the default login shell&lt;br /&gt;
 '''$ useradd -D -s /bin/bash '''&lt;br /&gt;
 '''$ useradd -D | grep -i shell '''&lt;br /&gt;
&lt;br /&gt;
 To create a user without home directory&lt;br /&gt;
 '''$ useradd -M user '''&lt;br /&gt;
&lt;br /&gt;
 Create a user with changed login shell &lt;br /&gt;
 '''$ useradd -s /bin/sh user '''&lt;br /&gt;
&lt;br /&gt;
 Option to create a user home directory &lt;br /&gt;
 '''--create-home'''&lt;br /&gt;
 '''-m '''&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -m -u 10000 USERNAME -s /bin/bash '''&lt;br /&gt;
&lt;br /&gt;
 There is an option for adding an encrypted password via the '''-p''' option on useradd&lt;br /&gt;
 Note that the '''-p''' option '''doesn't allow you to input a plaintext password''', it expects you to  encrypt it first. &lt;br /&gt;
 This is intentionally difficult, because you should not do it! &lt;br /&gt;
 Just use the '''passwd''' command or '''chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 '''passwd USER'''&lt;br /&gt;
 or&lt;br /&gt;
 '''echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 [https://stackoverflow.com/questions/2150882/how-to-automatically-add-user-account-and-password-with-a-bash-script How to automatically add user account AND password with a Bash script?]&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER'''&lt;br /&gt;
 Create USER + Homedirectory + Bash as Shell&lt;br /&gt;
&lt;br /&gt;
 USER+HOME+SHELL+PASSWORD&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER &amp;amp;&amp;amp; echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
== '''GROUP, USER | GROUP VS PASSWD''' ==&lt;br /&gt;
&lt;br /&gt;
 https://teaching.idallen.com/cst8207/12f/notes/600_users_and_groups.html&lt;br /&gt;
&lt;br /&gt;
 https://www.unix.com/unix-for-dummies-questions-and-answers/162563-inconsistency-between-passwd-group.html&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/55107/why-dont-etc-group-and-etc-password-match&lt;br /&gt;
&lt;br /&gt;
 https://www.man7.org/linux/man-pages/man3/initgroups.3.html&lt;br /&gt;
&lt;br /&gt;
== Delete USER '''userdel'''==&lt;br /&gt;
 '''$ userdel [OPTIONS] USERNAME '''&lt;br /&gt;
&lt;br /&gt;
 Use the -r (--remove) option to force userdel to remove the user’s home directory and mail spool:&lt;br /&gt;
 '''$ userdel -r username '''&lt;br /&gt;
&lt;br /&gt;
 Kill all user’s running processes&lt;br /&gt;
 '''$ killall -u username '''&lt;br /&gt;
&lt;br /&gt;
 Another option is to use the -f (--force) option that tells userdel to forcefully remove the user account, even if the user is still logged in or if there are running processes that belong to the user.&lt;br /&gt;
 '''$ userdel -f username '''&lt;br /&gt;
&lt;br /&gt;
[https://linuxize.com/post/how-to-delete-users-in-linux-using-the-userdel-command/ How to Delete/Remove Users in Linux (userdel Command)]&lt;br /&gt;
&lt;br /&gt;
== rbash | Restricted Bash ==&lt;br /&gt;
 '''$ rbash '''&lt;br /&gt;
 '''$ bash -r'''&lt;br /&gt;
&lt;br /&gt;
 https://www.tecmint.com/rbash-a-restricted-bash-shell-explained-with-practical-examples/&lt;br /&gt;
 https://www.thegeekdiary.com/rbash-set-restricted-shell-in-linux/&lt;br /&gt;
&lt;br /&gt;
 https://www.howtogeek.com/718074/how-to-use-restricted-shell-to-limit-what-a-linux-user-cando/&lt;br /&gt;
 https://ostechnix.com/how-to-limit-users-access-to-the-linux-system/&lt;br /&gt;
 https://averagelinuxuser.com/creating-new-user-linux/&lt;br /&gt;
 https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/&lt;br /&gt;
 https://www.howtoforge.com/user_password_creating_with_a_bash_script&lt;br /&gt;
&lt;br /&gt;
== Simple Script Jail ==&lt;br /&gt;
&lt;br /&gt;
 This is are the default settings for the USER to login and run a bash shell:&lt;br /&gt;
 '''$  chsh -s /bin/bash [USER] ''' &lt;br /&gt;
 &lt;br /&gt;
 This for the simple jail:&lt;br /&gt;
 '''$ chsh -s /home/[USER]/./run [USER] '''&lt;br /&gt;
&lt;br /&gt;
== Disable history ==&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-bash-shell-commands-history-on-linux&lt;br /&gt;
 https://www.cyberciti.biz/faq/disable-bash-shell-history-linux/&lt;br /&gt;
 https://www.thegeeksearch.com/how-to-disable-and-clear-linux-command-line-history/&lt;br /&gt;
&lt;br /&gt;
== Disable LASTLOGIN ==&lt;br /&gt;
 '''$ touch /home/user/.hushlogin'''&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-last-login-message-on-rhel-linux&lt;br /&gt;
 https://www.heatware.net/linux-unix/linux-how-to-disable-last-login-welcome-message/&lt;br /&gt;
&lt;br /&gt;
== type | command check ==&lt;br /&gt;
&lt;br /&gt;
 Check whether a command is built-in or not&lt;br /&gt;
 '''$ type [COMMAND]'''&lt;br /&gt;
&lt;br /&gt;
== RANDOM NUMBERS ==&lt;br /&gt;
 '''$ echo $RANDOM'''&lt;br /&gt;
 '''$ echo $(( $RANDOM % 9 + 0 ))'''&lt;br /&gt;
&lt;br /&gt;
 '''$ echo $(shuf -i 0-9 -n1)'''&lt;br /&gt;
&lt;br /&gt;
 '''$ od /dev/urandom  -A n -t d -N 1 '''&lt;br /&gt;
&lt;br /&gt;
 https://linuxhint.com/generate-random-number-bash/&lt;br /&gt;
 https://linuxconfig.org/generating-random-numbers-in-bash-with-examples&lt;br /&gt;
 https://www.delftstack.com/howto/linux/random-number-generation-in-bash/&lt;br /&gt;
&lt;br /&gt;
== RANDOM STRINGS ==&lt;br /&gt;
 '''$ echo $RANDOM | md5sum | head -c 1; echo; ''' &lt;br /&gt;
 '''$ tr -dc A-Za-z0-9 &amp;lt;/dev/urandom | head -c 1 ; echo ' ' '''&lt;br /&gt;
&lt;br /&gt;
 https://gist.github.com/earthgecko/3089509&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/230673/how-to-generate-a-random-string&lt;br /&gt;
 https://linuxhint.com/generate-random-string-bash/&lt;br /&gt;
 https://www.saotn.org/bash-function-to-generate-a-random-alphanumeric-string/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/a/709895/515538&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
	<entry>
		<id>http://robopagex.com/index.php?title=Bash&amp;diff=1106</id>
		<title>Bash</title>
		<link rel="alternate" type="text/html" href="http://robopagex.com/index.php?title=Bash&amp;diff=1106"/>
		<updated>2023-05-03T07:27:20Z</updated>

		<summary type="html">&lt;p&gt;Geist: /* Create/Add new USER useradd */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Script ==&lt;br /&gt;
 '''$ type script'''&lt;br /&gt;
 '''$ chmod +x script'''&lt;br /&gt;
 '''$ ./script'''&lt;br /&gt;
 '''$ .script'''&lt;br /&gt;
 '''$ source script'''&lt;br /&gt;
 '''$ bash script'''&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
&lt;br /&gt;
== Command Line ==&lt;br /&gt;
 '''Everything is a file'''&lt;br /&gt;
 '''255 Byte'''&lt;br /&gt;
 The maximum length for a file name is 255 bytes.&lt;br /&gt;
 The maximum combined length of both the file name and path name is 4096 bytes.&lt;br /&gt;
 This length matches the PATH_MAX that is supported by the operating system.&lt;br /&gt;
 '''Names are case-sensitive'''&lt;br /&gt;
&lt;br /&gt;
==== Special chars to avoid in names/filenames ====&lt;br /&gt;
 /   Never&lt;br /&gt;
 \   Escaped&lt;br /&gt;
 -   Never at beginning&lt;br /&gt;
 []  Escaped&lt;br /&gt;
 {}  Escaped&lt;br /&gt;
 *   Escaped&lt;br /&gt;
 '   Escaped&lt;br /&gt;
 &amp;quot;   Escaped&lt;br /&gt;
&lt;br /&gt;
==== Wildcards ====&lt;br /&gt;
 '''*'''  asterisk        | any char&lt;br /&gt;
 '''?'''  question mark   | single char&lt;br /&gt;
 '''[]''' square brackets | set of single char or a range of chars&lt;br /&gt;
&lt;br /&gt;
==== List files and folders ====&lt;br /&gt;
 '''$ ls'''&lt;br /&gt;
 '''$ ls folder'''&lt;br /&gt;
 '''$ ls ./folder'''&lt;br /&gt;
 '''$ ls /path/folder'''&lt;br /&gt;
 '''$ ls ~/folder'''&lt;br /&gt;
 '''$ ls ~/folder/*.jpg'''&lt;br /&gt;
 '''$ ls ~/folder/*txt*'''&lt;br /&gt;
 '''$ ls -R folder''' (list of subfolders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -l''' (single column)&lt;br /&gt;
  '''-''' regular file&lt;br /&gt;
  '''_''' executable&lt;br /&gt;
  '''d''' directory&lt;br /&gt;
  '''l''' symbolic link&lt;br /&gt;
  '''s''' socket&lt;br /&gt;
  '''b''' block device&lt;br /&gt;
  '''c''' character device&lt;br /&gt;
  '''p''' named pipe&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -m''' (comma-separated list)&lt;br /&gt;
 '''$ ls -a''' (hidden files and folders)&lt;br /&gt;
&lt;br /&gt;
 '''$ ls -F''' (file type)&lt;br /&gt;
 Symbols and file types&lt;br /&gt;
  '''*''' Executable&lt;br /&gt;
  '''/''' Directory&lt;br /&gt;
  '''@''' Symbolic link&lt;br /&gt;
  '''|''' FIFO&lt;br /&gt;
  '''=''' Socket&lt;br /&gt;
&lt;br /&gt;
 '''$ ls --color (content in color)'''&lt;br /&gt;
 '''$ dircolors'''&lt;br /&gt;
 '''$ dircolors --print-database'''&lt;br /&gt;
 '''$ ls -F --color'''&lt;br /&gt;
 '''$ la -la'''&lt;br /&gt;
 '''$ ls -r'''&lt;br /&gt;
 '''$ ls -X''' (sort by extension)&lt;br /&gt;
 '''$ ls -t''' (sort by date)&lt;br /&gt;
 '''$ ls -S''' (sort by content)&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
 '''$ ls -laS'''&lt;br /&gt;
 '''$ ls -h'''&lt;br /&gt;
&lt;br /&gt;
 '''$ pwd''' (current path)&lt;br /&gt;
&lt;br /&gt;
==== Change directory with '''cd'''====&lt;br /&gt;
 '''$ cd folder'''&lt;br /&gt;
 '''$ cd ~'''&lt;br /&gt;
 '''$ cd -'''&lt;br /&gt;
 '''$ cd ..'''&lt;br /&gt;
&lt;br /&gt;
==== Create and change current time of file '''touch'''====&lt;br /&gt;
 create new, empty file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 update access and modification time for file&lt;br /&gt;
 '''$ touch file'''&lt;br /&gt;
&lt;br /&gt;
 any desired time for file&lt;br /&gt;
 '''$ touch -t [[CC]YY]MMDDhhmm[.ss]file'''&lt;br /&gt;
&lt;br /&gt;
==== Create directory with '''mkdir'''====&lt;br /&gt;
 new directory&lt;br /&gt;
 '''$ mkdir folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory with subdirectories&lt;br /&gt;
 '''$ mkdir -p test/sub/folder'''&lt;br /&gt;
&lt;br /&gt;
 create directory and show steps&lt;br /&gt;
 '''$ mkdir -v test/sub/folder'''&lt;br /&gt;
 '''$ mkdir -pv test/sub/folder'''&lt;br /&gt;
 &lt;br /&gt;
== Count files and directories, summary size and '''EXCLUDE''' folders ==&lt;br /&gt;
'''[https://unix.stackexchange.com/q/691703/515538 '''bash count files and directory, summary size and EXCLUDE folders that are fuse|sshfs''']'''&lt;br /&gt;
&lt;br /&gt;
==== Full size of a folder with '''du'''====&lt;br /&gt;
 get the full size of workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs workdir'''&lt;br /&gt;
&lt;br /&gt;
 get the full size of workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ du -hs --exclude=mysshf workdir'''&lt;br /&gt;
&lt;br /&gt;
==== Count files in folder with '''find'''====&lt;br /&gt;
 count files in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type f -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count files in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune -o \( -type f -print \) | wc -l'''&lt;br /&gt;
&lt;br /&gt;
==== Count folders in folder with '''find'''====&lt;br /&gt;
 count folders in workdir | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | no fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -type d -not -path &amp;quot;*mysshfs*&amp;quot; | wc -l'''&lt;br /&gt;
&lt;br /&gt;
 count folders in workdir, excluding mysshfs | fuse/sshfs in use&lt;br /&gt;
 '''$ find workdir -path &amp;quot;*/mysshfs/*&amp;quot; -prune \( -type d -print \)  | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Building blocks ==&lt;br /&gt;
&lt;br /&gt;
==== run several commands sequentially with ''';''' and '''&amp;amp;&amp;amp;''' ====&lt;br /&gt;
 executed sequential no matter if successfully or unsucessfully&lt;br /&gt;
 ''';'''&lt;br /&gt;
 '''$ ls /home ; ls notfound; ls ~'''&lt;br /&gt;
&lt;br /&gt;
 executed sequential if successfully run next&lt;br /&gt;
 '''&amp;amp;&amp;amp;'''&lt;br /&gt;
 '''$ ls /home &amp;amp;&amp;amp; ls notfound &amp;amp;&amp;amp; ls ~'''&lt;br /&gt;
&lt;br /&gt;
== PORT SCAN with bash's built-in /dev/tcp ==&lt;br /&gt;
'''check if host response on a give port with bash's built-in /dev/tcp'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 HOST_PORT=&amp;quot;80&amp;quot;&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 exit; '''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 for HOST_PORT in {1..1000}&lt;br /&gt;
 do&lt;br /&gt;
 if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | ON&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
    echo -e &amp;quot;PORT: ${HOST_PORT} | OF&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
 '''#!/bin/bash&lt;br /&gt;
 HOST_NAME=&amp;quot;127.1&amp;quot;&lt;br /&gt;
 declare -A PORT_ON&lt;br /&gt;
 for HOST_PORT in {1..65535}&lt;br /&gt;
 do&lt;br /&gt;
    if ( (exec 3&amp;lt;&amp;gt;/dev/tcp/${HOST_NAME}/${HOST_PORT}) 2&amp;gt; /dev/null); then&lt;br /&gt;
        PORT_ON[${HOST_PORT}]=&amp;quot;ON&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
 done&lt;br /&gt;
 for i in ${!PORT_ON[*]}&lt;br /&gt;
 do&lt;br /&gt;
    echo -e &amp;quot;$i : ${PORT_ON[$i]}&amp;quot;&lt;br /&gt;
 done&lt;br /&gt;
 exit;'''&lt;br /&gt;
&lt;br /&gt;
== watch ==&lt;br /&gt;
&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo&amp;quot;'''&lt;br /&gt;
 '''$ watch -t -n 0.1 &amp;quot;grep \&amp;quot;^[c]pu MHz\&amp;quot; /proc/cpuinfo &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
== Firefox bash output ==&lt;br /&gt;
&lt;br /&gt;
 For the usage in bash:&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 1 &amp;quot;ps aux | grep [f]irefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox&amp;quot;'''&lt;br /&gt;
 '''$ watch -n 0.1 &amp;quot;ps aux | grep /usr/lib/firefox-esr/firefox &amp;amp;&amp;amp; free -m&amp;quot;'''&lt;br /&gt;
 '''$ watch -d -n 0.1 &amp;quot;ps aux | grep [f]irefox&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
 Load a page and press F5 in the tab(again and again or hold the F5 button pressed) and watch&lt;br /&gt;
 When i kill the a tab with the right pid i get the message in the tab, that the tab is crashed now&lt;br /&gt;
 &lt;br /&gt;
 ''' In Firefox, about:performance'''&lt;br /&gt;
&lt;br /&gt;
 But check also this in bash if i close or open and load a page tab:&lt;br /&gt;
 '''$ pidof firefox'''&lt;br /&gt;
 '''$ pidof firefox-esr'''&lt;br /&gt;
 '''$ pgrep firefox get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
 '''$ pgrep firefox-esr get the main/parentid of one or &amp;quot;n&amp;quot; profiles'''&lt;br /&gt;
&lt;br /&gt;
 Get parentid and childid&lt;br /&gt;
 '''$ ps aux | grep [f]irefox'''&lt;br /&gt;
 '''$ ps aux | grep [f]irefox | grep tab'''&lt;br /&gt;
&lt;br /&gt;
 You see the parentBuildID and something of the child/tab&lt;br /&gt;
 It looks like that you can't close the child/tab only the parentBuildID, if you kill the child/tab the tab will crash but not close(but killed).&lt;br /&gt;
&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | wc -l'''&lt;br /&gt;
 '''$ ps -ef | grep [f]irefox | grep tab | wc -l'''&lt;br /&gt;
&lt;br /&gt;
== Create Symbolic Links ==&lt;br /&gt;
 [https://man7.org/linux/man-pages/man1/ln.1.html ln|Linux manual page]&lt;br /&gt;
 ''Symlink To a File''&lt;br /&gt;
 '''$ ln -s [OPTIONS] TARGET LINKNAME'''&lt;br /&gt;
 '''$ ln -s TARGET LINK_NAME''' &lt;br /&gt;
&lt;br /&gt;
 ''Symlinks To a Directory''&lt;br /&gt;
 '''$ ln -s /mnt/my_drive/movies ~/my_movies '''&lt;br /&gt;
&lt;br /&gt;
 ''Overwriting Symlinks''&lt;br /&gt;
 ''To overwrite the destination path of the symlink, use the -f (--force) option''&lt;br /&gt;
 '''$ ln -sf my_file.txt my_link.txt'''&lt;br /&gt;
&lt;br /&gt;
 ''Removing Symlinks ''&lt;br /&gt;
 '''$ unlink symlink_to_remove'''&lt;br /&gt;
 '''$ rm symlink_to_remove'''&lt;br /&gt;
&lt;br /&gt;
== List harddisk|usb|volume|partitions  ==&lt;br /&gt;
 ''Get label names:''&lt;br /&gt;
 '''$ e2label /dev/sdXx '''&lt;br /&gt;
 '''$ /sbin/blkid | grep sdXx''''&lt;br /&gt;
 '''$ blkid /dev/sdXx | awk -F'&amp;quot;' '{print $2}''''&lt;br /&gt;
&lt;br /&gt;
 ''Set label name:''&lt;br /&gt;
 '''$ e2label /dev/sdXx MYNAME'''&lt;br /&gt;
 '''$ tune2fs -L MYNAME /dev/sdXx '''&lt;br /&gt;
&lt;br /&gt;
== Create filesystem with '''mkfs.ext4'''  ==&lt;br /&gt;
 '''$ mkfs.ext4 /dev/sda1 -L MYNAME'''&lt;br /&gt;
&lt;br /&gt;
== Create/Add new USER '''useradd'''==&lt;br /&gt;
 Useradd is built-in Linux command that can be found on any Linux system. However, creating new users with this low-level is a tedious task because it doesn't create the home directory and user password by default.&lt;br /&gt;
&lt;br /&gt;
 Adduser is not a standard Linux command. It’s essentially a Perl script that uses the useradd command in the background. This high-level utility  is more efficient in properly creating new users on Linux. It gives you the option to create the home directory, and set password along with a few more parameters.&lt;br /&gt;
&lt;br /&gt;
 [https://linuxhandbook.com/useradd-vs-adduser/ Difference between adduser and useradd commands]&lt;br /&gt;
 [https://linuxconfig.org/add-user-linux-command adduser vs useradd in Linux] &lt;br /&gt;
&lt;br /&gt;
 '''$ useradd [OPTIONS] USERNAME'''&lt;br /&gt;
&lt;br /&gt;
 '''$ cat /etc/default/useradd'''&lt;br /&gt;
 '''$ ls -la /etc/skel/'''&lt;br /&gt;
 '''$ cat /etc/login.defs'''&lt;br /&gt;
&lt;br /&gt;
 View default options:&lt;br /&gt;
 '''$ useradd -D '''&lt;br /&gt;
&lt;br /&gt;
 Change the default login shell&lt;br /&gt;
 '''$ useradd -D -s /bin/bash '''&lt;br /&gt;
 '''$ useradd -D | grep -i shell '''&lt;br /&gt;
&lt;br /&gt;
 To create a user without home directory&lt;br /&gt;
 '''$ useradd -M user '''&lt;br /&gt;
&lt;br /&gt;
 Create a user with changed login shell &lt;br /&gt;
 '''$ useradd -s /bin/sh user '''&lt;br /&gt;
&lt;br /&gt;
 Option to create a user home directory &lt;br /&gt;
 '''--create-home'''&lt;br /&gt;
 '''-m '''&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -m -u 10000 USERNAME -s /bin/bash '''&lt;br /&gt;
&lt;br /&gt;
 There is an option for adding an encrypted password via the '''-p''' option on useradd&lt;br /&gt;
 Note that the '''-p''' option '''doesn't allow you to input a plaintext password''', it expects you to  encrypt it first. &lt;br /&gt;
 This is intentionally difficult, because you should not do it! &lt;br /&gt;
 Just use the '''passwd''' command or '''chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 '''passwd USER'''&lt;br /&gt;
 or&lt;br /&gt;
 '''echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
 [https://stackoverflow.com/questions/2150882/how-to-automatically-add-user-account-and-password-with-a-bash-script How to automatically add user account AND password with a Bash script?]&lt;br /&gt;
&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER'''&lt;br /&gt;
 Create USER + Homedirectory + Bash as Shell&lt;br /&gt;
&lt;br /&gt;
 USER+HOME+SHELL+PASSWORD&lt;br /&gt;
 '''$ /sbin/useradd -ms /bin/bash USER &amp;amp;&amp;amp; echo USER:NEWPASSWORD | /sbin/chpasswd'''&lt;br /&gt;
&lt;br /&gt;
'''GROUP, USER | GROUP VS PASSWD'''&lt;br /&gt;
https://teaching.idallen.com/cst8207/12f/notes/600_users_and_groups.html&lt;br /&gt;
https://www.unix.com/unix-for-dummies-questions-and-answers/162563-inconsistency-between-passwd-group.html&lt;br /&gt;
https://unix.stackexchange.com/questions/55107/why-dont-etc-group-and-etc-password-match&lt;br /&gt;
https://www.man7.org/linux/man-pages/man3/initgroups.3.html&lt;br /&gt;
&lt;br /&gt;
== Delete USER '''userdel'''==&lt;br /&gt;
 '''$ userdel [OPTIONS] USERNAME '''&lt;br /&gt;
&lt;br /&gt;
 Use the -r (--remove) option to force userdel to remove the user’s home directory and mail spool:&lt;br /&gt;
 '''$ userdel -r username '''&lt;br /&gt;
&lt;br /&gt;
 Kill all user’s running processes&lt;br /&gt;
 '''$ killall -u username '''&lt;br /&gt;
&lt;br /&gt;
 Another option is to use the -f (--force) option that tells userdel to forcefully remove the user account, even if the user is still logged in or if there are running processes that belong to the user.&lt;br /&gt;
 '''$ userdel -f username '''&lt;br /&gt;
&lt;br /&gt;
[https://linuxize.com/post/how-to-delete-users-in-linux-using-the-userdel-command/ How to Delete/Remove Users in Linux (userdel Command)]&lt;br /&gt;
&lt;br /&gt;
== rbash | Restricted Bash ==&lt;br /&gt;
 '''$ rbash '''&lt;br /&gt;
 '''$ bash -r'''&lt;br /&gt;
&lt;br /&gt;
 https://www.tecmint.com/rbash-a-restricted-bash-shell-explained-with-practical-examples/&lt;br /&gt;
 https://www.thegeekdiary.com/rbash-set-restricted-shell-in-linux/&lt;br /&gt;
&lt;br /&gt;
 https://www.howtogeek.com/718074/how-to-use-restricted-shell-to-limit-what-a-linux-user-cando/&lt;br /&gt;
 https://ostechnix.com/how-to-limit-users-access-to-the-linux-system/&lt;br /&gt;
 https://averagelinuxuser.com/creating-new-user-linux/&lt;br /&gt;
 https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/&lt;br /&gt;
 https://www.howtoforge.com/user_password_creating_with_a_bash_script&lt;br /&gt;
&lt;br /&gt;
== Simple Script Jail ==&lt;br /&gt;
&lt;br /&gt;
 This is are the default settings for the USER to login and run a bash shell:&lt;br /&gt;
 '''$  chsh -s /bin/bash [USER] ''' &lt;br /&gt;
 &lt;br /&gt;
 This for the simple jail:&lt;br /&gt;
 '''$ chsh -s /home/[USER]/./run [USER] '''&lt;br /&gt;
&lt;br /&gt;
== Disable history ==&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-bash-shell-commands-history-on-linux&lt;br /&gt;
 https://www.cyberciti.biz/faq/disable-bash-shell-history-linux/&lt;br /&gt;
 https://www.thegeeksearch.com/how-to-disable-and-clear-linux-command-line-history/&lt;br /&gt;
&lt;br /&gt;
== Disable LASTLOGIN ==&lt;br /&gt;
 '''$ touch /home/user/.hushlogin'''&lt;br /&gt;
&lt;br /&gt;
 https://linuxconfig.org/how-to-disable-last-login-message-on-rhel-linux&lt;br /&gt;
 https://www.heatware.net/linux-unix/linux-how-to-disable-last-login-welcome-message/&lt;br /&gt;
&lt;br /&gt;
== type | command check ==&lt;br /&gt;
&lt;br /&gt;
 Check whether a command is built-in or not&lt;br /&gt;
 '''$ type [COMMAND]'''&lt;br /&gt;
&lt;br /&gt;
== RANDOM NUMBERS ==&lt;br /&gt;
 '''$ echo $RANDOM'''&lt;br /&gt;
 '''$ echo $(( $RANDOM % 9 + 0 ))'''&lt;br /&gt;
&lt;br /&gt;
 '''$ echo $(shuf -i 0-9 -n1)'''&lt;br /&gt;
&lt;br /&gt;
 '''$ od /dev/urandom  -A n -t d -N 1 '''&lt;br /&gt;
&lt;br /&gt;
 https://linuxhint.com/generate-random-number-bash/&lt;br /&gt;
 https://linuxconfig.org/generating-random-numbers-in-bash-with-examples&lt;br /&gt;
 https://www.delftstack.com/howto/linux/random-number-generation-in-bash/&lt;br /&gt;
&lt;br /&gt;
== RANDOM STRINGS ==&lt;br /&gt;
 '''$ echo $RANDOM | md5sum | head -c 1; echo; ''' &lt;br /&gt;
 '''$ tr -dc A-Za-z0-9 &amp;lt;/dev/urandom | head -c 1 ; echo ' ' '''&lt;br /&gt;
&lt;br /&gt;
 https://gist.github.com/earthgecko/3089509&lt;br /&gt;
&lt;br /&gt;
 https://unix.stackexchange.com/questions/230673/how-to-generate-a-random-string&lt;br /&gt;
 https://linuxhint.com/generate-random-string-bash/&lt;br /&gt;
 https://www.saotn.org/bash-function-to-generate-a-random-alphanumeric-string/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://unix.stackexchange.com/a/709895/515538&lt;/div&gt;</summary>
		<author><name>Geist</name></author>
		
	</entry>
</feed>