Install Guacamole on CentOS 7

This post is for installing the latest version of Guacamole on CentOS 7, as there are several difference from the previous guide I did. If you want to read more about Guacamole, and how awesome it is, I recommend you take a glance at my previous post here.

**Note, I am installing the MySQL Authentication package which allows me to store connections and authentication information in a database, instead of a plain-text XML file.
Let’s Get Started!

1.) prerequisites:

yum -y install epel-release wget
wget -O /etc/yum.repos.d/home:felfert.repo http://download.opensuse.org/repositories/home:/felfert/Fedora_19/home:felfert.repo
yum -y install cairo-devel freerdp-devel gcc java-1.8.0-openjdk.x86_64 libguac libguac-client-rdp libguac-client-ssh libguac-client-vnc \
libjpeg-turbo-devel libpng-devel libssh2-devel libtelnet-devel libvncserver-devel libvorbis-devel libwebp-devel openssl-devel pango-devel \
pulseaudio-libs-devel terminus-fonts tomcat tomcat-admin-webapps tomcat-webapps uuid-devel

Above we are just installing adding the EPEL and Felfert repositories that contain the files we need, and installing all our prereqs. Easy.

2.) guacd install

mkdir ~/guacamole && cd ~/
wget http://sourceforge.net/projects/guacamole/files/current/source/guacamole-server-0.9.9.tar.gz
tar -xzf guacamole-server-0.9.9.tar.gz && cd guacamole-server-0.9.9
./configure --with-init-dir=/etc/init.d
make
make install
ldconfig

Guacamole is delivered in two different pieces. The back-end is what we just installed above, from source, called guacd (or guacamole daemon). The other piece is the guacamole client, or web frontend. This is delivered via Jetty, and installed next.

3.) guacamole client

mkdir -p /var/lib/guacamole && cd /var/lib/guacamole/
wget http://sourceforge.net/projects/guacamole/files/current/binary/guacamole-0.9.9.war -O guacamole.war
ln -s /var/lib/guacamole/guacamole.war /var/lib/tomcat/webapps/
rm -rf /usr/lib64/freerdp/guacdr.so
ln -s /usr/local/lib/freerdp/guacdr.so /usr/lib64/freerdp/

We now have the guacamole server daemon and the guacamole client installed. Next up is the MySQL Authentication piece, using MariaDB.

4.) mysql authentication

yum -y install mariadb mariadb-server
mkdir -p ~/guacamole/sqlauth && cd ~/guacamole/sqlauth
wget http://sourceforge.net/projects/guacamole/files/current/extensions/guacamole-auth-jdbc-0.9.9.tar.gz
tar -zxf guacamole-auth-jdbc-0.9.9.tar.gz
wget http://dev.mysql.com/get/Downloads/Connector/j/mysql-connector-java-5.1.38.tar.gz
tar -zxf mysql-connector-java-5.1.38.tar.gz
mkdir -p /usr/share/tomcat/.guacamole/{extensions,lib}
mv guacamole-auth-jdbc-0.9.9/mysql/guacamole-auth-jdbc-mysql-0.9.9.jar /usr/share/tomcat/.guacamole/extensions/
mv mysql-connector-java-5.1.38/mysql-connector-java-5.1.38-bin.jar /usr/share/tomcat/.guacamole/lib/
systemctl restart mariadb.service

The above is installing mariadb, downloading the needed .jar’s, and moving them to where they belong. All but one jar file is included in the Guacamole MySQL Auth download, which is the MySQL Java Connector.

5.) configure database

mysqladmin -u root password MySQLRootPass
mysql -u root -p   # Enter above password
create database guacdb;
create user 'guacuser'@'localhost' identified by 'guacDBpass';
grant select,insert,update,delete on guacdb.* to 'guacuser'@'localhost';
flush privileges;
quit

Here we created the database and user for guacd to use.

6.) extend database schema

