Linux autenticando no AD e rodando LTSP com DHCP (Windows 2003)
Nesse artigo quero expôr detalhadamente um caso de sucesso em um cliente onde eu e outro amigo tivemos que colocar o Linux (Ubuntu Server 8.04 LTS) para autenticar no AD do Windows 2003 Server e rodar nele o LTSP 5, pegando do DHCP do 2003. Espero que gostem, pois deu muito trabalho fazer isso, mas ficou muito show!
Introdução
Como sabem, vamos falar aqui de um serviço que talvez alguém um dia tente fazer por necessidade mesmo, como foi nesse cliente que fomos atender.
O que vamos utilizar:
Essa vai ser a máquina que vamos colocar no domínio AD 2003.
Vamos ao assunto.
# apt-get update
# apt-get install ltsp-server-standalone openssh-server
Após feito, vamos conferir se o SSH esta configurado conforme necessário.
Precisamos que a diretiva "X11Forwarding yes" esteja setada no arquivo a seguir:
# vim /etc/ssh/sshd_config
# ltsp-build-client
Se o ambiente não for instalado com sucesso, tem que remover o diretório "/opt/ltsp/" e rodar de novo o comando.
# rm -rf /opt/ltsp
# ltsp-build-client
Após feitas as configurações é só colocar as máquinas para dar boot pela rede e pronto, o LTSP já é para esta funcionando corretamente.
Concluímos assim a nossa primeira parte do tutorial. O nosso próximo passo é fazer com que os usuários que irão utilizar o LTSP sejam autenticados no Active Directory, vamos lá.
O que vamos utilizar:
- Linux Ubuntu Server 8.04 LTS
- LTSP 5
- Samba
- Winbind
- Kerberos
Essa vai ser a máquina que vamos colocar no domínio AD 2003.
Vamos ao assunto.
Instalando LTSP 5
Vamos instalar o LTSP 5:# apt-get update
# apt-get install ltsp-server-standalone openssh-server
Após feito, vamos conferir se o SSH esta configurado conforme necessário.
Precisamos que a diretiva "X11Forwarding yes" esteja setada no arquivo a seguir:
# vim /etc/ssh/sshd_config
# Package generated configuration file
# See the sshd(8) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes
# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768
# Logging
SyslogFacility AUTH
LogLevel INFO
# Authentication:
LoginGraceTime 120
PermitRootLogin no
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no
# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes
# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no
#MaxStartups 10:30:60
#Banner /etc/issue.net
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes
# See the sshd(8) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes
# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768
# Logging
SyslogFacility AUTH
LogLevel INFO
# Authentication:
LoginGraceTime 120
PermitRootLogin no
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no
# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes
# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no
#MaxStartups 10:30:60
#Banner /etc/issue.net
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes
Configurando ambiente para terminais
Instalando o ambiente para os terminais:# ltsp-build-client
Se o ambiente não for instalado com sucesso, tem que remover o diretório "/opt/ltsp/" e rodar de novo o comando.
# rm -rf /opt/ltsp
# ltsp-build-client
Configurando DHCP do Windows 2003 para o LTSP
Para fazer isso acontecer basta marcar as opções de configuração do DHCP do Windows:- 17 Root Path - 192.168.1.5:/opt/ltsp/i386
- 66 Boot Server Host Name - 192.168.1.5
- 67 Bootfile Name- /ltsp/i386/pxelinux.0
Após feitas as configurações é só colocar as máquinas para dar boot pela rede e pronto, o LTSP já é para esta funcionando corretamente.
Concluímos assim a nossa primeira parte do tutorial. O nosso próximo passo é fazer com que os usuários que irão utilizar o LTSP sejam autenticados no Active Directory, vamos lá.