Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 29/07/2012, à 15:20

BrunoL

/var : chown de trop ...

Bonjour,

Les groupes et propriétaires de mon /var sont tous à root:root suite à une fausse manip hmm

Je suis sur une version 12.4 server 64bits

Pourriez-vous me passer une liste de ces répertoires /var/  (sauf /www pour celui-là je me débrouille)
avec group et proprio ? c'est la /var/lib qui me gêne le plus ...

Merci.

Dernière modification par BrunoL (Le 29/07/2012, à 16:43)

Hors ligne

#2 Le 29/07/2012, à 15:45

xavier4811

Re : /var : chown de trop ...

On peut, j'en ai d'autres en stock si besoin

ls -lah /var
drwxr-xr-x 13 root root  4,0K juil. 28 07:17 .
drwxr-xr-x 26 root root  4,0K juil. 11 23:25 ..
drwxr-xr-x  4 root root  4,0K juil. 28 06:44 backups
drwxr-xr-x 18 root root  4,0K juil. 27 22:58 cache
drwxr-xr-x 65 root root  4,0K juil. 19 21:30 lib
drwxrwsr-x  2 root staff 4,0K avril 19 11:32 local
lrwxrwxrwx  1 root root     9 juin   2 23:44 lock -> /run/lock
drwxr-xr-x 21 root root  4,0K juil. 29 10:20 log
drwxrwsr-x  2 root mail  4,0K juil. 29 06:53 mail
drwxr-xr-x  2 root root  4,0K juin   2 23:44 opt
lrwxrwxrwx  1 root root     4 juil. 28 07:17 run -> /run
drwxr-xr-x  6 root root  4,0K juin   6 01:56 spool
drwxrwxrwt  3 root root  4,0K juil. 27 21:05 tmp
drwxr-xr-x  2 root root  4,0K juin   5 00:37 www

