Skip to content

A Passionate Techie

keep learning, keep growing

Enter your email address to follow this blog and receive notifications of new posts by email.

Recent learnings

  • Network monitoring tools September 5, 2021
  • Network Latencies September 5, 2021
  • Linux Network Stack September 5, 2021
  • Congestion control algorithms September 5, 2021
  • TCP performance features September 5, 2021

Recent Comments

gamejudilebaran.wordpress.com's avatargamejudilebaran.word… on Chef: Roles and Environme…
Unknown's avatarWARN: Waiting for se… on OSSEC start problem due to…
Arati Kulkarni's avatararatik711 on Ansible issues
Arati Kulkarni's avatararatik711 on Chef: Roles and Environme…
situs judi's avatarsitus judi on Chef: Roles and Environme…

Archives

  • September 2021
  • August 2021
  • March 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • February 2019
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • July 2017
  • May 2017
  • April 2017
  • March 2017
  • January 2017
  • July 2015

Categories

  • aws
  • azure
  • centos
  • cloud
  • gcp
  • java
  • javascript
  • jenkins
  • linux
  • python
  • Uncategorized

Meta

  • Create account
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.com

Tag: login

openvpn pam authentication failure

Error:

AUTH-PAM: BACKGROUND: user 'paul' failed to authenticate: System error
Sun Mar 13 16:41:02 2016 86.137.55.234:49377 PLUGIN_CALL: plugin
function PLUGIN_AUTH_USER_PASS_VERIFY failed with status 1:
/etc/openvpn/openvpn-plugin-auth-pam.so

 

Solution:

On the openvpn server install saslauthd

# aptitude install sasl2-bin

Start the daemon

# saslauthd -d -a pam -m /var/run/saslauthd/

Make simple authentication

# testsaslauthd -u paul -p 1234567 -s login

The result must be

0: OK "Success."

Rate this:

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
Like Loading...
Posted on September 15, 2019September 15, 2019Categories UncategorizedTags authentication, error, fail, failure, linux, login, openvpn, pam, plugin, sasl2-bin, saslauthdLeave a comment on openvpn pam authentication failure

unable to login to a virtual machine

If you want to add a user to a virtual machine without logging into it or change the password of root or any other user, you can use virt-customize.

The virt-customize command-line tool can be used to customize a virtual machine. For example, by installing packages and editing configuration files.
To use virt-customize, the guest virtual machine must be offline, so you must shut it down before running the commands. Note that virt-customize modifies the guest or disk image in place without making a copy of it. If you want to preserve the existing contents of the guest virtual machine, you must snapshot, copy or clone the disk first.

To install virt-customize, run one of the following commands:

sudo yum install libguestfs-tools-c
sudo apt-get install libguestfs-tools

Please follow the below-mentioned steps:

a. Add a new user:

virt-customize -a centos.img --run-command "adduser user1"

virt-customize -a centos.img --ssh-inject user1:string:<YOUR PUBLICKEY STRING HERE>

Now you can login with user1 and public-key
If you want passwordless sudo access execute the following:

virt-customize -a centos.img --run-command "echo 'user1 ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/user1-sudo"

b. Change root password:

virt-customize -a centos.img --root-password password:mypass

You can login to the VM with root/mypass

c. Change password of non-root user:

virt-customize -a centos.img --password user1:password:mypass2

You can login to the VM with user1/mypass2

Rate this:

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
Like Loading...
Posted on June 15, 2019June 15, 2019Categories UncategorizedTags adduser, cloud, guest, images, key, libguestfs, login, machine, private, public, qcow, qemu, ssh, tools, useradd, virsh, virt, virt-customize, virtual, vmLeave a comment on unable to login to a virtual machine

Heroku: Couldn’t find that app

To troubleshoot this issue firstly check the heroku logs with command:
heroku logs -tail

Check for the error here,

Make sure you have logged into heroku with:
heroku auth:login

Check the list of apps in heroku with:
heroku apps

make sure you have initialized the git repository in the directory where your code is and not it’s parent or sub directory.
You can  initialize it with git init

