Sep 142011
 

Questa è la mia personale top 8 di peggiori suggerimenti che ho letto, preso o dato ad altri utenti di Linux fino ad ora, sentitevi liberi di aggiungere i vostri come commento.

Legenda: D: Domanda, BA: La risposta cattiva, GA: Una possibile buona risposta

1) D: Ho un file che non riesco a leggere/scrivere/eseguire con l’utente che voglio!

male: “chmod 666 file” – In questo modo il file è modificabile e cancellabile da chiunque.
Peggio ancora: “chmod file di 777” – In questo modo il file è modificabile da chiunque e si impostano i permessi di esecuzione per chiunque. Ciò significa che qualsiasi utente può modificare il file per fare qualcosa di dannoso per l’utente successivo che (casualmente?) lo esegue.
Peggiore: “chmod 7777 file” – dà anche il permesso setuid e setgid. Con questo hai appena dato il permesso a qualsiasi utente di fubar la vostra macchina, soprattutto se il file è di proprietà di root.

GA: controllare quale utente e gruppo hanno permesso di fare le operazioni necessarie in quel file, iscrivere l’utente a quel gruppo e/o modificare il proprietario o il gruppo di quel file.


2) Questa è una piccola variante del numero 1.

D: Il mio demone (Apache, Tomcat, mettete il vostro qui) non può accedere a tutti i file e/o directory che i nostri sviluppatori utilizzano per mettere le applicazioni.

BA: come al punto 1, questo di solito va a finire con tutti i file in una document root con permesso 777.

3) D: Ad un certo momento il mio server inizia a utilizzare lo spazio di swap e tutto va molto lento. cosa posso fare?

BA: Rimuovi la partizione di swap, in questo modo il sistema non la userà. L’effetto di questo è di solito un server bloccato per memoria esaurita.

GA: Indagare su ciò che sta usando la memoria, ci potrebbe essere una perdita di memoria in qualche programma in esecuzione, mentre si sta indagando pensate se raddoppiare lo spazio di swap.

4) Sempre sulla swap ed assistito in diretta da me (come spettatore)

D: Abbiamo la swap piena, la possiamo liberare in qualche modo ?

BA: Dai uno swap off, il kernel penserà a reclamarla. Ed 1 secondo dopo un altro sistema bloccato, la memoria della macchina era molto usata e spegnendo lo swap abbiamo perso importanti informazioni di programmi in esecuzione.

5) D: Il mio filesystem ext3 è un po’ lento, cosa posso fare?

BA: Trasformalo in un ext2, avrai meno overhead e le applicazioni saranno più veloci. Questo suggerimento potrebbe essere vero (dipende dalla applicazione che usa il FS), ma non dice che ext2 è molto più fragile e quindi si rischia di perdere tutte le informazioni su un ext2 molto di più che su un ext3 (o ext4).

GA: Il filesystem ext3 può essere montato con alcune opzioni particolari come noatime che ti possono aiutare ad ottenere migliori prestazioni, guarda le opzioni del comando mount.

6) D: L’avvio del mio desktop è un po’ lento

BA: E’ il kernel, configuralo a mano e togli tutto l’hardware che non è necessario. Ho accetatto personalmente questo suggerimento, ed ho trascorso circa 2 giorni in rimozione e l’aggiunta di nuovo di opzioni di un kernel, cercando di avere tutti i pezzi funzionanti del mio computer ed allo stesso tempo il kernel più piccolo possibile, per guadagnare qualcosa come 2 o 3 secondi all’avvio.

GA: Installate bootchart, questo mostrerà se c’è qualche punto che può essere migliorata durante il boot.

7) D: L’utente ha bisogno di una nuova libreria/programma/qualunque cosa che non è pacchettizzata per la distribuzione, cosa possiamo fare ?

BA: Se il pacchetto è disponibili in un repository non ufficiale aggiungiamolo alla lista dei repository di quella macchina ed installiamo da lì.
BA2: Scarica il sorgente e compilalo.

Non sono sicuro su quale sia il peggiore dei casi, installare un pacchetto con il vostro gestore di pacchetti, ma senza alcuna garanzia? o non usare il vostro gestore di pacchetti e fare una installazione dei binari dai sorgenti ?

GA: Scarica i sorgenti e fai un pacchetto che installeremo con il gestore dei pacchetti della distribuzione. La via più lunga ma più sicura.

8) D: Sembra esserci un problema tra l’applicazione XX ed il firewall locale