ls -lah /var/lib
drwxr-xr-x 65 root     root     4,0K juil. 19 21:30 .
drwxr-xr-x 13 root     root     4,0K juil. 28 07:17 ..
drwxr-xr-x  4 root     root     4,0K juin   2 23:54 AccountsService
drwxr-xr-x  6 root     root     4,0K juil. 27 23:37 apt
drwxr-xr-x  2 root     root     4,0K mars  30 19:21 aptitude
drwxr-xr-x  2 root     root     4,0K juin   4 19:01 aspell
drwxr-xr-x  2 root     root     4,0K juin   2 23:53 belocs
drwxr-xr-x  2 colord   colord   4,0K juin   5 19:43 colord
drwxr-xr-x  2 root     root     4,0K juin   2 23:56 dbus
drwxr-xr-x  2 root     root     4,0K juin  18 13:05 dhcp
drwxr-xr-x  4 root     root     4,0K juin   4 19:01 dictionaries-common
drwxr-xr-x  3 root     root     4,0K juin  11 16:07 dkms
drwxr-xr-x  7 root     root     4,0K juil. 27 23:37 dpkg
drwxr-xr-x  2 root     root     4,0K mai    4 21:41 flashplugin-installer
drwxr-xr-x  5 root     root     4,0K juin   4 18:53 gconf
drwxr-xr-x  4 root     root     4,0K juin   9 20:12 ghostscript
drwxr-xr-x  4 glance   glance   4,0K juil. 15 14:11 glance
drwxr-xr-x  2 root     root     4,0K juil.  8 16:50 initramfs-tools
drwxr-xr-x  2 root     root     4,0K avril 14 11:26 initscripts
drwxr-xr-x  2 root     root     4,0K avril 14 11:26 insserv
drwx------  3 keystone keystone 4,0K juil. 15 14:09 keystone
drwx------  2 openldap openldap 4,0K juil. 28 18:38 ldap
drwxrwsr-x  2 libuuid  libuuid  4,0K juin   2 23:46 libuuid
drwxr-xr-x  8 root     root     4,0K juin  24 00:14 libvirt
drwxr-xr-x  3 root     root     4,0K juin   2 23:45 locales
drwxr-xr-x  2 root     root     4,0K juil. 29 06:53 logrotate
drwxr-xr-x  2 root     root     4,0K juin   3 18:05 misc
drwxr-xr-x  2 root     root     4,0K juil. 29 06:53 mlocate
drwxr-xr-x  3 root     root     4,0K juil. 17 20:21 mplayer
drwxr-xr-x  2 root     root     4,0K juin   5 23:16 msttcorefonts
drwx------  9 mysql    mysql    4,0K juil. 28 18:38 mysql
drwxr-xr-x  5 statd    root     4,0K juil. 28 18:39 nfs
drwxr-xr-x  9 nova     nova     4,0K juil. 15 14:14 nova
drwxr-xr-x  2 ntp      ntp      4,0K juil. 29 16:40 ntp
drwxr-xr-x  2 root     root     4,0K mars   6 16:36 ntpdate
drwxr-xr-x  2 root     root     4,0K févr. 13 19:31 openbox
drwx------  2 root     root     4,0K oct.  12  2011 open-iscsi
drwxr-xr-x  2 root     root     4,0K juil.  8 16:50 os-prober
drwxr-xr-x  2 root     root     4,0K juin   4 18:56 pam
drwx-wx-wt  2 root     root     4,0K juil. 22 16:09 php5
drwxr-xr-x  2 root     root     4,0K juin   3 00:07 plymouth
drwx------  3 root     root     4,0K juin   4 18:55 polkit-1
drwxr-xr-x  2 postfix  postfix  4,0K juin   6 01:56 postfix
drwxr-xr-x  2 root     root     4,0K avril 12 07:07 pulseaudio
drwxr-xr-x  3 rabbitmq rabbitmq 4,0K juin  24 02:17 rabbitmq
drwxr-xr-x  4 root     root     4,0K juil. 19 21:30 rkhunter
drwxr-xr-x  2 root     root     4,0K nov.   2  2011 rpm
drwxr-xr-x  2 root     root     4,0K mai   18 10:24 samba
drwxr-xr-x  2 root     root     4,0K juin   2 23:55 sgml-base
drwxr-xr-x  2 root     root     4,0K avril  5 19:26 slapd
drwx------  3 root     root     4,0K janv.  1  1985 sudo
drwxr-xr-x  2 root     root     4,0K avril 17 14:30 synaptic
drwxr-xr-x  3 root     root     4,0K juil. 19 21:30 ucf
drwxr-xr-x  2 root     root     4,0K juil. 29 10:21 udisks
drwxr-xr-x  2 root     root     4,0K juin   3 00:08 update-manager
drwxr-xr-x  4 root     root     4,0K juil.  4 08:38 update-notifier
drwxr-xr-x  2 root     root     4,0K juil. 27 00:07 update-rc.d
drwxr-xr-x  2 root     root     4,0K juil. 28 18:38 urandom
drwxr-xr-x  3 root     root     4,0K juil. 28 18:40 ureadahead
drwxr-xr-x  2 root     root     4,0K juin   2 23:49 usbutils
drwxr-xr-x  3 root     root     4,0K juin   2 23:46 vim
drwxr-xr-x  2 root     root     4,0K juin   4 19:08 xfonts
drwxr-xr-x  2 root     root     4,0K juin  24  2011 xkb
drwxr-xr-x  2 root     root     4,0K juin   4 22:04 xml-core

Hors ligne

#3 Le 29/07/2012, à 16:46

BrunoL

Re : /var : chown de trop ...

Merci xavier4811 tu me sauves smile
Tout semble remarcher web/horde, sql, ...

Petit complément pour éviter cette bourde à l'avenir :
Peut-on loguer (sudo) en www-data pour installer des application web ? parce que loggué en root ou en user (moi) c'est pas top !

Dernière modification par BrunoL (Le 29/07/2012, à 16:47)

Hors ligne

#4 Le 29/07/2012, à 17:18

