Easiest way to do a remote sudo

Easiest way to do a remote sudo

Let’s see the easiest way to do a remote sudo:

Usually when a sudo command is executed in a remote server, an error is receive telling us that a remote sudo in not possible, even if the user have permissions for the command we want to use.

easiest way to do a remote sudo 01

This is because sudo, by default, requires a tty to be executed, making not possible to execute it.

CollectNode captures the sudo commands and processes them in a way that this requirement is no longer a problem.

easiest way to do a remote sudo 02

With the command configure we can now configure the password to use if the sudo execution requires a password in the remote servers.  If the sudo password is not configured, CollectNode will use the password of the user used to connect to the remote servers.

Now execute remote sudo is easiest than ever  🙂

Get CollectNode now !

Leave CollectNode to make the hard work, and spend your time where really matters.

Video: Understanding CollectNode output

Video: Understanding CollectNode output

In this video we can check the CollectNode output. How CollectNode executes a simple command, and gets the report, which is explained. The command to execute is:

The getent command displays entries from databases supported by the Name Service Switch libraries

We want to know if the account apache is available at the servers involved.

The hosts file used has 7 servers, one server is duplicated and other that doesn’t exist, in order to see the behaviour of CollectNode in these cases.

Understanding CollectNode output

Get CollectNode now !

Leave CollectNode to make the hard work, and spend your time where really matters.

video: How to get list of servers sorted by OS

video: How to get list of servers sorted by OS

In this video we will see how to get a list of servers sorted by OS, displaying the operating system for each one, CollectNode gets the servers from a file, then analyze them and finally displays the report.

Enjoy!

 

Get CollectNode now !

Leave CollectNode to make the hard work, and spend your time where really matters.

Executing commands on remote windows from linux terminal

Executing commands on remote windows from linux terminal

Execute remote commands between Linux systems is something common, but What happen when you want to execute  commands on remote Windows from Linux terminal ?

Probably you already know how good is CollectNode executing any kind of command in remote Unix/Linux systems, but maybe you didn’t know is that now CollectNode is available to do the same in remote Windows systems, so let’s have a look how to do it.

If you are new on CollectNode just let you know there is a free version, totally functional, CollectNode can be installed and configured in almost any Linux system in a couple of minutes, and start managing your remote systems in a very easy way.

Let’s start

First of all, we create the list of Windows server we are going to work with:

To let CollectNode know we are going to work with Windows nodes, we have to configure the parameter nodetype, in this case lets just overwrite the parameter at hosts.file, so we put all server in a group, and define the variable nodetype for this group.

If it is the first time using CollectNode, you need to configure the credentials for Windows, for that purpose we use the following command:

The Windows credential to configure are easy, we have to write the username, password, the domain or realm if the user is part of, and the transport mode, ntlm is less secure than kerberos, but works fine with domain and not domain credentials. CollectNode use WinRM to connect to Windows nodes, if WinRM is configured by default, probably you have finished the windows credential configuration. If you are using CollectNode the first time, please have a look to install and configure. To see all CollectNode parameter can be configure to Windows nodes or how to configure with kerberos, see configuring for Windows

If you are going to use HTTP endpoint and loose confidentiality in your messages you will need to enable unencrypted messages in the Windows nodes by running the following command in all of them, by cmd:

That’s all!

We are ready to use CollectNode with Windows nodes, for instance I am going to check the operating system and version these servers have installed, using the command --os

Executing commands on remote windows from linux terminal 01

Get CollectNode now !

Leave CollectNode to make the hard work, and spend your time where really matters.

What is CollectNode?

What is CollectNode?

maybe you have heard about CollectNode, and have thought What is CollectNode? Continue reading and discover it!

It is easy to convert some sysadmin/devops routines apparently simple in something tedious, when the number of servers involved are huge.

Imagine you have to check the User configured at apache configuration file http.conf, in all production servers, but not all the servers are using apache and you don’t know which ones are.
Wouldn’t be amazing a tool where you pass the list of all servers and the task you need, and you just have to wait for the report with the result appear in front of you? That’s CollectNode!

How to use CollectNode:

  1. Create the list of server, to work with
  2. Execute CollectNode passing the list of serves
  3. Get the Report
  4. Filtering

Create the list of servers:

Execute CollectNode passing the list of serves:

Get the Report:

what is CollectNode

Now it is easy to see the two servers with apache installed and the value of the variable User.

Filtering:

What if you want the report to be more specific only showing the information that is required, you can filter the the report making it more readable for you.

Let’s see and example where CollectNode will only shows the servers where the command column in the report displays User (using where command).

what is CollectNode
The final report is very precise about we want to know, and it was needed just one CollectNode execution without programming anything.

This example was very simple just to make it more easy to understand and explain 😉 If you want to know more about CollectNode output check Understanding CollectNode output video blog entry.

CollectNode is a great tool to collect information or execute commands to multiples servers, and get reports highly customizable. Can get information from Linux (ssh) and Windows (winrm) systems, and the commands are executed at the servers in the hosts file in parallel , making it very quick and versatile.

That’s all for now
Enjoy 😉

Get CollectNode now !

Leave CollectNode to make the hard work, and spend your time where really matters.

Pin It on Pinterest