BA: Fermate il firewall. Questo di solito ha 2 effetti, il primo è che si perde di sicurezza su quel server, il secondo è che se ti sei dimenticato di togliere l’avvio automatico del firewall al momento del boot, al successivo riavvio l’applicazione non funzionerà.

GA: cercare di capire quali porte utilizza l’applicazione, o attivare la registrazione dettagliata dei log per il firewall, una volta che avete capito quali porte vengono utilizzate modificare il firewall.

Sono adesso in attesa ora dei peggiori suggerimenti su Linux che avete sentito.


Popular Posts:

Flattr this!

  9 Responses to “Gli 8 peggiori suggerimenti su Linux”

  1. Once read an article that said to use “su; gedit /etc/sudoers” and then instructions on how to give yourself “no password required” sudo privileges. SO many things wrong in that article…

  2. Q7: Downloading a binary from an unknown repository vs. compiling (and packaging) from an unknown source repository is really no different, unless you’re willing to invest in performing a source code audit to ensure there are no fatal errors or malcode in the source.

    Since most people who compile from source won’t bother to look through the source code, they’re not getting any benefit over those people who just install the binary directly.

    Worst suggestion I’ve ever heard? From fellow IT workers to end-users: “Just tell me your password so I can fix your problem”. An IT worker with sufficient privileges to fix the problem never needs to know end-users passwords. They’ll have sufficient access rights to get the job done. At worst, they can always reset the end-users password without asking what it is. Asking end-users for their passwords just trains them to be susceptible to phishing and social engineering attacks.

    –Bob.

    • Do you audit the sources from a known repo? So what’s the point? Either you trust it (and need to use it) – then install it. Otherwise don’t.
      I am running Debian/testing and the latest FF from mozilla.org. Very, very risky, isn’t it? Also hard to handle and causing all sorts of trouble. like having to type “cd /usr/local/share; tar -jxf firef*bz2” every some weeks…

  3. For question 7, I think you could mention checkinstall in the answer as a suggestion.
    I wish I found that long before I did… so much trouble avoided…

  4. Not exactly the worst of all the “Top foos of bar” I’ ve read, but also not a very good one.

    1. Yes. Right. Also don’t “rm -rf /”…
    2. Same. There’s some trickery with virtual users and ftpd/httpd UIDs. But better not tell anyone…
    3-5 Nobody on earth would do that,
    6. Learn to handle your kernel config. You might be in a situation where you need to build your own one.You suppose people should just keep their hands off. Why not just Windoze. XP is booting quite fast. No kernel compiling needed.
    7. Bullshit.
    8. Yes, right. What’s the date, again – 1998?

    • 3-5 I’ve saw these things done, you know after many hours of works a bad idea can seem not so bad 😉
      6 Now i compile my kernel for every single update, but it’s not a great tip for a newbie, just this.

      • Well, I’ve seen people do the most ridiculous things with their computers (I have been into these things since 1983) but these things are funny anecdotes at best – or, well, ok “x of n worst practices”. Point made. swapoff 🙂
        But I still strongly disagree with the “don’t install binaries or sources theory”. I’d be unable to run my sketchpad, if I hadn’t compiled the xorg module from a (well trusted) source. I couldn’t play bzflag, as Debian is still including 2.0.x in testing, so I built my own binaries from sourceforge. Bz has been around for more than 10 years, so I definitely trust them. Same with RSSOwl, GoogleEarth and a dozen of small utilities like $proprietary_image_format to ISO translators.
        And during the times when I was using Solaris/sparc self-compiling was quite oftenly the only way to get things done at all.
        The firewall thing at last: I think in the times of DSL-routers and UPnP you should definitively try to get your stuff secure on the application level, not rely on netfilters. Actually this is how it always was, but “firewalls” were very trendy (and considered falsely as universal security magick) quite some time ago.
        Sorry for harsh words, but they are always good to get discussing – and IMHO better than nice words with no effect.
        Cheers,
        Tom

        • Well i understand that sometimes you have to use sources, and this is fine, what i don’t like as sysadmin it’s the use of “any” repository.
          I’ve saw using PPA (and not big one, just some personal archive of an user) for Ubuntu on server with Debian 6, this is a bad practice IMO.

          Bye Tom.

  5. The chmod 777 one is particularly popular with WordPress kiddies and amateur script monkeys. Well….I hope someone trashes their server and teaches them a valuable lesson before they attempt to work on anything more important than their Pokemon fansite.

Leave a Reply to linuxari Cancel reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

*