xavier4811

Re : /var : chown de trop ...

Tes applis sont installées ou ?
C'est plus propre de les mettre dans dossier sur lequel tu a les droits et ajouter un fichier de conf dans /etc/apache2/conf.d
C'est comme ça que sont installées toutes les web apps sur Debian et Ubuntu et /var/www reste vide.
Par exemple une appli "monappli" est installée dans /usr/share/monappli et le fichier /etc/apache2/conf.d/monappli créé un alias (ou a la racine du serveur "Alias / /usr/share/monappli")

Alias /monappli /usr/share/monappli

<Directory /usr/share/monappli>
	Options FollowSymLinks
	DirectoryIndex index.php
        Mes_autres_options

</Directory>

Dernière modification par xavier4811 (Le 29/07/2012, à 17:18)

Hors ligne

#5 Le 29/07/2012, à 17:30

BrunoL

Re : /var : chown de trop ...

Aïe, je fais exactement le contraire ... tout dans /var/www/mon_appli/

Bon j'ai tout faux. Mais je croyais que le fait de tout mettre dans la var/www/ présentait des avantages en matière de sécurité. Procéder comme tu l'indiques ne présente pas plus de risque ?

Pour l'install, qui doit installer de préférence root, www-data ou autres ?

Merci Xavier.

Hors ligne

#6 Le 29/07/2012, à 17:43

xavier4811

Re : /var : chown de trop ...

BrunoL a écrit :

Procéder comme tu l'indiques ne présente pas plus de risque ?

Je suis pas spécialiste, je constate ce qui a changé depuis que j'utilise diverses distributions.
Tout doit appartenir a root et les droits au maximum a 755 (read execute)
Pourquoi ne pas développer dans un dossier perso dédié et faire un sudo cp vers www ensuite.

Hors ligne

#7 Le 29/07/2012, à 21:21

BrunoL

Re : /var : chown de trop ...

Sauf erreur concernant le www les fichiers doivent principalement appartenir à www-data. D'où ma question rapportée à ta remarque, comment faire le cp vers www pour que les fichiers y arrive avec user=www-data: groupe=www-data. Ceci afin d'éviter le chown suivant et ses risques, cf l'origine de ce fil wink

Bonne soirée.

Hors ligne

#8 Le 29/07/2012, à 21:28

xavier4811

Re : /var : chown de trop ...

xavier@zeus:~$ cat /etc/apache2/conf.d/openstack-dashboard.conf 
WSGIScriptAlias / /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi
WSGIDaemonProcess horizon user=www-data group=www-data processes=3 threads=10
Alias /static /usr/share/openstack-dashboard/openstack_dashboard/static/
<Directory /usr/share/openstack-dashboard/openstack_dashboard/wsgi>
  Order allow,deny
  Allow from all
</Directory>
xavier@zeus:~$ ls -lah /var/www
total 12K
drwxr-xr-x  2 root root 4,0K juin   5 00:37 .
drwxr-xr-x 13 root root 4,0K juil. 28 07:17 ..
-rw-r--r--  1 root root  177 juin   3 13:11 index.html
xavier@zeus:~$ ls -lah /usr/share/openstack-dashboard/
total 48K
drwxr-xr-x   4 root root 4,0K juil. 15 14:16 .
drwxr-xr-x 241 root root  12K juil. 27 23:36 ..
-rwxr-xr-x   1 root root  314 mai    5 14:42 manage.py
-rw-r--r--   1 root root  506 juil. 15 14:16 manage.pyc
drwxr-xr-x   7 root root 4,0K juil. 15 14:16 openstack_dashboard
drwxr-xr-x   2 root root 4,0K juil. 15 14:16 quantum
-rw-r--r--   1 root root 4,3K avril  4 04:13 settings.py
-rw-r--r--   1 root root 5,2K juil. 15 14:16 settings.pyc

et pourtant j'y accède sans problème.C'est installé comme ça avec apt-get.

Hors ligne