Ubuntu updater unable to find public key

Problem: The user was unable to update ubuntu due the error shown below-

pmt@v-ng-01dd:~$ sudo apt-get update
[sudo] password for pmt:
Get:1 ftp://mirror.cse.iitk.ac.in trusty-updates Release.gpg [933 B]
<snip> … <snip>

Hit ftp://mirror.cse.iitk.ac.in trusty-security/universe Translation-en
Fetched 855 kB in 48s (17.8 kB/s)
Reading package lists… Done
W: There is no public key available for the following key IDs:
3B4FE6ACC0B21F32
W: There is no public key available for the following key IDs:
3B4FE6ACC0B21F32
W: There is no public key available for the following key IDs:
3B4FE6ACC0B21F32
W: There is no public key available for the following key IDs:
3B4FE6ACC0B21F32

Solution:

pmt@v-ng-01dd:~$ sudo apt-get install debian-keyring debian-archive-keyring
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
debian-archive-keyring debian-keyring
0 upgraded, 2 newly installed, 0 to remove and 1309 not upgraded.
Need to get 48.7 MB of archives.
<snip> … <snip>
Setting up debian-archive-keyring (2012.4) …
Setting up debian-keyring (2014.03.03) …
pmt@v-ng-01dd:~$ sudo apt-key update
gpg: key 437D05B5: “Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>” not changed
gpg: key FBB75451: “Ubuntu CD Image Automatic Signing Key <cdimage@ubuntu.com>” not changed
gpg: Total number processed: 2
gpg:              unchanged: 2
pmt@v-ng-01dd:~$

root@v-ng-01dd:~# gpg –recv-keys 3B4FE6ACC0B21F32

root@v-ng-01dd:~# gpg –export 3B4FE6ACC0B21F32 | apt-key add –

Reference:

  1. http://www.linuxquestions.org/questions/debian-26/there-is-no-public-key-available-for-the-following-key-id-705108/
  2. http://gnuru.org/article/1486/debian-public-keys-error-2

Unable to ssh after upgrading to ubuntu 14.04

Problem: A colleague had got Ubuntu 14.04 installed on her desktop.  Post-installation, the sysads were unable to ssh to the m/c using PuTTY.  Since, the team uses a combination of Windows and Linux desktops, we needed this to work.

Solution: Apparently, post-installation the sysads updated the m/c (sudo apt-get update) without setting https_proxy.  So, the two steps that got the issue resolved were-

  1. export http_proxy and https_proxy to point to the proxy server
  2. sudo apt-get update
  3. Add following line to /etc/sshd_config in the “#Authentication” section

#PermitRootLogin without-password
PermitRootLogin yes

 

Unable to login to myql using root credentials

A colleague requested help saying he was unable to login to his mysql server using root credentials. They had to give a demo and hence were looking for quick help.  This is a log of the trouble shooting session for their benefit-

Lets check the command-

ubuntu@ip-10-10-10-10:~$ sudo mysql -uroot -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
ubuntu@ip-10-10-10-10:~$

“Can’t connect…”? Is the server running?

ubuntu@ip-10-10-10-10:~$ ps -aef | grep mysql
ubuntu   29911 29772  0 09:34 pts/0    00:00:00 grep --color=auto mysql
ubuntu@ip-10-10-10-10:~$

Obviously not. Lets try starting the server.

ubuntu@ip-10-10-10-10:~$ sudo service mysql start
start: Job failed to start
ubuntu@ip-10-10-10-10:~$ which mysql
/usr/bin/mysql
ubuntu@ip-10-10-10-10:~$ telnet 127.0.0.1 3306
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
ubuntu@ip-10-10-10-10:~$

Ok, its not starting. Lets look into the logs for any errors.

<pre>ubuntu@ip-10-10-10-10:~$ cat /var/log/mysql.err
ubuntu@ip-10-10-10-10:~$ cat /var/log/mysql.log
ubuntu@ip-10-10-10-10:~$ dmesg | grep mysql

<snip> ...</snip>
[29976983.198618] init: mysql main process (29965) terminated with status 1
[29976983.198673] init: mysql main process ended, respawning
[29976984.146692] init: mysql post-start process (29966) terminated with status 1
[29976984.167458] type=1400 audit(1402392890.291:19): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=29999 comm="apparmor_parser"
[29976984.294210] init: mysql main process (30003) terminated with status 1
[29976984.294268] init: mysql respawning too fast, stopped
[29977185.261161] type=1400 audit(1402393091.383:20): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=30096 comm="apparmor_parser"

