Thursday, April 30, 2015

Systemd vs SysVinit Cheatsheet

A good one to have in hand! ;)

Thanks a lot to:

Root Login Disabled per Default in Debian Jessie

If you, like me, were waiting for a long time the release of Debian Jessie 8.0 and after a fresh install of the system you could not login to the Box with root; well... Don't Panic and grab your towel! ;)

Here are some news for you:
OpenSSH server defaults to "PermitRootLogin without-password" 
In an attempt to harden the default setup, the openssh-server configuration will now default to "PermitRootLogin without-password". If you rely on password authentication for the root user, you may be affected by this change.
The openssh-server will attempt to detect such cases and increase the priority of its debconf prompt.   

Here is a trick:

During the installation, Debian asked you to add another user with privileges, right? In my case, I created the user "yoda".

So, what we are going to do now, is to login to the Server with this user:

ximena@xdev:~$ ssh -l yoda -p 22's password: 

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Apr 30 11:14:11 2015 from

Now we will "su" into the root account:

yoda@test02:~$ su root

Edit the sshd_config file:

root@test02:~# vi /etc/ssh/sshd_config 

And change this line:
PermitRootLogin without-password
For this line:
PermitRootLogin yes

Now, restart ssh:
root@test02:~# /etc/init.d/ssh restart

And you are ready to go. 

Please, after you login to your Server with root, change or install whatever you need, and in the end, please change the sshd_config to "PermitRootLogin no" in order to avoid any major security risks. It's never good to have "PermitRootLogin" set to "yes".

Hope it helps. :)

Wednesday, April 29, 2015

HOWTO Fix Error " public key available..." on Debian Wheezy

If you are getting an error similar to this one:

W: There is no public key available for the following key IDs:

when running an apt-get update on your Debian Wheezy. For example:

ximena@xdev:~$ sudo apt-get update
Get:1 wheezy/updates Release.gpg [1,571 B]
Get:2 wheezy/updates Release [102 kB]
Hit wheezy Release.gpg
Get:3 wheezy-updates Release.gpg [1,571 B]
Hit wheezy Release
Get:4 wheezy/updates/main Sources [175 kB]
Get:5 wheezy-updates Release [124 kB]
Get:6 wheezy Release.gpg [876 B]
Get:7 wheezy/updates/main amd64 Packages [305 kB]
Hit wheezy/main Sources
Hit wheezy/main amd64 Packages
Get:8 wheezy Release [29.4 kB]
Hit wheezy/main Translation-en
Get:9 wheezy/updates/main Translation-en [172 kB]
Hit wheezy/main Translation-de
Hit wheezy/main Translation-de_DE
Get:10 wheezy-updates/main Sources [3,303 B]
Hit wheezy-updates/main amd64 Packages/DiffIndex
Hit wheezy-updates/main Translation-en/DiffIndex
Get:11 wheezy/main Sources [83.0 kB]
Get:12 wheezy/dependencies Sources [9,234 B]
Get:13 wheezy/main amd64 Packages [97.9 kB]
Get:14 wheezy/dependencies amd64 Packages [6,422 B]
Ign wheezy/dependencies Translation-en_US
Ign wheezy/dependencies Translation-en
Ign wheezy/dependencies Translation-de
Ign wheezy/dependencies Translation-de_DE
Ign wheezy/main Translation-en_US
Ign wheezy/main Translation-en
Ign wheezy/main Translation-de
Ign wheezy/main Translation-de_DE
Fetched 1,112 kB in 4s (222 kB/s)
Reading package lists... Done
W: There is no public key available for the following key IDs:
W: There is no public key available for the following key IDs:
W: There is no public key available for the following key IDs:

Here is what you should do:

ximena@xdev:~$ sudo apt-get install debian-keyring debian-archive-keyring
ximena@xdev:~$ sudo apt-get update

And that should do it :)

HOWTO Check the WordPress Version on the command Line

After the news from the WordPress Bug few days ago, I wanted to check which versions of WordPress we have on our WebServer on the Command Line, and I've found this cool thing:

ximena@xdev:/www$ grep wp_version mywebsite/htdocs/wp-includes/version.php

Hope it helps! :)