Linux
###--- Gott sei Dank, ich bin weg vom Fenster ---###
Inhaltsverzeichnis
- 1 Starten mit Linux
- 2 My favourite Linux Software
- 3 Zovis Install String
- 4 FAQ
- 4.1 Passwörter
- 4.2 SAMBA
- 4.3 VLAN hinzufügen
- 4.4 Startablauf
- 4.5 IPMI
- 4.6 Allgemein
- 4.7 Netzwerk zügs
- 4.8 RPM to DEB - alien
- 4.9 kleiner witziger Sniffer
- 4.10 Root rechte
- 4.11 Mount
- 4.12 Daten kopieren/ verschieben zwischen Hosts
- 4.13 Netzwerkkonfiguration
- 4.14 DVD Codecs und co.
- 5 Software
- 6 Links
Starten mit Linux
Sehr gute einführung in die Shell
My favourite Linux Software
Linux SW (Ubuntu)
PM = Paket Manager
zur Apt-get Linuxtips.LinuxSWListe SWListe
Allgemeines
- tasksel → PM Tasksel Ubuntu Doc. - Guideline
- Ubuntu Tweak → GetDeb
- Wireshark → PM
- gnome-device-manager → PM
- Umit Network Scanner → PM
- gtkpod - iPod manager → PM
- Hipo - iPod manager → PM
- K3b, (evt auch GnomeBaker) → PM - Brennproggies
- DiscWrapper LabelSW die mit 4L-gui funzt
- Shutter → PM - Printscreens und mehr
- MountManager → PM
- CompizConfig → PM
- Desktop Drapes
- ( Tor & Privoxy )
- Sweet Home 3D → SW Home
- Simple Labeler für LightScribe
- grsync - Data Sync Mgmt. and
- pyNeighborhood → PM (GUI - kleiner Mountmanager)
- Music Applet → PM
- Wallpaper Tray → PM - Allpet
- minicopier - SuperCopier clone
- oder:
- UltraCopier - [2] gefällt mir schon fast besser... =)
- keepass 2 - Password Safe Tool - http://keepass.info - Install Ubuntu - FTP online DB
- Wammu - Handy SW → PM
- gMobileMedia - Handy Datamanager SW → PM
- GCstar Collections Manager - → PM - Movie list export to html → https://launchpad.net/~gcstar/+archive/ppa für die aktuellere Version
- Wuala - Net-Space
- gkrellm → PM - Echtzeit Monitoring Tool
- VirtualBox → neuste Version und auch das dazu passende VM VirtualBox Extension Pack für USB2 Support siehe hier → USB Unterstützungsfehler siehe hier
- Kraft → KMU Finanz SW
- Conky - kooles Sytemresourcenanzeige Proggi
Backup / Sync
- ReaR http://relax-and-recover.org/ BareMetal Desaster recovery tool
- neu: R1 Linux Snapshot http://www.r1soft.com/free-backup-tools
- Back in Time
- Komparator - Compair Folders and Data → PM
- Dar (noch anschauen)
- insync - great google drive sync tool
BackUpen mit tarball -> tar.gz
tar -cjvf /pfad/zum/sicherigsmedium/sicherig-vom-2008-12-22.tar.bz2
restoren mit..
tar -xpvf sicherig-vom-2008-12-22.tar.bz2
Recover Forensic
- rdd - Ein forensisches Kopierprogramm - PM
- ddrescue - Kopiert Daten von einer Datei oder einem Block-Gerät zu einem Anderen - PM
- RECOVER in UBUNTU → help.ubuntu.com
Sichern und Wiederherstellen einer Partition
- DD Wikipedia
Von einer Partition lässt sich mit dd eine exakte Kopie als normale Image-Datei im vorhanden Dateisystem ablegen. Zweckmässigerweise ist die Gerätedatei der Partition nicht eingehängt, damit ein versehentliches Vertauschen von if= und of= nicht zu Datenverlust führen kann.
dd if=/dev/sda1 of=/tmp/sda1_image
Danach kann bspw. ein „Undelete“ (undelete) auf einem ext2/ext3/ext4-Dateissystem mit debugfs -w /dev/sda1 versucht werden. Zum Wiederherstellen des Ausgangszustandes vertauscht man Ein- und Ausgabedatei:
dd of=/dev/sda1 if=/tmp/sda1_image
Datenträger unlesbar machen
Infos über das Löschen von HDDs
Unwiderrufliches Löschen einer ganzen Festplatte /dev/sda einschließlich aller Partitionsinformationen mit /dev/urandom unter GNU/Linux:
dd if=/dev/urandom of=/dev/sda
Löschen einer SSD
Siehe http://www.pcwelt.de/ratgeber/Datensicherheit-6581465.html
Audio
- Rhythmbox → Aktueller installieren
sudo add-apt-repository ppa:webupd8team/rhythmbox
sudo apt-get update
sudo apt-get upgrade
- VLC → PM
- Audacity - mp3 bearbeiten - → PM
- Calf → PM
- LV2 → PM
- Ardour → PM / → http://ardour.org - Digitale Audio Workstation
- Guitarix -; gutarren Verstärker SW
- gstreamer0.10-ffmpeg → GStreamer-Erweiterungen aus der »bad«-Sammlung → PM
- gstreamer0.10-plugins-bad → FFmpeg-Erweiterung für GStreamer
- TuxGuitar und Timidity → Gitarren SW
- Mixx → DJ SW ab vers 1.9 brauchbar
- PulseAudio Lautschtärke Regler → PM - Mixer um das Lineout aufnehmen zu können =)
- MusE - PM - MIDI/Audio-Sequenzer und -Bearbeitungsprogramm
Video
- DVD abspielen - siehe Medibuntu
- DVD95 - Ganz easy Sicherheitskopien erstellen → PM
- DeVeDe - Kuuler convertierer - DVD → PM\\
- PiTiVi → Video schneide Progi → einstellung für typo3-flash: format:FLV, grösse: 400x300, skalieren: 100%, 25fps, codec: x264enc, audio: l.a.m.e. mp3\\
- OpenShot Video-Editor → siehe hier
- Kdenlive - Linux Video Editor - "Easy to use" und kann sehr viel
- Motion - kuules Cam stream and motion- detection Tool
Bild
- KColorChooser → PM - oder Gcolor2 → PM
- Gimp oder/und Krita → PM - Grafik Tools
- Inkscape → PM
- nautilus-image-converter → PM → Bilder im Nautilus ändern. Damit bekommst du im Kontextmenü von Bildern die Option die Größe von Bilder zu ändern usw.
TinTii - Den Bilern Farbe entnehmen oder verleihen
Games
- Nexuiz → PM
- OpenArena → PM
- AlienArena → PM
- Chromium B.S.U. → PM
- Torcs → PM
- Blobby Volley 2
Fonts
- ttf-aenigma → PM
- ubuntustudio-font-meta → PM
- ttf-aenigma → PM
RDP
- Remmina → PM (geiles Tool!) Autostart: remmina -i (startet so als Trayicon)
- (Gnome-RDP → PM - Hilfe und Infos)
Hardware
- indicator-multiload:i386 -> PK - Ein Systemlast-Indikator, der Graphen zu CPU, RAM und Swap- Speicherverbrauch sowie zur Netzwerkauslastung anzeigen kann.
- xsensores
Fun
- Docky → PM - Dockmanager
ToDo
- Minino Linux Distribution - für alte HW page
- Hugin - Panorama SW
- Bombono DVD → PM
- zoneminder - überwachen von bereichen eines vieoblockfeldes → PM
- Photivo - RAW-Bild editor der mit GIMP zuammen arbeitet → Website
- 4Pane - Kuuler Dateimanager - WEB, Ubuntu inst.
- PhotoFilmStrip PhotoFilmStrip erstellt Videoclips aus Bildern
- Babelpod → Ipod SW alternative zu iTunes ???
- video schneiden mit LiVES
Zovis Install String
Home:
sudo apt-get install wireshark umit k3b shutter wammu vlc audacity dvd95 devede kcolorchooser gimp openarena alien-arena ttf-aenigma ubuntustudio-font-meta lame gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse python-mutagen python-notify cifs-utils nfs-common gparted gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad p7zip-full
for Work:
sudo apt-get install remmina wireshark umit k3b shutter kcolorchooser gimp ttf-aenigma ubuntustudio-font-meta cifs-utils nfs-common gparted p7zip-full
FAQ
Passwörter
Reset root PW
getestet auf RedHat RHEL7
- Reboot the system .
- In the grub menu, press escape key to prevent the system from booting. Edit the grub menu by pressing “e” .
- Press the arrow keys to get the “linux16” line and press “end” key. This will take you to the end of the line.
- Here add ” rd.break console=tty1 ”
- Press control-x to boot the system.
- You will get the “switch-root” prompt like below.
- switch_root:/# mount -o remount,rw /sysroot
- switch_root:/# chroot /sysroot
- sh-4.2# passwd root
- By default, SE-Linux will be enabled on RHEL7 . So create a blank file in the name of “.autorelabel” under root. sh-4.2# touch /.autorelabel
- Exit from the chroot jail and exit from the initramfs.
- System will reboot and perform a full SELinux relabel , then reboot again.
- Once the system is rebooted, you will be able to login with new root password which you have set it
SAMBA
Einzelne Hosts berechtigen ohne Useranmeldung
smb.conf
#smb.conf is the main Samba configuration file. You find a full commented
#version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
#samba-doc package is installed.
# Date: 2013-12-13
[global]
workgroup = WORKGROUP
passdb backend = tdbsam
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \\%L\profiles\.msprofile
logon home = \\%L\%U\.9xprofile
logon drive = P:
usershare allow guests = Yes
security = share
; unix extensions = no
### SQL Backup Shares - Tests ###
include = /etc/samba/shares/shares.conf
In der includeten shares.conf können pro Share verschiedene Einstellungen gemacht werden.
Bei wenigen Shares können die Shareangaben auch gleich direkt in der smb.conf gepflegt werden
/etc/samba/shares/shares.conf
[test]
comment = Temporary file space
path = /tmp/test
read only = no
browseable = yes
writeable = yes
public = yes
[v05zck]
comment = Test Share zum Einrichttest
path = /mnt/nfs_cifs_sql/v05zck
browseable = yes
read only = no
create mode = 0777
public = yes
hosts deny = ALL
hosts allow = 172.27.41.195
[v06tst]
comment = for SLQ Server v06tst
path = /mnt/nfs_cifs_sql/hhh
browseable = yes
read only = no
create mode = 0777
public = yes
hosts deny = ALL
hosts allow = 172.27.41.94 172.27.41.201 172.27.41.195
VLAN hinzufügen
suse:
- gehe als root ins Verzeichnis */etc/sysconfig/network*
- kopiere am einfachsten eine bestehene vlan Config cp -p ifcfg-vlan1292 ifcfg-vlan***
- bearbeite sie mit vi ifcfg-vlan***
- lese die Configs neu ein: rcnetwork restart
- kontrolliere mit ifconfig das IF....voila
Startablauf
/etc/init.d
- Startscript in /etc/init.d/ erstellen
- Aktivieren mit chkconfig
hbli01:/etc/init.d # chkconfig gst --list
gst 0:off 1:off 2:off 3:off 4:off 5:on 6:off
hbli01:/etc/init.d # chkconfig gst off
insserv: script nsrps is broken: incomplete LSB comment.
insserv: missing `Provides:' entry: please add.
hbli01:/etc/init.d # chkconfig gst on
insserv: script nsrps is broken: incomplete LSB comment.
insserv: missing `Provides:' entry: please add.
insserv: Service network is missed in the runlevels 4 to use service agentsvc
insserv: Service syslog is missed in the runlevels 4 to use service agentsvc
insserv: Service ipmidrv is missed in the runlevels 4 to use service hp-health
insserv: Service networker is missed in the runlevels 3 to use service gst
hbli01:/etc/init.d # chkconfig gst --list
gst 0:off 1:off 2:off 3:on 4:off 5:on 6:off
hbli01:/etc/init.d #
IPMI
ipmitool installieren
auf ipmi adresse verbinden
ipmitool -I lanplus -H xxx.xxx.xxx.xxx -U admin shell
Zovi - Test ob login ohne PW möglich (cipher-suite-0 attack) =)
ipmitool -I lanplus -H xxx.xxx.xxx.xxx -P bad_passwd -C0 user list
oder
ipmitool -I lanplus -H xxx.xxx.xxx.xxx -U admin -P bad_passwd -C0 user list
oder
ipmitool -I lanplus -H xxx.xxx.xxx.xxx -U root -P bad_passwd -C0 user list
Allgemein
Message Banner Login Text
Banner für User
Für einen speziellen User ein Login Banner machen
vi ~/.bashrc
---
echo "################################################################################################################################"
echo "-------------------- Maybe Networker Servers are in \"Failover mode\", be careful, you're logged in on hbeh05 --------------------"
echo "################################################################################################################################"
Login Banner
Welcome Banner für alle
vi /etc/motd
###############################
# #
# Welcome on Machine1 #
# #
###############################
Auslesen CPU
Usage nach Prozess:
top
Ussage pro CPU:
mpstat -P ALL 2
Auslesen Memory used
vmstst 3
Grösse auslesen von Ordner
du -hs /<pfad>/*
Zeigt nur diesen Ordner an:
du -hs /<pfad>/
"-d 0" zeigt nur ein Level von Ordnern an und rechnet sie zusammen
du -h -d 0 /mnt/nfs_cifs_sql/
BM zeigt Resultat in MB an
du -hBM -d 0 /mnt/nfs_cifs_sql/*
Netzwerk zügs
Bonding
Bonding Modes
Descriptions of bonding modes
Mode 0
balance-rr
Round-robin policy: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.
Mode 1
active-backup
Active-backup policy: Only one slave in the bond is active. A different slave becomes active if, and only if, the active slave fails. The bond's MAC address is externally visible on only one port (network adapter) to avoid confusing the switch. This mode provides fault tolerance. The primary option affects the behavior of this mode.
Mode 2
balance-xor
XOR policy: Transmit based on selectable hashing algorithm. The default policy is a simple source+destination MAC address algorithm. Alternate transmit policies may be selected via the xmit_hash_policy option, described below. This mode provides load balancing and fault tolerance.
Mode 3
broadcast
Broadcast policy: transmits everything on all slave interfaces. This mode provides fault tolerance.
Mode 4
802.3ad
IEEE 802.3ad Dynamic link aggregation. Creates aggregation groups that share the same speed and duplex settings. Utilizes all slaves in the active aggregator according to the 802.3ad specification.
Prerequisites: 1.Ethtool support in the base drivers for retrieving the speed and duplex of each slave. 2.A switch that supports IEEE 802.3ad Dynamic link aggregation. Most switches will require some type of configuration to enable 802.3ad mode.
Mode 5
balance-tlb
Adaptive transmit load balancing: channel bonding that does not require any special switch support. The outgoing traffic is distributed according to the current load (computed relative to the speed) on each slave. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed receiving slave.
Prerequisites:
1.Ethtool support in the base drivers for retrieving the speed of each slave.
Mode 6
balance-alb
Adaptive load balancing: includes balance-tlb plus receive load balancing (rlb) for IPV4 traffic, and does not require any special switch support. The receive load balancing is achieved by ARP negotiation. The bonding driver intercepts the ARP Replies sent by the local system on their way out and overwrites the source hardware address with the unique hardware address of one of the slaves in the bond such that different peers use different hardware addresses for the server.
Teaming LACP einrichten
SusE
hbzf01:~ # cat /etc/sysconfig/network/ifcfg-bond0
DEVICE='bond0'
BOOTPROTO='static'
IPADDR='172.27.34.15/24'
BROADCAST='172.27.34.255'
STARTMODE='auto'
PREFIXLEN='24'
STARTMODE='auto'
USERCONTROL='no'
BONDING_MODULE_OPTS='mode=4 lacp_rate=1 miimon=100'
BONDING_MASTER='yes'
BONDING_SLAVE0='eth0'
BONDING_SLAVE1='eth1'
BONDING_SLAVE2='eth2'
BONDING_SLAVE3='eth3'
BONDING_SLAVE4='eth4'
BONDING_SLAVE5='eth5'
BONDING_SLAVE6='eth6'
BONDING_SLAVE7='eth7'
hbzf01:~ #
hbzf01:~ # cat /etc/sysconfig/network/ifcfg-eth0
DEVICE='eth0'
BOOTPROTO=none
ETHTOOL_OPTIONS='autoneg on'
STARTMODE='off'
USERCONTROL='no'
MASTER=bond0
SLAVE=yes
hbzf01:~ #
RedHat
First, create a new file in the /etc/sysconfig/network-scripts directory called ifcfg-team0 that looks like this:
DEVICE=team0
DEVICETYPE=Team
ONBOOT=yes
BOOTPROTO=none
IPADDR=1.2.3.4
NETMASK=255.255.255.0
TEAM_CONFIG='{"runner": {"name": "lacp"}, "link_watch": {"name": "ethtool"}}'
Obviously you need to change the IP address and netmask appropriately.
Then in the same directory, change all of the ifcfg-eno[1-4] files to look like this:
DEVICE=eno1
HWADDR=00:11:22:33:44:55
DEVICETYPE=TeamPort
ONBOOT=yes
TEAM_MASTER=team0
TEAM_PORT_CONFIG='{"prio": 100}'
As above, your local files will differ a bit, because you will need to preserve the existing HWADDR setting.
This is straight out of the manual.
The ifcfg-team0 file refers to the lacp.conf file you have already created. I do not see in the manual how it finds that file, however. Perhaps teamd remembers it from your earlier manual configuration, or perhaps you have to put it in a common directory.
Anyway, once this is configured, you say ifup team0, and the teamed NIC group will all come up together. The individual interfaces need to be down at the start, but you won't need to do anything special to ensure that on boot, since they're now marked as part of a NIC team. The OS's boot configuration will realize that it shouldn't bring those four interfaces up individually, but only as part of the NIC team.
All of the above assumes you have disabled NetworkManager and gone back to the good old way of configuring networking on Red Hat type Linuxes:
$ sudo systemctl stop NetworkManager.service
$ sudo systemctl disable NetworkManager.service
$ sudo systemctl start network.service
$ sudo systemctl enable network.service
This is often a good idea on servers, particularly when their network configuration starts getting tricky, as with LACP. NetworkManager solves a lot of problems, but it often does so with a desktop-focused slant that is inappropriate for servers. For instance, it solves the automatic WiFi to Ethernet transitions common with laptops. Servers typically have static network configurations, so NetworkManager can end up just getting in the way.
Still, if you find yourself wanting to stick with Red Hat's defaults, they do cover that alternative a few sections earlier in the manual.
Bondingstatus der einzelnen IFs sehen
go to:
hszf04:/ # cd /proc/net/bonding hszf04:/proc/net/bonding
# hszf04:/proc/net/bonding
# hszf04:/proc/net/bonding
# l
total 0
-r--r--r-- 1 root root 0 Jun 3 11:11 bond0
-r--r--r-- 1 root root 0 Jun 3 11:11 bond1
hszf04:/proc/net/bonding # cat bond1
IP Interfaces live Monitoring
sar -n DEV 1 10
zeigt alle
Netzwerkinterfaces im Sekundentakt mit diversen Übertragungsraten an. Die letzte Zahl ist der Counter um die Anzeige soviel mal zu aktualisieren (hier 10 mal).
Status der einzelnen IFs sehen
eth
ethtool eth4
Bonding
bei Suse:
less /proc/net/bonding/bond1
Verbundene tcp - udp Sessions auf IPs ikl. Ports anzeigen
netstat -an | grep 192
Hier im Beispiel alle 192.*** er Adressen
Patchscript anstossen
/usr/local/scripts/do_youpatch.sh reboot
oder wenn im gleichen Ordner
./do_youpatch.sh reboot
du
Diskusage
Grössenangabe von Ordner
Zeigt alle Unterordner an
du -hs /<pfad>/*
Beispiel:
hszf01:/ # du -hs /mnt/nfs_cifs_sql/*
420G /mnt/nfs_cifs_sql/c05awg
61G /mnt/nfs_cifs_sql/c05awh
227G /mnt/nfs_cifs_sql/c05awv
173G /mnt/nfs_cifs_sql/c05aww
30G /mnt/nfs_cifs_sql/c05fgk
62G /mnt/nfs_cifs_sql/c05gxl
512 /mnt/nfs_cifs_sql/c05gxm
170G /mnt/nfs_cifs_sql/v062qd
325M /mnt/nfs_cifs_sql/v064ae
512 /mnt/nfs_cifs_sql/v067is
3.2G /mnt/nfs_cifs_sql/v069fo
hszf01:/ #
Zeigt nur diesen Ordner an
du -hs /<pfad>/
Beispiel:
hszf01:/ #
du -hs /mnt/nfs_cifs_sql/
7.0T /mnt/nfs_cifs_sql/
hszf01:/ #
df
df -h
zeigt alle Partitionen und Mounts an
ps
ps -ef
zB zeigt alle offenen Telnet sessions:
ps -ef|grep telnet
kill
kill [PID]
zb:
kill 42338
chkconfig
chkconfig -A
RPM to DEB - alien
um ein rpm Installationspaket in eine deb (Debian) version zu konvertieren bitte folgendes beachten.
Remainder:
sudo alien -k name-of-rpm-file.rpm
kleiner witziger Sniffer
sudo ngrep -d eth0 -i "irgendöppis(suechwort)"
oder
netcat -z -v [Hostname] [Portrange]
zB:
netcat -z -v sonne33.pipapo.ch 1-1230
Root rechte
Verknüpfung zu Programm mit "root" starten
- Starter (Verknüpfung) erstellen oder praktischer den Original Starter kopieren
- in den Eigenschaften des Starters zum Feld "Befehl" navigieren
- vor dem Original Startbefehl gksu einfügen.
Also:
gksu <programm>
z.B.: Nautilus
*gksu* nautilus --no-desktop computer:
oder
- Installiere das Paket Menu: *sudo apt-get install menu*
- Starter (Verknüpfung) erstellen oder praktischer den Original Starter kopieren
- in den Eigenschaften des Starters zum Feld "Befehl" navigieren
- vor dem Original Startbefehl *su-to-root -X -c* einfügen.
Also:
su-to-root -X -c <programm>
z.B.: Nautilus
su-to-root -X -c nautilus --no-desktop computer:
Script in Ubuntu mit root Rechten laufen lassen
>>>Dies ist aus
>>>Sicherheitsgründen so, da es relativ einfach ist über ein setuid-root
>>>shellscript zu einer root shell zu kommen.
>>
>>Das macht Sinn.
>>
>>
>>>Ich verstehe nicht, wieso du dein script nicht mit sudo startest (z.B.
>>>sudo /root/script). So kannst du das gut testen bis Du das in der
>>>crontab eingetragen hast.
>>
>>Das kann ich, dann muss ich aber auch alle Befehle innerhalb des Scripts
>>mit sudo versehen, sonst gibt es das genannte Problem.
>
>
> Dann machst du definitiv noch etwas falsch. Ich vermute mal, dass das
> nichts mit den Rechten zu tun hat, sondern einfach an deinem Skript
> liegt. Wenn du das Skript mit sudo startest, dann läuft es mit UID 0
> (root) und das gilt auch für alle Prozesse, die das Skript startet.
>
>
>>Mir ist noch nicht ganz klar, warum die crontab dann später ohne sudo
>>auskommt, aber ich brav sudo eintippen muss. Bisher bin ich immer davon
>>ausgegangen "was root gehört, darf alles" und der Inhalt von /bin z.B.
>>gehört ja root.
>
> Zuerst zu cron: Cron läuft ja bereits als root. Es kann also weitere
> Prozesse (z.B. die Cronjobs) als root starten. Also hier ist kein
> Problem.
> Ich glaube dir ist noch nicht ganz klar, wie das sudo/root Konzept von
> Ubuntu aussieht. Der root Account auf einem Ubuntu System existiert
> genauso wie auf jedem anderen System auch. Er hat einfach ein
> deaktiviertes Passwort. Das hindert aber Daemons (wie cron) nicht daran
> als root zu laufen und sie benötigen dazu auch nicht sudo. Sudo brauchst
> du nur, wenn du als Benutzer etwas als mit root-Rechten laufen lassen
> willst. Der einzige Unterschied zwischen Ubuntu und einem "normalen"
> Linux Installation ist, dass du nicht also root einloggen kannst und
> dass du den Befehl su nicht benutzen kannst. Beides kannst du aber auch
> unter Ubuntu einfach ermöglichen, in dem du "sudo passwd" ausführst und
> dem root Account ein Passwort gibst.
> Das root Konzept von OS X ist im übrigen genau gleich wie jenes von
> Ubuntu.
>
> Nun noch zum "was root gehört, darf alles": Hier vermischt du die
> Dateisystemrechte einer ausführbaren Datei mit den Rechten eines
> laufenden Prozesses. Beides hat (abgesehen von setuid) eigentlich nichts
> miteinander zu tun. Egal wem eine ausführbare Datei gehört, erbt der
> Prozess, welcher entsteht wenn du sie ausführst immer die Rechte des
> Prozesses aus welchem er gestartet wurde. Also zum Beispiel die Rechte
> der Shell, wenn du einen Befehl auf der Shell eintippst. Das gesetzte
> setuid Bit ändert dieses verhalten. Dann bekommt der neue Prozess die
> Rechte des Owners der Binärdatei im Dateisystem. Z.B. sudo hat das
> setuid Bit gesetzt, da es als root laufen muss, um seine Funktion zu
> erfüllen.
>
>
>>Liegt des Rätsels Lösung also darin, dass der cronjob mit dem passenden
>>setuid-but ausgeführt wird und somit dessen Rechte automatisch auch für
>>das aktivierte Script gelten, während das Script alleine diese Rechte
>>offenbar gar nicht haben kann?
>
>
> Nein ein cron job mit setuid bit ist praktisch in jedem fall eine
> fehlkonfiguration. Der job erbt die Rechte vom cron daemon, welcher ihn
> startet und kann damit also root laufen. Bei Jobs in crontabs von
> Benutzern gibt cron seine root Rechte "freiwillig" auf und setzt die
> Rechte des Jobs auf die Rechte des Benutzers zu dem der Job gehört. Das
> kann cron, weil es als root läuft.
>
> So das wurde ja nun ein richtiger Crashkurs in Unix Prozessrechten.
Posted by Gaudenz
THX
Mount
fstab
# NFS
10.1.1.222:/data/col1/backup /media/DD-Backup nfs rw 0 0
10.1.1.222:/data/col1/zovi /media/DD-Zovi nfs rw 0 0
10.1.1.222:/data/col1/VM_storage1 /media/DD-VMstorage nfs rw 0 0
10.1.1.201:/volume1/Backup2 /media/Syn106-Backup2 nfs rw 0 0
10.1.1.202:/mnt/HD_a2/moviez /media/Moviez-0-C nfs rw 0 0
10.1.1.200:/volume1/moviez/Moviez /media/Moviez-D-Z nfs rw 0 0
#10.1.1.200:/volumeUSB1/usbshare /media/Serien nfs rw 0 0
#10.1.1.200:/volumeUSB2/usbshare /media/MusicVideos nfs rw 0 0
# CIFS
//10.1.1.221/share/Music/ /media/popcorn-music cifs credentials=/root/.smbcredentials-popcorn,iocharset=utf8,nounix,file_mode=0777,dir_mode=0777 0 0
#//10.1.1.220/share/Video/ /media/popcorn-videos cifs credentials=/root/.smbcredentials-popcorn,iocharset=utf8,nounix,file_mode=0777,dir_mode=0777 0 0
//10.1.1.205/backup_maxtor/ /media/Maxtor-MusicBackup cifs credentials=/root/.smbcredentials-driver,iocharset=utf8,nounix,file_mode=0777,dir_mode=0777 0 0
iso mounten
sudo mount -o loop [Pfad\***.iso] /media/cdrom0
z.B.:
sudo mount -o loop ~/Desktop/ubuntu-9.04-alternate-i386.iso /media/cdrom0
Mount Error
Beim einstöpseln eines USB Laufwerkes wie z.B. ext. HD oder USB Stick erscheint ein Error "Unable to mount the volume "***" ". Da muss mal das NTFS log reseted werden.
sudo mount -t ntfs-3g -o force /dev/sdb1 /mnt
sudo umount /mnt]]
Dann die Platte mal abstöpseln und wieder anstöpseln - sollte anschliessend automatisch gemounted werden.
Try it
PS: Geht auch mit ntfsfix, aber dann wird auch ein Filesystemcheck von Windows durchgeführt, wenn man das nächste mal mit der Platte bootet.
Partitionen beim Start mounten
als root in der Datei /etc/fstab folgendes eintragen:
/dev/[partition] /media/[mountpoint] [filesystem] defaults 0 0
oder besser via UUID
UUID=[Partitions_UUID] /media/[mountpoint] [filesystem] defaults 0 0
um die UUID rauszufinden: sudo blkid
z.B.:
/dev/sdc1 /media/VMware ntfs defaults 0 0
oder via UUID:
UUID=7f95b1aa-6b5a-497b-be18-86e36697849c /media/BackUp01_1TB_WD ext3 defaults 0 0
Netzwerkshares beim Starten mounten
samba installieren: sudo apt-get install cifs-utils
falls nicht funzt sudo apt-get install smbfs (ältere Mounttools)
Die Datei in /etc/fstab bearbeiten
CIFS
http://ubuntuforums.org/showthread.php?t=288534
//netbiosname/sharename /media/sharename cifs credentials=/root/.smbcredentials,iocharset=utf8,nounix,file_mode=0777,dir_mode=0777,uid=1000 0 0
z.b.:
//172.16.93.90/Backup /media/backup cifs credentials=/root/.smbcredentials,iocharset=utf8,nounix,file_mode=0777,dir_mode=0777,uid=1000 0 0
im Root ordner folgende Datei mit Inhalt erstellen:
.smbcredentials
username=Test
password=Test
in /media einen Ordner gem. fstab erstellen und mit drwxrwxrwx (40777) berechtigen
voila =)
NFS
nfs-common installieren
Dann Link in fs.tab eintragen
z.B.:
192.168.6.13:/home /media/server nfs rw 0 0
DataDomain NFS Anbindungsparameter
ddname.test.ch:/data/col1/mtree1 /mnt/nfs_mountfolder nfs rw,hard,rsize=32768,wsize=32768,nolock 0 0
Laut einem Blog kann sogar folgendes gemacht werden
mount -t nfs -o hard,intr,nfsvers=3,tcp,rsize=1048600,wsize=1048600,bg datadomain:/data/col1/OracleBackup /OracleBackup
Link zum Blog robsteele.co
fstab ohne reboot neu einlesen
mount -a
iPot, iPhone, iPtouch in Ordner mounten
(zb. für ältere Programme wie GTKpod, Hipo, Ipod Photo uploader, ...usw.)
siehe hier
Mounten:
ifuse /mnt/ipod
Unmounten:
fusermount -u /mnt/ipod
Ubuntu 11.10 & iPhone ab iOS 5.0.1
Das iPhone ist eingesteckt und die Fehlermeldung erscheint
In Terminal eingeben:
sudo apt-get install libimobiledevice-utils
iPhone Bilderschirm entsperren (wichtig!)
In Terminal eingeben:
idevicepair unpair && idevicepair pair
Wenn der Bildschirm gesperrt ist bekomme ich keinen Zugriff auf die iPhone Daten. Das entsperren muss allerdings nur beim ersten Mal sein, anschließend funktioniert es problemlos.
Mount - GUI Tools
ubuntu mountmanager: für ubuntu itrepid 9.04 gibt es eine neuere Version als die Repository Version
http://forum.ubuntuusers.de/post/2173052/
pyNeighborhood
ist im Repository
Ist für cifs und smb sehr geeignet
Daten kopieren/ verschieben zwischen Hosts
wget
wget -c --limit-rate=200k <URL http, https oder ftp>
kann mit Ctl+c abgebrochen werden und je nach Hostserver wieder am angefangenen Download weiter laden.
scp
scp von nach
scp [Host]:/[Pfaad] []
Beispiel
scp sysadmin@hddeh4:/ddvar/ddfs.core.16176.1478155960.gz /tmp/hddeh4/
Volume Copy
mit dd (dump device) kann eine Festplatte blockweise auf eine andere geschrieben werden.
Beispiel:
dd if=/dev/hda of=/dev/hdc
Netzwerkkonfiguration
Sehr gutes Doku:
Howto:
Ubuntu Linux convert DHCP network configuration to static IP configuration
DVD Codecs und co.
Software
Webmin
webmin ist ein browserbasierendes Tool, um damit einen Linux-Server zu verwalten. Es lassen sich damit einen Grossteil der Aufgaben mittels grafischer Menüs erledigen.
Dazu lädt man sich ab der Website das richtige Paket herunter. Anschliessend wird ein Installationsversuch gestartet, der scheitern wird:
sudo dpkg -i <paketname>.deb
Da die Abhängigkeiten zu andern Paketen nicht automatisch erfüllt werden können, bricht die Installation ab. Da hilft ein Trick: Allerdings warne ich davor, denn dies ist wohl mehr ein Lausbubentrick als eine professionelle Weise, webmin zu installieren:
sudo apt-get install -f
Damit versucht das System, die Pakete und deren Abhängigkeiten zu reparieren und holt sich die Pakete nun doch, die in Abhängigkeit zu webmin stehen. Die Installation glückt so aber tip top und bis jetzt jedes mal. Damit steht webmin sofort unter dem Port 10000 und unter SSL zur Verfügung:
https://IP_oder_Adresse_des_Servers:10000
Früher war es noch notwendig, den Benutzer root zurechtzubiegen, um sich an webmin anzumelden. Heute funktioniert das ohne, es reicht, wenn man sich mit einem Benutzer, der sudo-Rechte besitzt, anmeldet.
Ausserdem ist es nicht notwendig, dass ein Webserver auf dem Server läuft. webmin bringt selbst alles mit, damit es per Browser angesteuert werden kann. Und damit steht ein umfassendes Tool zur Verwaltung des Servers zur Verfügung!
Text ursprünglich von ubuntublog.ch
neu ab 11.10 im terminal
Install webmin on ubuntu 11.04 (Natty) server
Edit /etc/apt/sources.list file
sudo vi /etc/apt/sources.list
Add the following lines
deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib
Save and exit the file
Now you need to import GPG key
wget http://www.webmin.com/jcameron-key.asc
sudo apt-key add jcameron-key.asc
Update the source list
sudo apt-get update
Install webmin
sudo apt-get install webmin
Now you need to access webmin using http://serverip:10000/ once it opens you should see similar to the following screen
Probleme mit VMWare Server 2.0.* und VMWare Konsole via Firefox
Das Plugin lässt sich doch auch ohne den Firefox starten:
- Man suche vmware-vmrc im Directory .mozilla
- Man passe ggf. Rechte an und / oder starte mit bash, also bash vmrare-vmrc
Syntax:
vmware-vmrc -h <hostname:port> -u <username> -p <password>
Beispiel:
bash vmware-vmrc -h localhost:8333 -u driver -p geheim
oder
man lege einen Starter an und gebe dies ein(Pfad anpassen):
/home/driver/.mozilla/firefox/fbxco40n.default/extensions/VMwareVMRC@vmware.com/plugins/vmware-vmrc -h localhost:8333 -u driver -p geheim
ACHTUNG! ...um sicher zu gehen, dass niemand das PW findet, kann auch "-u driver -p geheim" weggelassen werden. Mann muss dies nach dem Start in einem Gui eingeben...
SAMBA
Einzelne Hosts berechtigen ohne Useranmeldung
smb.conf
#smb.conf is the main Samba configuration file. You find a full commented
#version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
#samba-doc package is installed.
# Date: 2013-12-13
[global]
workgroup = WORKGROUP
passdb backend = tdbsam
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \\%L\profiles\.msprofile
logon home = \\%L\%U\.9xprofile
logon drive = P:
usershare allow guests = Yes
security = share
; unix extensions = no
### SQL Backup Shares - Tests ###
include = /etc/samba/shares/shares.conf
In der includeten shares.conf können pro Share verschiedene Einstellungen gemacht werden.
Bei wenigen Shares können die Shareangaben auch gleich direkt in der smb.conf gepflegt werden
/etc/samba/shares/shares.conf
[test]
comment = Temporary file space
path = /tmp/test
read only = no
browseable = yes
writeable = yes
public = yes
[v05zck]
comment = Test Share zum Einrichttest
path = /mnt/nfs_cifs_sql/v05zck
browseable = yes
read only = no
create mode = 0777
public = yes
hosts deny = ALL
hosts allow = 172.27.41.195
[v06tst]
comment = for SLQ Server v06tst
path = /mnt/nfs_cifs_sql/hhh
browseable = yes
read only = no
create mode = 0777
public = yes
hosts deny = ALL
hosts allow = 172.27.41.94 172.27.41.201 172.27.41.195
MAC Adressen an ein IF Name binden
SUSE
vi /etc/udev/rules.d/70-persistent-net.rules
Cronjob manuell starten
sh /etc/cron.daily/cronjob
Links
- Verzeichnis
- ← Zurück zu Überseite: Hauptseite