Différences entre versions de « BootStrapWindows »

De Cliss XXI
Sauter à la navigation Sauter à la recherche
imported>VincentAdolphe
m (A protégé « BootStrapWindows »: en cours ([edit=sysop] (infini) [move=sysop] (infini)))
imported>WikiSysop
Ligne 1 : Ligne 1 :
 
{| border="1" cellpadding="15" style="border-collapse:collapse;border-spacing:0px;border-color:lightgrey;"
 
{| border="1" cellpadding="15" style="border-collapse:collapse;border-spacing:0px;border-color:lightgrey;"
||
 
 
||
 
Depuis une installation de base
 
||
 
Depuis une installation existante
 
|-
 
 
|bgcolor="orange" rowspan="2"|
 
|bgcolor="orange" rowspan="2"|
 
Accès physique à la machine (écran clavier)
 
Accès physique à la machine (écran clavier)
 +
+ powershell admin
 
||
 
||
Créer un compte "root" lors de l'installation avec les droits administrateurs
+
* Créer l'utilisateur "root" si besoin
||
 
Créer un compte "root" depuis un autre utilisateur
 
 
<PRE>
 
<PRE>
net user cyg_server 'PASS' /add
+
$PASS = 'rootpass'
 +
net user root '$PASS' /add
 
net localgroup Administrateurs cyg_server /add
 
net localgroup Administrateurs cyg_server /add
 
</PRE>
 
</PRE>
Ligne 20 : Ligne 13 :
 
|-
 
|-
 
|colspan="2"|
 
|colspan="2"|
* Se connecter avec ce nouveau compte (windows initialise des trucs a ce moment là qui simplifie le login ssh sur ce compte par la suite)
+
* (Se connecter avec ce nouveau compte (windows initialise des trucs a ce moment là qui simplifie le login ssh sur ce compte par la suite))
 
* regler les éventuels pb d'antivirus/firewall (certain en s'installant ou se désinstallant modifie le firewall de windows (en pratique laisser l'antivirus fournis avec l'OS et dégager les autres)
 
* regler les éventuels pb d'antivirus/firewall (certain en s'installant ou se désinstallant modifie le firewall de windows (en pratique laisser l'antivirus fournis avec l'OS et dégager les autres)
* Installer chocolatey (cf https://chocolatey.org/install) depuis un terminal "power shell admin":<PRE>Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))</PRE>
+
* Installer chocolatey (cf https://chocolatey.org/install) cygwin, cyg-get, openssh, ouvrir le firewall et lancer un shell cygwin:
* installer un serveur VNC:<PRE>choco install -y tightvnc</PRE>
+
<PRE>
* configurer le serveur VNC avec un mot de passe
+
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
 +
choco install -y cygwin cyg-get
 +
cyg-get.bat openssh
 +
netsh advfirewall firewall add rule name="ssh" dir=in action=allow protocol=TCP localport=22
 +
netsh advfirewall firewall add rule name="ICMP ping" protocol=icmpv4:8,any dir=in action=allow
 +
C:\tools\cygwin\bin\mintty.exe -
 +
</PRE>
 
|-
 
|-
|bgcolor="lightblue"|
+
|bgcolor="cyan" rowspan="1"|
Accès à la machine via VNC
+
Accès physique à la machine, shell cygwin admin
|colspan="2"|
+
||
* si l'installation est longue, configurer un profil sans mise en veille pour éviter de perdre la main
+
configurer ssh:
* dans un terminal "power shell admin" installer cygwin et cyg-get:<PRE>choco install -y cygwin cyg-get</PRE>
+
<PRE>
* puis lancer un terminal "cygwin admin" (ça peut se faire depuis le terminal power shell):<PRE>C:\tools\cygwin\bin\mintty.exe -</PRE>
+
$PASS = 'rootpass'
* dans un terminal "cygwin admin" installer ssh:<PRE>cyg-get.bat openssh</PRE>
+
ssh-host-config --debug --yes --name 'sshd' --port 22 --pwd "$PASS"
* puis configurer ssh:<PRE>ssh-host-config --debug --yes --name 'sshd' --port 22 --pwd "un_mot_de_passe_fort"</PRE>
+
cygrunsrv.exe --start sshd
* ouvrir le firewall (tcp/22 et ping):
+
</PRE>
netsh advfirewall firewall add rule name="ssh" dir=in action=allow protocol=TCP localport=22
+
|-
  netsh advfirewall firewall add rule name="ICMP ping" protocol=icmpv4:8,any dir=in action=allow
+
|bgcolor="lightgreen" rowspan="1"|
 +
Accès via ssh
 +
||
 +
* un role ansible permettant de pousser les clef ssh publique peut etre joué a ce moment.
 +
<PRE>
 +
VNCPASS="vncpass"
 +
choco install -y tightvnc
 +
regtool  set '\HKLM\software\tightvnc\server\accepthttpconnections' 0
 +
regtool set '\HKLM\software\tightvnc\server\UseVncAuthentication' 1
 +
PASS=$(echo "$VNCPASS" | vncpasswd -f | hexdump -v -e '/1 "%02x "')
 +
regtool --binary set '\HKLM\software\tightvnc\server\password' $PASS
 +
net stop tvnserver
 +
net start tvnserver
 +
</PRE>
 +
* note the gui controler quit but tightvncserver is running
 +
<PRE>
 +
choco -y libreoffice thunderbird firefox vlc
 +
</PRE>
 
|}
 
|}

Version du 15 juin 2018 à 00:16

Accès physique à la machine (écran clavier) + powershell admin

  • Créer l'utilisateur "root" si besoin
$PASS = 'rootpass'
net user root '$PASS' /add
net localgroup Administrateurs cyg_server /add

Sur une installation anglaise, c'est "Administrators"

  • (Se connecter avec ce nouveau compte (windows initialise des trucs a ce moment là qui simplifie le login ssh sur ce compte par la suite))
  • regler les éventuels pb d'antivirus/firewall (certain en s'installant ou se désinstallant modifie le firewall de windows (en pratique laisser l'antivirus fournis avec l'OS et dégager les autres)
  • Installer chocolatey (cf https://chocolatey.org/install) cygwin, cyg-get, openssh, ouvrir le firewall et lancer un shell cygwin:
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install -y cygwin cyg-get
cyg-get.bat openssh
netsh advfirewall firewall add rule name="ssh" dir=in action=allow protocol=TCP localport=22
netsh advfirewall firewall add rule name="ICMP ping" protocol=icmpv4:8,any dir=in action=allow
C:\tools\cygwin\bin\mintty.exe -

Accès physique à la machine, shell cygwin admin

configurer ssh:

$PASS = 'rootpass'
ssh-host-config --debug --yes --name 'sshd' --port 22 --pwd "$PASS"
cygrunsrv.exe --start sshd

Accès via ssh

  • un role ansible permettant de pousser les clef ssh publique peut etre joué a ce moment.
VNCPASS="vncpass"
choco install -y tightvnc
regtool  set '\HKLM\software\tightvnc\server\accepthttpconnections' 0
regtool  set '\HKLM\software\tightvnc\server\UseVncAuthentication' 1
PASS=$(echo "$VNCPASS" | vncpasswd -f | hexdump -v -e '/1 "%02x "')
regtool --binary set '\HKLM\software\tightvnc\server\password' $PASS
net stop tvnserver
net start tvnserver
  • note the gui controler quit but tightvncserver is running
choco -y libreoffice thunderbird firefox vlc