Logfile für root ????

LinuxFarmer

LinuxFarmer

Mitglied
Hallo Leute,

ich war als root unterwegs und wollte die Eigentümer des Verzeichnises /data einheitlich auf LinuxFarmer setzen.
Ich setzte folgende Kommandos ab :
linux-Rechner:/ # ls -la /data
.
.
.
linux-Rechner:/ # chown -R LinuxFarmer
Letztes Kommando habe ich natürlich abgesetzt, in der Annahme, dass ich im Verzeichnis /data bin.
Alles habe ich ganz schnell mit Ctrl-C unterbrechen können.
Soweit, so gut. Wie Ihr seht, funktioniert der Rechner ja noch. Aber wie bekomme ich raus, wo der chown schon tätig war, um evtl. Schäden per Hand zu beheben?

Danke, Euer LinuxFarmer
 
Code:
cd / & ls -l

...oder wenn Du es ganz genau wissen willst (und viel Zeit hast):

Code:
cd / & ls -lR
 
Welches OS?

Mit rpm kannst du das evtl. wieder rückgängig machen...
 
Code:
linux-Rechner:/ # chown -R LinuxFarmer

Der Befehl war nirgendwo tätig. Weil...
Code:
root@admin-laptop:/# chown -R LinuxFarmer
chown: fehlender Operand nach „LinuxFarmer“
„chown --help“ gibt weitere Informationen.

chown [OPTION]... [OWNER][:[GROUP]] FILE...
 
Zuletzt bearbeitet:
Hui, dann muss das "Ctrl-C" ja wirklich in Lichtgeschwindigkeit erfolgt sein. :)
 
Also das OS ist ein SuSE 10.2 oder anders ausgedrückt Linux linux-Rechner 2.6.18.8-0.7-default #1 SMP Tue Oct 2 17:21:08 UTC 2007 x86_64 x86_64 x86_64 GNU/Linux.

GRRR... natürlich hatte ich das Sternchen gesetzt. Ich denke, es gibt schon genug Foren hier zum Lustigmachen. Mir ist die Lage ernst genug X(
 
Niemand hat sich über dich lustig gemacht. Es hätte ja durchaus sein können, dass du das Programm tatsächlich vor der Fehlermeldung abgebrochen hast. :rolleyes: Aber bevor hier noch weiteres als "sich drüber lustig machen" interpretiert wird, klink ich mich lieber aus. Wie du rausfindest welche Dateien betroffen sind und welche Möglichkeit es gibt, das wieder zu beheben, wurde dir ja bereits gesagt.
 
Code:
#!/bin/bash

for PACKAGE in $(rpm -qa)
do
	rpm --setperms ${PACKAGE}
	rpm --setugids ${PACKAGE}
done

ohne Garantie, aber das könnte helfen.
 
Jau, das sieht gut aus, kann ich bestimmt auch ausprobieren, wenn ich folgendes "Folgeproblem" gelöst habe:
LinuxFarmer@linux-Rechner:/etc> su -
Passwort:
Die Berechtigungen für die Passwort-Datenbank sind möglicherweise zu restriktiv.
su: ungültiges Kennwort
Irgendwie ist heute nicht mein Tag...

Als kleine Ergänzung noch: Der YAST läßt sich locker vom Desktop mit Passwortabfrage starten Greifen die auf unterschiedliche Passwort-Datenbanken zu? Eigentlich doch nicht!
 
Zuletzt bearbeitet:
- YaST aufrufen - "Verschiedene Einstellungen" -> "Dateirechte"
- Dateirechte auf 'easy' setzen
 
Da YaST ja mit kdesu gestartet wird, wenn ich mich recht erinnere, solltest du theoretisch auch an eine Root-Konsole kommen, indem du 'kdesu konsole' aufrufst.
 
Sollte es nicht reichen, die

Code:
/etc/passwd
/etc/shadow

von den Dateirechten her wieder zu reparieren?
 
@ bitmuncher: Yups, das funktioniert :) Aber greift denn kdesu und su auf unterschiedliche Passworttabellen zu?

@ supersucker: Sind diese Rechte Okay?
LinuxFarmer@linux-Rechner:/etc> ls -la shadow
-rw-r----- 1 root shadow 1116 5. Nov 2007 shadow
LinuxFarmer@linux-Rechner:/etc> ls -la passwd
-rw-r--r-- 1 root root 1978 3. Feb 22:16 passwd
 
Zuletzt bearbeitet:
Nein, aber evtl. liegt das Problem garnicht bei der Passwort-Datei, sondern bei den Rechten des Programms 'su'.
 
Bei mir auf SLES 9 sieht das so aus:

Code:
ls -al /etc/passwd
-rw-r--r--  1 root root 2453 2008-04-18 23:58 /etc/passwd
ls -al /etc/shadow
-rw-r-----  1 root shadow 1872 2008-04-17 17:40 /etc/shadow