<snip> ...</snip>

Googling for “mysql main process ended, respawning” and “mysql respawning too fast, stopped” error messages threw up multiple posts with a variety of solutions. Reconfiguring seemed a good step to start with and that resolved the issue for us.

http://askubuntu.com/questions/125686/mysql-fails-to-start-after-upgrade-installation-etc

http://askubuntu.com/questions/127264/cant-start-mysql-mysql-respawning-too-fast-stopped

ubuntu@ip-10-10-10-10:~$ apt-cache show mysql-server | grep -i version
Version: 5.5.37-0ubuntu0.12.04.1
Description-en: MySQL database server (metapackage depending on the latest version)
 This is an empty package that depends on the current "best" version of
 version you need. That will install the version recommended by the

<snip> ... </snip>

ubuntu@ip-10-10-10-10:~$ sudo dpkg-reconfigure mysql-server-5.5
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_PAPER = "en_IN.UTF-8",
        LC_ADDRESS = "en_IN.UTF-8",
        LC_MONETARY = "en_IN.UTF-8",
        LC_NUMERIC = "en_IN.UTF-8",
        LC_TELEPHONE = "en_IN.UTF-8",
        LC_IDENTIFICATION = "en_IN.UTF-8",
        LC_MEASUREMENT = "en_IN.UTF-8",
        LC_TIME = "en_IN.UTF-8",
        LC_NAME = "en_IN.UTF-8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_ALL to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory

<snip> ... </snip>

Ok, that was simple. Now, lets try logging in.

ubuntu@ip-10-10-10-10:~$ mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 47
Server version: 5.5.32-0ubuntu0.12.04.1 (Ubuntu)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> quit
Bye

Phew! That didn’t take too long.



			

openldap setup issue with ldap_sasl_bind()

The problem:

ubuntu@ip-10-10-10-10:~/openldap$ ldapadd -x -D cn=admin,dc=purpledew,dc=com -W -f add_content.ldif
Enter LDAP Password: ldap_sasl_bind(SIMPLE): Can’t contact LDAP server (-1)

Whereas ldapsearch worked just fine.

Clearly the -x option didn’t seem to be working, where I wanted to override default sasl authentication.

The relevant settings/configurations/environment variables-

ubuntu@ip-10-10-10-10:~/openldap$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 ip-10-10-10-10.purpledew.com ip-10-10-10-10
<snip> … </snip>

ubuntu@ip-10-10-10-10:~/openldap$ cat /etc/ldap//ldap.conf

# # LDAP Defaults
# # See ldap.conf(5) for details
# This file should be world readable but not world writable.

#BASE dc=example,dc=com #URI ldap://ldap.example.com ldap://ldap-master.example.com:666
BASE dc=purpledew,dc=com

#URI ldap://54.225.107.132
URI ldap://127.0.0.1

#SIZELIMIT 12
#TIMELIMIT 15
#DEREF never
# TLS certificates (needed for GnuTLS)

TLS_CACERT /etc/ssl/certs/ca-certificates.crt

The solution:

http://forums.devshed.com/ldap-programming-76/ldap_sasl_bind-simple-cant-contact-ldap-server-1-a-510615.html

To quote from the post by user kama3-

This bind error “-1” occurs, when the default config file (/etc/ldap/ldap.conf) contains the default uri: “URI ldap://ldap.yourhost.yourdomain ldap://ldap-master.yourhost.yourdomain : port” . You have to hash-mark this line, and add this instead: “URI ldap://127.0.0.1”, so the query will find the correct data automatically, or at least in my case, this was the only solution that worked. Set this, and try ldapsearch -x. If it works, you only have to create groups, users, etc. If you do not want to secure your ldap it’s a good idea to turn off the TLS request too, so add this line to ldap.conf : 
“TLS_REQCERT never”, if someone hadn’t suggested before (I didn’t read all the comments before). I hope it helps

KAMA3

Adding “URI ldap://127.0.0.1” entry to /etc/ldap/ldap.conf resolved the problem for us.