Install sshpass mac os

Installing sshpass On OSX Mavericks

When setting up a server for the first time with Ansible you will need to pass ssh credentials to Ansible directly to set up ssh keys. This is done by the use of the sshpass program which allows Ansible to pass your user credentials directly to ssh in order to open a connection to the server. The sshpass program is easily installed on Linux systems with the apt or yum package managers, but on OSX you will need to install it manually.

In order to install command line software on OSX you will need some of the command line tools bundled with Xcode. Xcode and the command line tools are free programs from Apple and is available on the Appstore. Once Xcode is installed you will need to open it and install the command line tools. You can do this by going to Preferences > Downloads > Command Line Tools and clicking on the Install button. Once everything is installed and setup you can continue with the installation of sshpass.

The sshpass program is an open source project, currently available on sourceforge. You can either download the latest version manually and or you can use the following command will download the sshpass tar from sourceforge, and unzip it.

This will create a directory called ‘sshpass-1.05’, open this directory in your terminal and run the following commands. This will configure, compile and install the sshpass program.

Once complete you can run sshpass with the -V flag to see if the install has taken and also to view the current version installed.

Читайте также:  Rainbow six siege ��� linux

I should note that it is poor security practice to rely on the sshpass to interface with servers, even through Ansible. This is because you will be placing ssh credentials into the command line or even within your codebase.

Phil is the founder and administrator of #! code and is an IT professional working in the North West of the UK. Phil is currently a Developer at Code Enigma.

Comments

Ron (Mon, 02/17/2014 — 02:43)

Chris McCoy (Wed, 04/09/2014 — 05:55)

Jay (Fri, 09/05/2014 — 17:01)

Richard Clayton (Fri, 03/27/2015 — 16:47)

Eduard (Thu, 04/09/2015 — 18:58)

zq (Thu, 04/23/2015 — 03:02)

Mike (Thu, 05/14/2015 — 14:43)

Askar (Thu, 06/04/2015 — 06:16)

Yann de Champlain (Wed, 09/02/2015 — 14:24)

Jagadeesh (Tue, 11/17/2015 — 12:26)

Dika Fernando (Tue, 11/29/2016 — 18:10)

Add new comment

Allowing Cached HTTPS Traffic From Drupal With Varnish And Pound

Varnish is a web application accelerator that helps to speed up websites. It works by sitting in front of the web server and caching web pages that are served by it.

When a request for a web page is made Varnish passes this request on to the web server, which then responds to the request as it normally would. Varnish then caches the result of this request before sending it to the user.

Adding iptables Rules With Ansible

Many systems and applications require certain access to certain ports and protocols. When installing these systems using Ansible it is necessary to also open up the needed ports so that the systems can function correctly. As there is no iptables module in Ansible the shell command is needed to add the iptables rules.

As an example, here is a task that adds a iptables rule to allow Apache to communicate on port 80.

Vlad — The Vagrant LAMP Ansible Drupal development box

Ansible SSH Setup Playbook

It is best practice to use Ansible with SSH keys in order to create the SSH connections to the servers. This does require a little bit of extra setup before hand in order to ensure that the server can be reached by Ansible via SSH keys alone. As I have been doing this quite a lot recently I decided to package the setup steps into an Ansible playbook.

Ansible: The Automation Engine

Ansible is a automation and provisioning tool that makes it easy to configure systems with the needed software, configuration options and even content. It is a command line tool, written in Python, that uses SSH connections to run these actions. This means that all you need to do is have a viable SSH connection to a machine and Ansible will run any actions you want to run. Ansible can either run single commands or use what is called a playbook to run several commands. Ansible playbooks are written in YAML, which makes understanding them quite easy.

Читайте также:  Is this windows real

Creating Mac OSX Aliases

Adding an alias to your system is a good way of saving time when remembering complex commands. You can reduce a command down to a quick two letter command that is easy to remember.

The alias command can be used to assign an alias on the fly. You can create an alias to ‘ls -lah’ by typing in the following into the command line.

Now, when you type ‘ll’ (i.e. two lower case L’s) you will actually run the command ‘ls -la’.

Or you might want to do more complex things like running your selenium server.

Источник

DanBurkhardt / install-sshpass.sh

# Install «sshpass» on macOS Catalina.
#
# — sshpass allows you to easily automate password entry
# prompts for ssh sessions.
#
# Don’t mess around with terminal if you
# don’t know what any of this means, please.
# Evaluate for learning purposes at your own risk.
#
# Licensed under MIT. See below.
#! /bin/sh
if [ » $( which sshpass ) » != ‘ ‘ ]
then
echo » sshpass already installed. «
exit 0
fi
if [ » $( which brew ) » = ‘ ‘ ] ; then
echo » homebrew installation not detected, first install homebrew «
exit 1
else
echo » tapping alternative source for sshpass «
brew tap esolitos/ipa
brew install sshpass
fi
# see manpage for usage: https://linux.die.net/man/1/sshpass
# License: MIT
# Copyright 2020, Gigabitelabs
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the «Software»), to deal
# in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED «AS IS», WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Читайте также:  Дата выхода windows 10 home

This comment has been minimized.

Copy link Quote reply

m4r1k commented Jul 20, 2020 •

We should check the availability of the brew cli and not homebrew (which is the project). See my fork

This comment has been minimized.

Copy link Quote reply

DanBurkhardt commented Jul 21, 2020

We should check the availability of the brew cli and not homebrew (which is the project). See my fork

sweet! thanks for the catch, updated

This comment has been minimized.

Copy link Quote reply

YoungJaeChoung commented Oct 25, 2020 •

I have got an error message
(But my mac is Mojave)

This comment has been minimized.

Copy link Quote reply

skumka commented Oct 29, 2020

Same here:
==> Tapping esolitos/ipa
Cloning into ‘/usr/local/Homebrew/Library/Taps/esolitos/homebrew-ipa’.
remote: Enumerating objects: 17, done.
remote: Counting objects: 100% (17/17), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 35 (delta 2), reused 9 (delta 1), pack-reused 18
Unpacking objects: 100% (35/35), done.
Tapped 1 formula (60 files, 33.6KB).
==> Downloading https://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz
Already downloaded: /Users/skumka/Library/Caches/Homebrew/downloads/607fb753141f21319acf1a2f676c82cb298652150b34df6c935ae7a4fcd43661—sshpass-1.05.tar.gz
Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
softwareupdate —all —install —force

If that doesn’t show you an update run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select —install

==> ./configure —prefix=/usr/local/Cellar/sshpass/1.05
Error: Empty installation

This comment has been minimized.

Copy link Quote reply

vikas027 commented Jan 4, 2021 •

Earlier I used to do this brew install http://git.io/sshpass.rb but this does not work anymore.

This works like a charm on Catalina 10.15.7

This comment has been minimized.

Copy link Quote reply

dusvyat commented May 6, 2021

worked a treat for me, thanks a lot 🙂

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Оцените статью