Add the files with git add .

Commit the files with git commit -m “Your message”

Add the remote git into heroku with:
heroku git:remote -a app-name

You can manually add the heroku git remote repository with the comand:
git remote add heroku git@heroku.com:arati.git

Check the remote with git remote -v

You can add ssh keys for heroku with command heroku keys:add
It will create ssh keys in .ssh folder of your home directory. Make sure you have ssh-keygen in your path otherwise you’ll be getting an error as: ‘ENOENT’: spawn ssh-keygen ENOENT

You should be able to push your code with: git push heroku master

Rate this:

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
Like Loading...
Posted on January 24, 2018January 24, 2018Categories UncategorizedTags app, auth, commit, Couldn't find that app, enoent, git, heroku, keys, login, logs, master, push, remote, spawn, ssh-keygenLeave a comment on Heroku: Couldn’t find that app

Create public key from .pem

Execute the following command:
ssh-keygen -y -f /tmp/key.pem > key.pub

Rate this:

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
Like Loading...
Posted on October 25, 2017October 25, 2017Categories UncategorizedTags authorized keys, command, key, login, pem, pub, public, putty, ssh-keygen1 Comment on Create public key from .pem

How to prevent a user from login in, but allow “su – user” in Linux?

You can use AllowUsers / AllowGroups if you have only a few users/groups that are allowed to login via ssh or DenyUsers / DenyGroups if you have only a few users/groups that are not allowed to login. Note that this only restricts login via ssh, other ways of login (console, ftp, …) are still possible. You need to add these options to your /etc/ssh/sshd_config file for most ssh installations.

If you have set the login shell to /bin/false you can use su -s /bin/bash user (replace /bin/bashwith the shell of your choice)

Rate this:

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
Like Loading...
Posted on September 7, 2017September 7, 2017Categories UncategorizedTags Allow, bash, Deny, group, linux, login, prompt, shell, ssh, sshd, sshd_config, su, userLeave a comment on How to prevent a user from login in, but allow “su – user” in Linux?

Change to jenkins user

Look at the shell specified in /etc/passwd for the jenkins user. You can do so by running something like:

grep jenkins /etc/passwd

The output will look similar to this:

jenking:1001:1001::/usr/local/jenkins:/bin/false

The last field is the login shell of the user. Here you can see it is set to /bin/false which will immediately exit.

The solution is to specify which shell to use as you described:

su -s /bin/bash jenkins

Or modify the login shell of the jenkins user with “usermod(8)” (executed as a root user) :

usermod -s /bin/bash jenkins

Then grep jenkins /etc/passwd should now output something like:

jenkins:1001:1001::/usr/local/jenkins:/bin/bash

After which. su - jenkins will work as you expect.

Rate this:

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
Like Loading...
Posted on August 22, 2017August 22, 2017Categories UncategorizedTags jenkins, linux, login, open, sheel, source, switch, tty, userLeave a comment on Change to jenkins user

How to pass environment variable to sudo su

You can do it without calling login shell:

sudo DUMMY=dummy su <username> -c 'echo "$DUMMY"'

 

Rate this:

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
Like Loading...
Posted on August 11, 2017Categories UncategorizedTags bash, command, linux, login, shell, ssh, sudo, userLeave a comment on How to pass environment variable to sudo su

How to add multiple SSH keys to single machine

Generate keys with the command:

ssh-keygen -t rsa

Then add the public key to the authorized_keys with the command:

cat .ssh/new_key.pub >> ~/.ssh/authorized_keys

Rate this:

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
Like Loading...
Posted on August 7, 2017August 7, 2017Categories UncategorizedTags keys, linux, login, private, public, ssh, userLeave a comment on How to add multiple SSH keys to single machine
Create a free website or blog at WordPress.com.
  • Subscribe Subscribed
    • A Passionate Techie
    • Join 108 other subscribers
    • Already have a WordPress.com account? Log in now.
  • Privacy
    • A Passionate Techie
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
%d
    Design a site like this with WordPress.com
    Get started