redhat:base-redhat:basics-redhat

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
redhat:base-redhat:basics-redhat [2017/10/24 12:45] – [Basis Know-How Redhat Systems] michaelredhat:base-redhat:basics-redhat [2019/06/11 10:24] (current) – [System Information] michael
Line 6: Line 6:
  
 ===== Basis Know-How Redhat Systems ===== ===== Basis Know-How Redhat Systems =====
 +
 +  * [[linux:user-and-groups|]]
 +  * [[linux:dateirechte|]]
 +
  
 <WRAP center box 100%> <WRAP center box 100%>
Line 11: Line 15:
 ''Grundlegende Systemwartung, durch Installation, von aktuellen Paketen und Upgraden des Kernels.'' ''Grundlegende Systemwartung, durch Installation, von aktuellen Paketen und Upgraden des Kernels.''
  
-<wrap em>Upgrade System and Packages:</wrap><code># yum -y update</code>+<wrap em>Upgrade System and Packages:</wrap><code># yum update -y</code>
 </WRAP> </WRAP>
  
Line 27: Line 31:
 ==== motd - Message of the day==== ==== motd - Message of the day====
 ''Eigene motd (Login-Nachricht), nach dem Aufbau einer neuen SSH-Verbindung anzeigen lassen:'' ''Eigene motd (Login-Nachricht), nach dem Aufbau einer neuen SSH-Verbindung anzeigen lassen:''
- 
-Add description and serial number to motd: 
  
 <code># echo ' <code># echo '
Line 55: Line 57:
 ''<wrap em>Root Privilegien für User:</wrap>'' ''<wrap em>Root Privilegien für User:</wrap>''
  
-''As root, run this command to add your new user to the wheel group (substitute the highlighted word with your new user):'' <code># gpasswd -a michael wheel</code>+''As root, run this command to add your new user to the wheel group (substitute the highlighted word with your new user):'' <code># usermod -aG wheel michael</code>
 ''Now your user can run commands with super user privileges!''  ''Now your user can run commands with super user privileges!'' 
 +
 +''<wrap em>Root Privilegien für User & without PW:</wrap>''
 +
 +<code># echo "michael ALL=NOPASSWD: ALL" > /etc/sudoers.d/michael</code>
 +
 +</WRAP>
 +
 +<WRAP center box 100%>
 +==== Die Grösse eines Ordners anzeigen ====
 +''Zeigt die effektive Grösse - human readable und rekursiv über alle Files dar.''
 +<code># du -hs foswiki/</code>
 +<sxh plain; gutter: false;>4.6G    foswiki/</sxh>
 +
 +</WRAP>
 +
 +<WRAP center box 100%>
 +==== SSH Login auf Server mit DNS oder User-Hash Problemen ====
 +''Das normale Login auf einen Linux Server via SSH:''
 +<code># ssh vrh7f</code>
 +
 +<sxh plain; gutter: false;>
 +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 +@       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @
 +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 +The RSA host key for vb7gl9 has changed,
 +and the key for the corresponding IP address 172.18.13.12
 +is unknown. This could either mean that
 +DNS SPOOFING is happening or the IP address for the host
 +and its host key have changed at the same time.
 +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 +@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
 +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 +IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
 +Someone could be eavesdropping on you right now (man-in-the-middle attack)!
 +It is also possible that a host key has just been changed.
 +The fingerprint for the RSA key sent by the remote host is
 +SHA256:o7win3mceJwnnehEyiVaOM6ePdiKOWivbtUMhxHVr58.
 +Please contact your system administrator.
 +Add correct host key in /home/rebermi/.ssh/known_hosts to get rid of this messag                                                                                 e.
 +Offending RSA key in /etc/ssh/ssh_known_hosts:778
 +RSA host key for vb7gl9 has changed and you have requested strict checking.
 +Host key verification failed.</sxh>
 +
 +----
 +
 +''<wrap em>Trotz Error auf Server einloggen:</wrap>''
 +
 +<code># ssh -o stricthostkeychecking=no vrh7f</code>
 +
 </WRAP> </WRAP>
  
Line 337: Line 388:
 </WRAP> </WRAP>
  
 +
 +<WRAP center box 100%>
 +==== Show what exactly a Package does on installation ====
 +''rpm -qp --scripts PACKAGENAME''
 +<code># rpm -qp --scripts patchman-1.0.20-1.noarch.rpm</code>
 +<sxh plain; gutter: false;>
 +postinstall scriptlet (using /bin/sh):
 +#!/bin/sh
 +
 +if [ ! -e /etc/httpd/conf.d/patchman.conf ] ; then
 +    cp /etc/patchman/apache.conf.example /etc/httpd/conf.d/patchman.conf
 +fi
 +
 +if ! grep /usr/lib/python2.7/site-packages /etc/httpd/conf.d/patchman.conf >/dev/null 2>&1 ; then
 +    sed -i -e "s/^\(Define patchman_pythonpath\).*/\1 \/usr\/lib\/python2.7\/site-packages/" \
 +    /etc/httpd/conf.d/patchman.conf
 +fi
 +
 +service httpd reload
 +
 +patchman-set-secret-key
 +chown apache /etc/patchman/local_settings.py
 +
 +mkdir -p /var/lib/patchman/db
 +patchman-manage collectstatic --noinput
 +
 +patchman-manage makemigrations
 +patchman-manage migrate --run-syncdb
 +
 +chown -R apache:apache /var/lib/patchman
 +chcon --type httpd_sys_rw_content_t /var/lib/patchman/db/patchman.db
 +
 +echo
 +echo "Remember to run 'patchman-manage createsuperuser' to create a user."
 +echo
 +</sxh>
 +</WRAP>
  
 ---- ----
  • redhat/base-redhat/basics-redhat.1508841932.txt.gz
  • Last modified: 2017/10/24 12:45
  • by michael