segunda-feira, 28 de agosto de 2017

Alterar hostname no GNU/Linux sem reboot

Segue dica simples e direta:

1. Ajuste o novo nome no /etc/hosts:
# vim /etc/hosts

2. Ajuste o nome no arquivo /etc/hostname, executando:
# echo "NOVO_NOME" > /etc/hostname

3. Ajuste o nome direto em memória (a grande sacada):
# echo "NOVO_NOME" > /proc/sys/kernel/hostname

4. Faça logoff e login e já estará com novo nome.

Pronto!!



Fonte: https://www.vivaolinux.com.br/dica/Alterar-hostname-no-GNULinux-sem-reboot

quinta-feira, 24 de agosto de 2017

Converter .PEM to .PPK para acesso remoto AWS via SSH

Para acessar um servidor Linux hospedado na AWS, utilizando uma máquina Windows, é necessário uma chave chamada .PPK, para isso é necessário converter a chave no formato .PEM que o AWS gera para download:

Segue tutorial


Using the GUI

See this SO Q&A on how to do exactly what you want, titled: Convert PEM to PPK file format.
excerpt
  1. Download your .pem from AWS
  2. Open PuTTYgen, select Type of key to generate as: SSH-2 RSA
  3. Click "Load" on the right side about 3/4 down
  4. Set the file type to *.*
  5. Browse to, and Open your .pem file
  6. PuTTY will auto-detect everything it needs, and you just need to click "Save private key" and you can save your ppk key for use with PuTTY

Using the command line

If on the other hand you'd like to convert a .pem to .ppk file via the command line tool puttygen, I did come across this solution on SO in this Q&A titled:
excerpt
$ puttygen keyfile.pem -O private -o avdev.ppk
For the public key:
$ puttygen keyfile.pem -L


Fonte: https://unix.stackexchange.com/questions/116303/convert-amazon-pem-key-to-putty-ppk-key-linux