User Tools

Site Tools


programming:bash:miscellaneous_notes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
programming:bash:miscellaneous_notes [2012/05/08 14:36] sbolayprogramming:bash:miscellaneous_notes [2012/05/09 05:27] sbolay
Line 1045: Line 1045:
 If a user can not login normally on the XP computer: If a user can not login normally on the XP computer:
  
-printers can not be add correctly (error 5 given by Kixtart - rights error) +  - printers can not be add correctly (error 5 given by Kixtart - rights error) 
-Users can simply not loggin on the computer (windows says pw error!)+  Users can simply not loggin on the computer (windows says pw error!) 
 I dont know exactly the reason of that but it seems that is caused by a sid error or something like this. To get right of this problem we have to clean the user profile. I dont know exactly the reason of that but it seems that is caused by a sid error or something like this. To get right of this problem we have to clean the user profile.
  
-Loggoff the user witch as the problematic profile +  - Loggoff the user witch as the problematic profile 
-mv /server/profile/“theProblematicProfile/” /server/profile/“theProblematicProfile.bck”/ +  mv /server/profile/“theProblematicProfile/” /server/profile/“theProblematicProfile.bck”/ 
-mkdir /server/profile/“theNewProfileDirectory”/ +  mkdir /server/profile/“theNewProfileDirectory”/ 
-chmod and chown +  chmod and chown 
-To resolve this you can either: +  To resolve this you can either: 
-Logon on a machine where the user does not yet has a saved profile with is username and pw to recreate a “clean” profile or +    Logon on a machine where the user does not yet has a saved profile with is username and pw to recreate a “clean” profile or 
-Logon to the machine usually used by the user as local/administrator +    Logon to the machine usually used by the user as local/administrator 
-Suppress the local copy of profiles: My Computer -> properties -> Advanced -> UserProfiles… +      Suppress the local copy of profiles: My Computer -> properties -> Advanced -> UserProfiles… 
-settings: remove all profiles except local\administrator +      settings: remove all profiles except local\administrator 
-regedit the registry and suppress everything about the user (make some searches with specific keywords) +      regedit the registry and suppress everything about the user (make some searches with specific keywords) 
-Restart the computer +      Restart the computer 
-loggin as network\administrator (to install and reset the registry with clean values - see kixtart script) +      - login as network\administrator (to install and reset the registry with clean values - see kixtart script) 
-loggoff +      - logoff 
-loggin as the user to recreate a “clean” profile +      - login as the user to recreate a “clean” profile 
-loggoff the user +  - logoff the user 
-On the server copy all relevant/interesting folders/data as favorites; Desktop; Application Data … mail and others; check the MyDocument folder; … +  On the server copy all relevant/interesting folders/data as favorites; Desktop; Application Data … mail and others; check the MyDocument folder; … 
-chmod / chown on this folders +  chmod / chown on this folders 
-Done… and the user can loggin back on computers and everything should be ok. +  Done… and the user can loggin back on computers and everything should be ok.
-WARNING: Do not mv but cp data from the backuped folder to the new one and keep it for days to be able to give user back some possible forgotten data!+
  
-mapping a windows group to a UNIX/LINUX group+<note warning>Do not mv but cp data from the backuped folder to the new one and keep it for days to be able to give user back some possible forgotten data!</note> 
 + 
 +==== mapping a windows group to a UNIX/LINUX group ====
  
 net groupmap add ntgroup=“Users” UNIXgroup=users net groupmap list net groupmap add ntgroup=“Users” UNIXgroup=users net groupmap list
  
 pour recuperer vos anciens profils, il faut les migrer de l'ancien SID vers le nouveau comme ceci: pour recuperer vos anciens profils, il faut les migrer de l'ancien SID vers le nouveau comme ceci:
 +  * les mettre sur le serveur en mode itinerant (c'est mieux avec samba au depart pour la migration
 +  * partager le dossier comme necessaire (voir la doc de samba sur les profils)
 +  * une fois tous les profils sur le serveur disons dans le dossier /users dans chaque dossier utilisateur /user/user1, /users/user2 etc… vous trouverez le fichier ntuser.dat (la ruche HKEY_CURRENT_USER). Le probleme c'est qu'elle contient les SID de l'ancien compte or le domaine SAMBA possede son propre SID qui est different de celui de l'ancien domaine de rattachement du profil.
  
-les mettre sur le serveur en mode itinerant (c'est mieux avec samba au depart pour la migration 
-partager le dossier comme necessaire (voir la doc de samba sur les profils) 
-une fois tous les profils sur le serveur disons dans le dossier /users dans chaque dossier utilisateur /user/user1, /users/user2 etc… vous trouverez le fichier ntuser.dat (la ruche HKEY_CURRENT_USER). Le probleme c'est qu'elle contient les SID de l'ancien compte or le domaine SAMBA possede son propre SID qui est different de celui de l'ancien domaine de rattachement du profil. 
 donc la marche a suivre est la suivante : donc la marche a suivre est la suivante :
 +  * vous creez les users dans samba: smbpasswd etc…
 +  * vous recuperez le SID de l'utilisateur
 +  * pdbedit -Lv user1 et cherchez la ligne SID (sous l forme S-X-……)
  
-vous creez les users dans samba: smbpasswd etc… 
-vous recuperez le SID de l'utilisateur 
-pdbedit -Lv user1 et cherchez la ligne SID (sous l forme S-X-……) 
 ensuite c'est simple, profiles ntuser.dat va vous afficher plein de lignes cherchez le SID dedans et faite un remplacement comme ceci: ensuite c'est simple, profiles ntuser.dat va vous afficher plein de lignes cherchez le SID dedans et faite un remplacement comme ceci:
 +  * profiles ntuser.dat OLDSID NEWSID sur les PC
 +  * ensuite dans document and settings supprimez TOUS les profils sur toutes les machines correspondants a ceux que vous avez envoyé sur le serveur.
 +  * y a plus qu'a vous logguer et vous n'aurez plus de dossier sous la forme User.DOMAINE
  
-profiles ntuser.dat OLDSID NEWSID sur les PC +===== inetd / xinetd =====
-ensuite dans document and settings supprimez TOUS les profils sur toutes les machines correspondants a ceux que vous avez envoyé sur le serveur. +
-y a plus qu'a vous logguer et vous n'aurez plus de dossier sous la forme User.DOMAINE +
-inetd / xinetd+
  
 all ports are listed in /etc/services all ports are listed in /etc/services
Line 1095: Line 1097:
  
 starting the xinetd daemon: sudo /etc/init.d/xinetd start/stop/restart restart xinetd daemon to take in acount the new configuration (This is an old method) starting the xinetd daemon: sudo /etc/init.d/xinetd start/stop/restart restart xinetd daemon to take in acount the new configuration (This is an old method)
 +<code bash>
 su su
 ps -u root | grep xinetd (get PID of xinetd) ps -u root | grep xinetd (get PID of xinetd)
 kill -s SIGUSR1 "PID of xinetd" kill -s SIGUSR1 "PID of xinetd"
 +</code>
 +
 Now you can simply /etc/init.d/xinetd restart/reload Now you can simply /etc/init.d/xinetd restart/reload
  
-nmap / xnmap+===== nmap / xnmap =====
  
 test open ports on an given host nmap / xnmap (==nmapfe) (from package nmap-gtk which is a nmap frontend) example: nmap localhost test open ports on an given host nmap / xnmap (==nmapfe) (from package nmap-gtk which is a nmap frontend) example: nmap localhost
programming/bash/miscellaneous_notes.txt · Last modified: 2012/05/09 19:24 by sbolay