Thursday, April 30, 2015

Systemd vs SysVinit Cheatsheet

A good one to have in hand! ;)


Thanks a lot to: http://linoxide.com


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:

https://www.debian.org/releases/jessie/amd64/release-notes/ch-information.en.html#openssh
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 test02.ximunix.org -l yoda -p 22
yoda@test02.ximunix.de'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 xdev.ipandmore.de
yoda@test02:~$ 

Now we will "su" into the root account:

yoda@test02:~$ su root
Passwort: 
root@test02:/home/yoda# 

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 "...no 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:
7638D0442B90D010

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

ximena@xdev:~$ sudo apt-get update
Get:1 http://security.debian.org wheezy/updates Release.gpg [1,571 B]
Get:2 http://security.debian.org wheezy/updates Release [102 kB]
Hit http://ftp.de.debian.org wheezy Release.gpg
Get:3 http://ftp.de.debian.org wheezy-updates Release.gpg [1,571 B]
Hit http://ftp.de.debian.org wheezy Release
Get:4 http://security.debian.org wheezy/updates/main Sources [175 kB]
Get:5 http://ftp.de.debian.org wheezy-updates Release [124 kB]
Get:6 http://apt.puppetlabs.com wheezy Release.gpg [876 B]
Get:7 http://security.debian.org wheezy/updates/main amd64 Packages [305 kB]
Hit http://ftp.de.debian.org wheezy/main Sources
Hit http://ftp.de.debian.org wheezy/main amd64 Packages
Get:8 http://apt.puppetlabs.com wheezy Release [29.4 kB]
Hit http://ftp.de.debian.org wheezy/main Translation-en
Get:9 http://security.debian.org wheezy/updates/main Translation-en [172 kB]
Hit http://ftp.de.debian.org wheezy/main Translation-de
Hit http://ftp.de.debian.org wheezy/main Translation-de_DE
Get:10 http://ftp.de.debian.org wheezy-updates/main Sources [3,303 B]
Hit http://ftp.de.debian.org wheezy-updates/main amd64 Packages/DiffIndex
Hit http://ftp.de.debian.org wheezy-updates/main Translation-en/DiffIndex
Get:11 http://apt.puppetlabs.com wheezy/main Sources [83.0 kB]
Get:12 http://apt.puppetlabs.com wheezy/dependencies Sources [9,234 B]
Get:13 http://apt.puppetlabs.com wheezy/main amd64 Packages [97.9 kB]
Get:14 http://apt.puppetlabs.com wheezy/dependencies amd64 Packages [6,422 B]
Ign http://apt.puppetlabs.com wheezy/dependencies Translation-en_US
Ign http://apt.puppetlabs.com wheezy/dependencies Translation-en
Ign http://apt.puppetlabs.com wheezy/dependencies Translation-de
Ign http://apt.puppetlabs.com wheezy/dependencies Translation-de_DE
Ign http://apt.puppetlabs.com wheezy/main Translation-en_US
Ign http://apt.puppetlabs.com wheezy/main Translation-en
Ign http://apt.puppetlabs.com wheezy/main Translation-de
Ign http://apt.puppetlabs.com 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:
9D6D8F6BC857C906
W: There is no public key available for the following key IDs:
7638D0442B90D010
W: There is no public key available for the following key IDs:
7638D0442B90D010
ximena@xdev:~$

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! :)