=============================================================================== Come installare sshd di cygwin =============================================================================== 1) Occorre essere loggati come administrator locale; administrator deve avere una password non nulla. 2) Disinstallare qualsiasi software che utilizza cygwin (es. cwrsync, COPsshd, etc) e rimuovere le chiavi dal registry relative a Cygwin. Cancellare eventuali dll cygwin1.dll sparse per il disco. 3) Scaricare setup.exe from http://www.cygwin.com/ e salvarlo in c:\cygwin 3a) Se si dispone già dei pacchetti downloadati, basta copiarli in locale 4) Lanciare setup.exe... selezionare "All users", come directory per i package specificare c:\cygwin - scegliere un mirror vicino - fare click su "View" per ottenere l'elenco completo dei pacchetti (Full) - verificare che siano selezionati, e in caso contrario selezionare i seguenti packages facendo click su "skip" in modo che compaia un checkbox sulla colonna "Bin": - ash - openssh - rsync - tcp_wrappers - zlib - Fare click su start e attendere download e installazione. 5) Click col destro su Risorse del Computer -> Proprietà -> Avanzate -> Variabili d'ambiente - aggiungere una variabile 'CYGWIN' con valore 'nontsec nosmbntsec tty' - modificare 'PATH' e aggiungere c:\cygwin\bin in coda 6) Aprire una finestra cygwin (l'icona dovrebbe essere sul desktop) - importare gli utenti e i gruppi di windows mkpasswd -cl > /etc/passwd mkgroup --local > /etc/group - avviare la configurazione di sshd, digitando ssh-host-config Should privilege separation be used? (yes/no) yes Do you want to install sshd as service? (Say "no" if it's already installed as service) (yes/no) yes NOTA:Windows Server 2003 You appear to be running Windows 2003 Server or later. On 2003 and later systems, it's not possible to use the LocalSystem account if sshd should allow passwordless logon (e. g. public key authentication). If you want to enable that functionality, it's required to create a new account 'sshd_server' with special privileges, which is then used to run the sshd service under. Should this script create a new local account 'sshd_server' which has the required privileges? (yes/no) no Se non si vuole utilizzare la funzione di login senza password, si può evitare la creazione di un utente apposito per sshd e utilizzare il solito SYSTEM. Which value should the environment variable CYGWIN have when sshd starts? It's recommended to set at least "ntsec" to be able to change user context without password. Default is "ntsec". CYGWIN=ntsec tty - sistemare i privilegi chown SYSTEM /etc/ssh* chown SYSTEM /var/empty 7) Avviare il servizio sshd net start sshd oppure cygrunsrv --start sshd =============================================================================== Come installare rsyncd di cygwin =============================================================================== 1) Aprire una finestra cygwin touch /etc/rsyncd.conf cygrunsrv -I "rsyncd" -p /usr/bin/rsync -a '--daemon --no-detach' cygrunsrv -S "rsyncd" $ chown Administrator /var/log/rsyncd.log (poi da services.msc far avviare rsyncd come Administrator e non come SYSTEM) Una volta avviato il servizio, configurare a piacimento rsyncd.conf e riavviare il servizio. ( per windows 2003: cygrunsrv.exe -I "Rsync" -p /cygdrive/c/cygwin/bin/rsync.exe -a "--config=/cygdrive/c/cygwin/etc/rsyncd.conf --daemon --no-detach" -f "Rsync daemon service" -u Administrator -w password ) Esempio: gid = Administrators read only = false use chroot = false transfer logging = false log file = /var/log/rsyncd.log log format = %h %o %f %l %b hosts allow = 192.168.0.2 hosts deny = 0.0.0.0/0 strict modes = false [test] path = /cygdrive/c/test comment = test directory list = yes read only = no auth users = utente secrets file = /etc/rsyncd.secrets Esempio file rsyncd.secrets: utente:password