cd ~/guacamole/sqlauth/guacamole-auth-jdbc-0.9.9/mysql/schema/
cat ./*.sql | mysql -u root -p guacdb   # Enter SQL root password set above

And here we extend the schema of the database we created.

7.) configure guacamole

mkdir -p /etc/guacamole/ && vi /etc/guacamole/guacamole.properties

The above is creating our needed directories, and then creating the guacamole.properties file. This file is what tomcat uses to know what port to talk to guacd on as well as how to access the database. Here is a basic guacamole.properties file that will do what you need.

# MySQL properties
mysql-hostname: localhost
mysql-port: 3306
mysql-database: guacdb
mysql-username: guacuser
mysql-password: guacDBpass

# Additional settings
mysql-default-max-connections-per-user: 0
mysql-default-max-group-connections-per-user: 0

This will configure guacamole to use the database and user that we created on the default port of 4822. Note, this is for internal communication only and is not the port that you will be accessing the web interface on.

And we have to create a symlink so Guacamole can find the config file:

ln -s /etc/guacamole/guacamole.properties /usr/share/tomcat/.guacamole/

8.) Cleanup

All that’s left is a little housecleaning!

cd ~ && rm -rf guacamole*
systemctl enable tomcat.service && systemctl enable mariadb.service && chkconfig guacd on
systemctl reboot

Once your server boots, you’ll have Guacamole running and ready to be used! Head on over to http://guac_server_ip:8080/guacamole to start using your new Guacamole server! default username and password are both ‘guacadmin’.

If you’re having trouble accessing the webpage for Guacamole, make sure you have configured firewalld (or disabled it) to allow access to port 8080.

Leave me some feedback!

Continue Reading

Install Nagios 4.0.4 on Centos 7

For RHEL/CentOS users:

#yum install -y wget httpd php gcc glibc glibc-common gd gd-devel make net-snmp
#yum install   httpd php  gd gd-devel gcc glibc glibc-common openssl perl perl-devel makesasa

Download Nagios Core and Nagios Plugins Tarballs
For all systems, run the following commands in your terminal:

cd /tmp
#wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.4.tar.gz
#wget http://nagios-plugins.org/download/nagios-plugins-2.0.tar.gz

This will download Nagios Core, and it’s required plugins.
Adding the Nagios User and Group
Next add the appropriate user and group for the Nagios process to run:

#useradd nagios
#groupadd nagcmd
#usermod -a -G nagcmd nagios

Nagios Core Installatiom

#tar zxvf nagios-4.0.4.tar.gz
#tar zxvf nagios-plugins-2.0.tar.gz

Change to the new Nagios directory and install the packages:

#cd nagios-4.0.4
#./configure --with-command-group=nagcmd
#make all
#make install
#make install-init
#make install-config
#make install-commandmode
#make install-webconf
#cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/
#chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
#/etc/init.d/nagios start

For RHEL/CentOS users:

#/etc/init.d/httpd start
#systemctl start httpd

Create a Default User for Web Access.
Add a default user for Web Interface Access:

#htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Nagios Plugin Installation

#cd /tmp/nagios-plugins-2.0
#./configure --with-nagios-user=nagios --with-nagios-group=nagios
#make
#make install

Nagios Service Setup
The following commands will register the Nagios daemon to be run upon system startup.

chkconfig --add nagios
chkconfig --level 35 nagios on
chkconfig --add httpd
chkconfig --level 35 httpd on

Nagios Web Interface
After correctly following the procedures you should now
be able to access your Nagios Core installation from a
web browser.
Simply use the following:
http://<your.nagios.server.ip>/nagios
And log in with the credentials you chose when adding
the nagiosadmin user to the htpasswd.users file.
Finishing

Continue Reading

Recuperando a senha do Administrador do Windows Server 2008 / R2

Aplica-se: Windows Vista /  Windows 7 / Windows Server 2008 / Windows Server 2008 R2

Neste tutorial iremos abordar um assunto muito polemico referente a recuperação de senha do Windows, podemos realizar uma busca no Bing ou Google iremos achar vários tutorias e ferramentas para realização da tarefa, queremos demonstrar de forma clara e fácil como podemos resolver este problema.

A forma segura que não altere a estrutura do sistema operacional e suas funcionalidades, estamos falando em realizar esta ação sem precisar daquelas mídias com aqueles sistema com milhares de distribuições e alterações, neste caso iremos utilizar a mídia do próprio sistema operacional em nosso exemplo: Windows Server 2008 R2

Em nosso exemplo estamos utilizando o Hyper-V R2 utilizando uma VM com Windows Server 2008 R2 e conforme a mensagens abaixo não possuímos a senha do administrador : Nome de usuário ou senha incorreta.

1

Então iremos realizar o Boot com a mídia do sistema.

2

Primeiramente temos as opções de Idiomas e formato do teclado.

3

Iniciando modo de recuperação da senha, devemos entrar no modo de Recuperação do Sistema.

4

Iremos selecionar a opção ( Prompt de Comando ).

5

Com o Prompt de Cmando aberto, iremos mudar o diretório para “D:” e navegar até a pastaD:\Windows\Sustem32

Obs.: em nosso exemplo a letra D: é referência onde o Windows foi instalado, contudo na maiorias das vezes fica localizado em C:

6

Agora vamos renomear o utilitário conhecido como Utilman, através do seguinte comando: “renutilman.exe utilman.bak

Agora vamos renomear o utilitário conhecido como Utilman, através do seguinte comando: “renutilman.exe utilman.bak

7

Processo com a mídia de instalação concluída, devemos reiniciar o computador.

9

Neste momento não iremos utilizar a mídia de instalação, devemos iniciar o sistema normalmente.

Com o sistema iniciado, iremos utilizar um combinação de teclas “Windows + U”, neste momento a ferramenta do Windows será inciada, contudo será o Prompt de Comando que iremos possuir total acesso.

10

Neste momento iremos realizar a alteração da senha, iremos alterar a senha do usuário como Administrador.

Iremos utilizar o comando “net user [nome do usuário administrador do domínio] [nova senha], em nosso exemplo: “Net user administrador Pass@word”

11

Basta fechar o utilitario e entrar com a nova senha da conta administrador.

12

Neste tutorial demonstramos como utilizar a propria midia do sistema operacional para recuperar a senha do Windows Server 2008 R2, no entando para garantir a segurança do sistema e recomendado retornar o processo e voltar a habilitar a ferramenta de utilman.exe. Ele é o gerenciador de utilitários do Windows e serve para garantir a acessibilidade a pessoas com deficiências visuais, auditivas, que estejam com problemas no teclado, etc. Ele é um aplicativo do sistema, legítimo e não convém desabilitá-lo.

Obrigado pela leitura e até a próxima publicação.

Continue Reading

Como resolver o problema de perfil temporário no Windows.

Olá

A minha sugestão é: Efetue logon com uma conta que não ocorre o problema.Agora você precisa copiar a pasta do usuário de

c:\usuários\NOMEDOSEUUSUÁRIO

para um outro local pode ser outra partição ou outra pasta na àrea de trabalho por exemplo , depois de copiado, exclua a pasta 

c:\usuários\NOMEDOSEUUSUÁRIO,

depois acesse o Regedit, pelo Iniciar\Pesquisar\Digite Regedit e acesse o caminho descrito abaixo Clique duas vezes em

 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList, abaixo de ProfileList

você vai ver várias pastas como exemplo:
S-1-5-21-1214440339-2139871995-725345543-2750

quando você clicar em uma delas,veja do lado direito quais pertencem ao aos usuários criados por você e exclua e reinicie o computador

OBS: Ao clicar na pasta S-1-5-xxxx, você vai encontrar o valor ProfileImagePath. é nele que você consegue ver o nome do usuário que ela pertecence

Qualquer dúvida, ou na persistência desta ocorrência, fique a vontade para postar novamente.

Documentação: http://support.microsoft.com/kb/947242/pt-br

Até breve!!!

Continue Reading

Como desbloquear arquivos protegidos para edição Microsoft Office 2007 com VBA

Segue abaixo um procedimento com uma macro para desbloquear em apenas alguns segundos uma planilha protegida por senha no EXCEL.

Siga os passos conforme indicados que não tem como errar:

Passo 1: Abra a planilha protegida e pressione ALT+F11;

Passo 2: Se você fez certo o passo anterior agora deverá estar aberto o Microsoft Visual Basic.
Vá em INSERIR > MÓDULO

Passo 3: Insira a rotina abaixo copiando e colando desde a linha “’Desproteger Planilha” até “End Sub”;

'Desproteger Planilha
Sub DesprotegerPlanilhaAtiva()
 
Dim i, i1, i2, i3, i4, i5, i6 As Integer, j As Integer, k As Integer, l As Integer, m As Integer, n As Integer
On Error Resume Next
For i = 65 To 66
For j = 65 To 66
For k = 65 To 66
For l = 65 To 66
For m = 65 To 66
For i1 = 65 To 66
For i2 = 65 To 66
For i3 = 65 To 66
For i4 = 65 To 66
For i5 = 65 To 66
For i6 = 65 To 66
For n = 32 To 126
ActiveSheet.Unprotect Chr(i) & Chr(j) & Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
If ActiveSheet.ProtectContents = False Then
MsgBox "One usable password is " & Chr(i) & Chr(j) & _
Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _
Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
Exit Sub
End If
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
End Sub

Passo 4: Digite ALT+F11 novamente para retornar a planilha protegida, e execute a macro. Se você não achar a opção de macro digite ALT+F8. Selecione sua macro (DesprotegerPlanilhaAtiva) e clique em executar;

Passo 5: Aguarde alguns segundos e após a execução da macro será exibida a mensagem “On usable password ########”.
No lugar dos # havera a senha que você pode ir até o menu e desproteger a planilha.

Pronto agora você pode editá-la como quiser.
Espero que consigam e que essa dica tenha sido útil.

Continue Reading