I am trying to install libpam-google-authenticator, but not able to install, in centos machine, please suggest or tell me the alternate way or command - centos7

yum install libpam-google-authenticator python3-pip
Loaded plugins: copr, fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
base: mirrors.nxtgen.com
elrepo: mirror-hk.koddos.net
epel: repo.extreme-ix.org
extras: mirrors.nxtgen.com
updates: centos.excellmedia.net
No package libpam-google-authenticator available.
Package python3-pip-9.0.3-8.el7.noarch already installed and latest version
Nothing to do
Because of the openvpn totp is not validating from google authenticator

Related

amazon linux 2 yum missing update (AWS Security Center)

AWS security advisory https://alas.aws.amazon.com/AL2/ALAS-2021-1674.html is causing my security scan to fail. The advice is to yum update httpd to install httpd-2.4.48-2.amzn2.x86_64. However when I do this AWS yum repo only has an old version of this package (httpd-2.4.46-2.amzn2.x86_64).
yum update httpd
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No packages marked for update
yum install httpd
Loaded plugins: extras_suggestions, kernel-livepatch, langpacks, priorities, update-motd
amzn2-core | 3.7 kB 00:00:00
Package httpd-2.4.46-2.amzn2.x86_64 already installed and latest version
Nothing to do
This is a brand new unmodified AWS linux 2 instance. I have tried everything I could find online (making sure I can access yum repo and clearing cache)
Can anyone else using amazon linux 2 see this new package? (2.4.48) or even better have any suggestions how to proceed?
Worked it out - AWS Elastic Beanstalk in all their wisdom append a "-$guid" to the YUM repo list on an instance, which must be stuck in their CDN as was returning an out of date package list. I have resolved via:
sed 's/-$guid//g' /etc/yum.repos.d/amzn2-core.repo -i
AWS security advisory Link mention that we have to do "yum update httpd". If it still does not work I would say we have to update yum repo.

I can't install PHP on AWS EC2

I'm pretty new in AWS, I've tried to install PHP on my virtual machine, but it doesn't works, I get the error:
[root#ip-xxx-xxx-xxx-xxx user]# yum install apache2 libapache2-mod-php5 php5 mysql-
server php5-mysql
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No package apache2 available.
No package libapache2-mod-php5 available.
No package php5 available.
No package mysql-server available.
No package php5-mysql available.
Error: Nothing to do
I don't know the reason of this, I already tried the comamnd yum update, but it doesn't help, please help me
PHP5 is quite old and is probably not available anymore in the YUM package manager.
Also I think the tutorial you are using is Debian/Ubuntu based.
Apache2 is called httpd24 in yum for instance.
That would look something like this:
sudo yum install -y httpd24 php72 mysql57-server php72-mysqlnd
Or if you are using the Amazon Linux 2 image, then use this command:
sudo amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2
To find out which specific image you are running:
cat /etc/system-release
Please check out the AWS documentation for an up-to-date tutorial on howto deploy your own LAMP-server:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-lamp-amazon-linux-2.html

CentOS 7: VirtualBox is complaining that the kernel module is not loaded

Background:
I created a sandbox VM with VirtualBox on my macOS. It correctly spins up a VM (with CentOS7 running on it) on which I can access to.
Inside this sandbox vm, I want to spin up several vms in order to test Ansible Playbooks with Kitchen CI & Vagrant, thus I installed VirtualBox by downloading it from the following link: https://download.virtualbox.org/virtualbox/5.2.8/VirtualBox-5.2-5.2.8_121009_el7-1.x86_64.rpm
After the installation I executed the command:
[david#vmkitchen-env ansible-test]# VBoxManage --version
It returned:
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (3.10.0-693.2.1.el7.x86_64) or it
failed to load. Please recompile the kernel module and install it
by
sudo /sbin/vboxconfig
You will not be able to start VMs until this problem is fixed.
5.2.8r121009
I installed the Development tools, but I keep getting the same issue.
I don't think I need to recompile any kernel module. Any idea?
Thanks in advance for your help.
So, after searching on the internet, and not just on the VirtualBox website, I found the solution, and I was right: I did not need to compile any module.
The following is the reference to the CentOS wiki page:
https://wiki.centos.org/HowTos/Virtualization/VirtualBox
In a few words, I had to install dkms and kernel-devel packages. In order to do so, I needed to install EPEL repository; but personally I prefer to install and enable the IUS repository.
The following are the set of commands that worked for me:
yum groupinstall "Development tools"
yum install https://centos7.iuscommunity.org/ius-release.rpm
yum install dkms
yum install kernel-devel
reboot
After the machine had rebooted, I was able to get VirtualBox working fine.
I verified by the command line:
[david#vmkitchen-env ansible-test]# VBoxManage --version
And it returned the correct value:
5.2.8r121009
Below steps fixed the issue for me.
1.sudo /sbin/vboxconfig
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
kernel-devel kernel-devel-3.10.0-957.10.1.el7.x86_64
2.This website has the kernel module - website
wget https://linuxsoft.cern.ch/cern/centos/7/updates/x86_64/Packages/kernel-devel-3.10.0-957.10.1.el7.x86_64.rpm
4.yum localinstall kernel-devel-3.10.0-957.10.1.el7.x86_64.rpm -y
5.sudo /sbin/vboxconfig
Issue resolved
On Fedora 36, I only had to run
sudo /sbin/vboxconfig

installing laravel on EC2 - mbstring issue

I have installed Laravel 5.2 successfully on my Mac machine. But now I am walking through the procedures to install Laravel on AWS.
Once I got the instance running, I installed apache, php and mysql with the following command:
sudo yum install -y httpd24 php56 mysql55-server php56-mysqlnd
The php version is 5.6.17
I then did the following:
composer global require "laravel/installer"
and updated the path: export PATH=$PATH:~/.composer/vendor/bin
when I navigate to /var/www/html and do "laravel new ", the project gets created but I receive an mbstring extension problem. Below is a text dump of what I saw:
laravel new hws3
Crafting application...
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for laravel/framework v5.2.29 -> satisfiable by laravel/framework[v5.2.29].
- laravel/framework v5.2.29 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
I've scoured the internet and only found a solution for Windows. I am using Amazon Linux. Any guidance would be most appreciated.
It seems you have php 5.6 installed.
You need to install mbstring for that particular version of php.
Run sudo yum install php56-mbstring
credits: Alex Andrei answered here
If you want to install Laravel with composer, This is the right answer!
sudo su //to be root
yum install php56-mbstring

Installing memcached for a django project

From the django docs:
After installing Memcached itself, you'll need to install a memcached binding. There are several python memcached bindings available; the two most common are python-memcached and pylibmc.
The pylibmc docs have their own requirements:
-libmemcached 0.32 or later (last test with 0.51)
-zlib (required for compression support)
-libsasl2 (required for authentication support)
So it seems to me that I need to do the following:
-install memcached
-install libmemcached
-install zlib
-install libsas12
-install pylibmc
How/where can I do this? I've been used to just pip installing whatever I need but I can't even tell which of these are python packages. Are these bundled together anywhere?
Just do pip install python-memcached and you should be good.
As for installing memcached itself, it depends on the platform you are on.
Windows - http://pureform.wordpress.com/2008/01/10/installing-memcache-on-windows-for-php/
OS X - brew install memcached
Debian/Ubuntu - sudo apt-get install memcached
On OS X/Linux, just run memcached in the command line.
Detailed explanation here http://ilian.i-n-i.org/caching-websites-with-django-and-memcached/
The link above includes explanations for how to install Memcached on Ubuntu, how to configure it as cache engine in your Django project and how to use it.