RHKN
Lernen
Lernen
Set of flashcards Details
Flashcards | 67 |
---|---|
Language | Deutsch |
Category | Technology |
Level | Other |
Created / Updated | 03.02.2025 / 03.02.2025 |
Weblink |
https://card2brain.ch/box/20250203_rhkn
|
Embed |
<iframe src="https://card2brain.ch/box/20250203_rhkn/embed" width="780" height="150" scrolling="no" frameborder="0"></iframe>
|
Create or copy sets of flashcards
With an upgrade you can create or copy an unlimited number of sets and use many more additional features.
Log in to see all the cards.
SSH
ssh-keygen (key genereiren)
vi /etc/hosts (Eintrag des Servers)
ssh-copy-id <name vom hosts eintrag> (Public key zum zielserver kopieren)
Probleme mit /.autorelabel
mount -o remount,rw /
rm -rf /.autorelabel
restorecon -Rv /
Anzeige der konfigurieten Time date Settings
timedatectl status
Building Images from Containerfile
podman build -t i<magename> <pathContainerFile>
Anzeigen der defualt extends, set to 2M
vgdisplay
- -s 2M ond vgcreate
copy test.txt to every new useradd
cp text.txt /etc/skel
suche files ggrösser 200M und ls -d
find / -size +200M -type f -exec ls -l {} \;
but command sleep inifity with lowest prio in student auto start config
echo "nice -n 19 sleep infinity &" >> .bash_profile
Use systemd mount that is provided by default to mount the /tmp directory persistently using tmpfs driver (without fstab)
systemctl enable tmp.mount (wihtout --now)
create a simple systemd unit with sleep.service
- sleep 3600 command
- unit is stored in the appropriate location
- unit is automatically startet in mutil-user.target
if ist stops für any reasen it will automatically restart
cp /usr/lib/systemd/system/tuned.service /etc/systemd/system/sleep.service
vi:
- Description=Sleep3600
- Type=Simple
- ExecStart=/usr/bin/sleep 3600
- Restart=on-failure
-WantedBy=multi-user.target
Systemctl enable sleep.service
systemctl start sleep.service
checke deine registries fpr container
grep unqualified /etc/containers/registries.conf
Wo setzt man ein Label das man für fstab auch noch verwenden kann?
mkfs.xzz -L LABELNAME /dev/sda3
find all files and dir whicht is created by user natasha an copy it to /root/natashafiles
find / -user natasha -exec cp -rf {} /root/natashafiles/ \;
wo sollen lokale skripts platziert werden?
/usr/local/bin
Build applicatio rhcsa that m^orint message when logged in as ablerate user
vi /usr/local/bin/rhcsa
- #!/bin/bash
echo "Welcome etc"
paste /usr/local/bin/rhcsa in file in. /home/user/.bash_profile
Find all files with the name "passwd" and copy them into directory /mnt/copy
- sudo find / -name passwd -exec cp {} /mnt/copy \;
Find all files owned by the user "Rohit" and copy them in direcory /mnt/rohit
- sudo find / -user rohit -exec cp {} /mnt/rohit \;
The user owner should have all rights on directory "Dir"
- chmod u+x Dir (chmod 7xx DIR)
Create a compressed archieve of /etc directory and name it as /root/com.gz
- tar cvzf /root/com.gz /etc (mit Komprimierung)
Create a archieve of /etc directory and name it as /root/com.gz
- tar -cvf /root/com.gz /etc (ohne Komprimierung)
Copy the lines containing the word "root" in /etc/passwd and copy them into a file /mnt/pass
- grep "root" /etc/passwd >> /mnt/pass
Configure the repositories https://xyz.server.com/basos & https://xyz.server.com/appstream
- vi /etc/yum.repos.d/local.repo
[BaseOS]
name=baseOS
baseurl=https://xyz.server.com/baseos
enabled=1
gpgcheck=0
[AppStream]
name=AppStream
baseurl=https://xyz.server.com/appstrem
enabled=1
gpgcheck=0
Change tuned profile from virtual-guest to balanced
- dnf install tuned
- tuned-adm profile balanced
- tuned-adm active
Configure NTP server to run xyz.
- dnf install chrony
- vi /etc/crony.conf
- server <ip> iburst
- systemctl restart cronyd
- chronyc sources -v
- timedatectl
- timectl set-ntp true (falls es nicht true sist)
Create a group newgroup:
a) create a user harsh and make newgroup as secondary group
b) create a user nitin do not add to newggroup. nitin should have no login shell
c) assign al the above users password redhat
a) - groupadd newgroup
- useradd harsh -G newgroup
b) useradd nitin -s /sbin/nologin
c) passwd nitin/harsh
Copy the file /etc/fstab to /var/fstab
a) the user owner of /var/fstab should be root
b) the user natasha should have read and write access
c) the grou Mac should have no access
a) chwon root /var/fstab
b) useradd natashe & setafcl -m u:natasha:rw- /var/fstab
c) groupadd Mac
- setafcl -m g:Max:--- /var/fstab
Create a directoy /linux
a) Make the group owner to be Mac
b) Ensure that all files within /linus the grorup owner is Mac
c) Ensure that for all future files within /linux the group owner is Mac
d) Ensure that no user other that the user-owner of /linux is able to delet the content within /linux
a) - chown :Mac /linux
b) chwon -R :Mac linux
c) chmod g+s /linux
d) chmod +t /linux
LVM:
a) Create a LV named LV1 of size 8G
b) Extend the LV, LV1 by 2G
c) Create a LV named LV2 with 10 extend where each size is extend is 8Mb
a) - vgcreate VG1 /dev/sdX1
- lvcreate -name LV1 -L 8G VG1
- mount
b)- (vgextend LV1 /dev/sdX3)
- lvextend -r -L +2G /dev/VG1/LV1
c) vgcreate -s 8M VG2 /dev/sdX2
- lvcreate -name LV2 -l 10 /dev/
Create Filesystem from Stratis
- dnf install stratisd
- systemctl enable stratisd
- stratis pool create poolX /dev/sde
- stratis pool list
- stratis filesystem create poolX fsX
- stratis filesystem list
- vi /etc/fstab
- defaults,x-systemd.requires=stratisd.service
Execute the command /usr/local/bin/backup at 10:00a, on Feb 4. every yewr
- 0 10 4 2 * /user/local/bin/backup
-
- 1 / 67
-