also korrekt soweit.

Was sagt denn ein

Code:
ls -al `which su`

?
 
:):):)
Das gefällt mir! meines Wissens nach müssen die Eigentümer im /bin doch root:root sein, oder? Somit komme ich zu meiner Ausgangsfrage zurück, denn hierim /bin hat mein chown... offensichtlich schon gewütet.
 
Nicht für alles.

Bei mir sieht das so aus: (eject hat z.B. root.audio)

Code:
 ls -al /bin/
total 6332
drwxr-xr-x   2 root root     4096 Nov  8  2005 .
drwxr-xr-x  21 root root     4096 Sep 20  2007 ..
-rwxr-xr-x   1 root root     3136 Jun 28  2005 arch
-rwxr-xr-x   1 root root    96184 Jun 30  2004 ash
-rwxr-xr-x   1 root root   600713 Jun 30  2004 ash.static
lrwxrwxrwx   1 root root        4 Nov  8  2005 awk -> gawk
-rwxr-xr-x   1 root root    17198 May  4  2005 basename
-rwxr-xr-x   1 root root   448312 Dec 15  2004 bash
-rwxr-xr-x   1 root root    21526 May  4  2005 cat
-rwxr-xr-x   1 root root    38592 May  4  2005 chgrp
-rwxr-xr-x   1 root root    38280 May  4  2005 chmod
-rwxr-xr-x   1 root root    42603 May  4  2005 chown
-rwxr-xr-x   1 root root     4680 Jun 30  2004 chvt
-rwxr-xr-x   1 root root    65798 May  4  2005 cp
-rwxr-xr-x   1 root root    64048 Jun 30  2004 cpio
lrwxrwxrwx   1 root root        4 Nov  8  2005 csh -> tcsh
-rwxr-xr-x   1 root root    47328 May  4  2005 date
-rwxr-xr-x   1 root root    35465 May  4  2005 dd
-rwxr-xr-x   1 root root     5136 Jun 30  2004 deallocvt
-rwxr-xr-x   1 root root    38984 May  4  2005 df
-rwxr-xr-x   1 root root     4628 Jun 28  2005 dmesg
lrwxrwxrwx   1 root root        8 Nov  8  2005 dnsdomainname -> hostname
lrwxrwxrwx   1 root root        8 Nov  8  2005 domainname -> hostname
-rwxr-xr-x   1 root root    49680 Jun 30  2004 dumpkeys
-rwxr-xr-x   1 root root    18688 May  4  2005 echo
-rwxr-xr-x   1 root root    51052 Jun 30  2004 ed
-rwxr-xr-x   1 root root       38 Jun 30  2004 egrep
-rwsr-xr-x   1 root audio   42380 Jun 30  2004 eject
-rwxr-xr-x   1 root root    15888 May  4  2005 false
-rwxr-xr-x   1 root root     4320 Jun 30  2004 fgconsole
-rwxr-xr-x   1 root root       38 Jun 30  2004 fgrep
-rwxr-xr-x   1 root root    32008 Jun 30  2004 fillup
-rwxr-xr-x   1 root root    23028 Jun 30  2004 fuser
-rwxr-xr-x   1 root root   221395 May 23  2005 gawk
-rwxr-xr-x   1 root root     5284 Jun 30  2004 getkeycodes
-rwxr-xr-x   1 root root   126348 Jun 30  2004 grep
-rwxr-xr-x   1 root root    24492 Jun 28  2005 guessfstype
-rwxr-xr-x   3 root root    60431 May 23  2005 gunzip
-rwxr-xr-x   3 root root    60431 May 23  2005 gzip
-rwxr-xr-x   1 root root     9384 Dec  8  2004 hostname
-rwxr-xr-x   1 root root    18551 Jun 30  2004 initviocons
-rwxr-xr-x   1 root root      339 Jun 30  2004 ipg
-rwxr-xr-x   1 root root     5904 Jun 30  2004 kbd_mode
-rwxr-xr-x   1 root root     6092 Jun 30  2004 kbdrate
-rwxr-xr-x   1 root root    21895 May  4  2005 kill
-rwxr-xr-x   1 root root   208453 Apr  4  2005 ksh
-rwxr-xr-x   1 root root    29722 May  4  2005 ln
-rwxr-xr-x   1 root root    70032 Jun 30  2004 loadkeys
-rwxr-xr-x   1 root root    14764 Jun 30  2004 loadunimap
-rwxr-xr-x   1 root root     8180 Jun 28  2005 logger
-r-xr-xr-x   1 root root    38276 Jul  1  2004 login
-rwxr-xr-x   1 root root    90559 May  4  2005 ls
-rwxr-xr-x   1 root root     8459 Jun 16  2005 lsmod
lrwxrwxrwx   1 root root       16 Nov  8  2005 lsmod.old -> /sbin/insmod.old
lrwxrwxrwx   1 root root       13 Nov  8  2005 mail -> /usr/bin/nail
-rwxr-xr-x   1 root root    14412 Jun 30  2004 mapscrn
-rwxr-xr-x   1 root root    27580 May  4  2005 mkdir
-rwxr-xr-x   1 root root    25320 May  4  2005 mknod
-r-xr-xr-x   1 root root     7320 Jun 30  2004 mktemp
-rwxr-xr-x   1 root root    27188 Jun 28  2005 more
-rwsr-xr-x   1 root root    88160 Jun 28  2005 mount
-rwxr-xr-x   1 root root    68222 May  4  2005 mv
-rwxr-xr-x   1 root root    93184 Dec  8  2004 netstat
-rwxr-xr-x   1 root root     8972 Jun 30  2004 openvt
lrwxrwxrwx   1 root root       11 Nov  8  2005 pidof -> /sbin/pidof
-rwsr-xr-x   1 root root    31236 Jun 30  2004 ping
-rwsr-xr-x   1 root root    27108 Jun 30  2004 ping6
-rwxr-xr-x   1 root root   122025 May 23  2005 ps
lrwxrwxrwx   1 root root        9 Nov  8  2005 psfaddtable -> psfxtable
lrwxrwxrwx   1 root root        9 Nov  8  2005 psfgettable -> psfxtable
lrwxrwxrwx   1 root root        9 Nov  8  2005 psfstriptable -> psfxtable
-rwxr-xr-x   1 root root    11816 Jun 30  2004 psfxtable
-rwxr-xr-x   1 root root    18287 May  4  2005 pwd
-rwxr-xr-x   1 root root     5895 Nov 29  2004 rescan-scsi-bus.sh
-rwxr-xr-x   1 root root    10640 Jun 30  2004 resizecons
-rwxr-xr-x   1 root root    38285 May  4  2005 rm
-rwxr-xr-x   1 root root    18945 May  4  2005 rmdir
-rwxr-xr-x   1 root root    18700 Jun  3  2005 rpm
-rwxr-xr-x   1 root root   552340 Jun 30  2004 sash
-rwxr-xr-x   1 root root    39508 Nov 29  2004 scsidev
-rwxr-xr-x   1 root root    86228 Jun 30  2004 sed
-rwxr-xr-x   1 root root    26924 Jun 30  2004 setfont
-rwxr-xr-x   1 root root     5140 Jun 30  2004 setkeycodes
-rwxr-xr-x   1 root root     6556 Jun 30  2004 setleds
-rwxr-xr-x   1 root root     4644 Jun 30  2004 setmetamode
-rwxr-xr-x   1 root root    35612 Nov 29  2004 sg_start
lrwxrwxrwx   1 root root        4 Nov  8  2005 sh -> bash
-rwxr-xr-x   1 root root     8464 Jun 30  2004 showconsolefont
-rwxr-xr-x   1 root root     7380 Jun 30  2004 showkey
-rwxr-xr-x   1 root root    19247 May  4  2005 sleep
-rwxr-xr-x   1 root root    56137 May  4  2005 sort
-rwxr-xr-x   1 root root    43024 May  4  2005 stty
-rwsr-xr-x   1 root root    22924 May  4  2005 su
-rwxr-xr-x   1 root root    16667 May  4  2005 sync
-rwxr-xr-x   1 root root   139396 Jun 30  2004 tar
-rwxr-xr-x   1 root root   365825 Nov 29  2004 tcsh
-rwxr-xr-x   1 root root     6985 Jun 30  2004 testutf8
-rwxr-xr-x   1 root root    34425 May  4  2005 touch
-rwxr-xr-x   1 root root    15888 May  4  2005 true
-rwsr-xr-x   1 root root    28492 Jun 28  2005 umount
-rwxr-xr-x   1 root root    19066 May  4  2005 uname
-rwxr-xr-x   1 root root     3133 Jun 30  2004 unicode_start
-rwxr-xr-x   1 root root      451 Jun 30  2004 unicode_stop
-rwxr-xr-x   1 root root     3876 Jun 30  2004 usleep
lrwxrwxrwx   1 root root        3 Nov  8  2005 vi -> vim
-rwxr-xr-x   1 root root  1063848 Jul  1  2004 vim
-rwxr-xr-x   1 root root     3196 Jul  1  2004 vitmp
-rwxr-xr-x   3 root root    60431 May 23  2005 zcat

Relevant dürfte für dich die Zeile sein:

Code:
-rwsr-xr-x   1 root root    22924 May  4  2005 su
 
Okay, jetzt muss ich nur noch ein paar Sticky-Bits händisch im /bin nachpflegen (danke hier für Deine Liste, wie es sein sollte :] ), dann muss ich weiter suchen, wo der chown von gestern noch sein Unfug getrieben hat.
 
Zurück
Oben