Insufficient access rights in ldap - ruby

I get insufficient access rights when trying to bind to an LDAP server using existing user_dn and userPassword even if the userPassword is incorrect. And I get invalid credentials if I put incorrect user_dn.
Why am I getting those errors? and what is the meaning of those errors? How should I fix them?
This is the code I used for binding
require 'net/ldap'
con = Net::LDAP.new
con.host = 'localhost'
con.port = 389
con.auth 'cn=user,dc=example,dc=com', 'user'
if con.bind
# authentication succeeded
puts 'success'
puts con.get_operation_result
else
# authentication failed
puts 'fail'
puts con.get_operation_result
# p con.get_operation_result
end
Thanks in advance

Insufficient Access Rights means that the LDAP server has been configured to restrict who can access what. It's not a Bind (Authentication) error. You might want to check with the LDAP server administrator for the details.

Related

How to load a AzureML model in an Azure Databricks compute?

I am trying to run a DatabricksStep. I have used ServicePrincipalAuthentication to authenticate the run:
appId = dbutils.secrets.get(<secret-scope-name>, <client-id>)
tenant = dbutils.secrets.get(<secret-scope-name>, <directory-id>)
clientSecret = dbutils.secrets.get(<secret-scope-name>, <client-secret>)
subscription_id = dbutils.secrets.get(<secret-scope-name>, <subscription-id>)
resource_group = <aml-rgp-name>
workspace_name = <aml-ws-name>
svc_pr = ServicePrincipalAuthentication(
tenant_id=tenant,
service_principal_id=appId,
service_principal_password=clientSecret)
ws = Workspace(
subscription_id=subscription_id,
resource_group=resource_group,
workspace_name=workspace_name,
auth=svc_pr
)
The authentication is successful since running the following block of code gives the desired output:
subscription_id = ws.subscription_id
resource_group = ws.resource_group
workspace_name = ws.name
workspace_region = ws.location
print(subscription_id, resource_group, workspace_name, workspace_region, sep='\n')
However, the following block of codes gives an error:
model_name=<registered-model-name>
model_path = Model.get_model_path(model_name=model_name, _workspace=ws)
loaded_model = joblib.load(model_path)
print('model loaded!')
This is giving an error:
UserErrorException:
Message:
Operation returned an invalid status code 'Forbidden'. The possible reason could be:
1. You are not authorized to access this resource, or directory listing denied.
2. you may not login your azure service, or use other subscription, you can check your
default account by running azure cli commend:
'az account list -o table'.
3. You have multiple objects/login session opened, please close all session and try again.
InnerException None
ErrorResponse
{
"error": {
"message": "\nOperation returned an invalid status code 'Forbidden'. The possible reason could be:\n1. You are not authorized to access this resource, or directory listing denied.\n2. you may not login your azure service, or use other subscription, you can check your\ndefault account by running azure cli commend:\n'az account list -o table'.\n3. You have multiple objects/login session opened, please close all session and try again.\n ",
"code": "UserError"
}
}
The error is Forbidden Error even though I have authenticated using ServicePrincipalAuthentication.
How to resolve this error to run inference using an AML registered model in ADB?
The Databricks workspace need to be present in the same subscription as your AML workspace.
This notebook demonstrates the use of DatabricksStep in Azure Machine Learning Pipeline.
Here is the Model class register.

Google Cloud Monitoring Ruby client permission issue

I am following the Ruby code sample to add a custom metrics to stackdriver, however, I keep getting the permission denied error.
client = Google::Cloud::Monitoring::Metric.new
project_name = Google::Cloud::Monitoring::V3::MetricServiceClient.project_path project_id
descriptor = Google::Api::MetricDescriptor.new(
type: "custom.googleapis.com/my_metric#{random_suffix}",
metric_kind: Google::Api::MetricDescriptor::MetricKind::GAUGE,
value_type: Google::Api::MetricDescriptor::ValueType::DOUBLE,
description: "This is a simple example of a custom metric."
)
result = client.create_metric_descriptor project_name, descriptor
the error I got is "Google::Gax::PermissionDeniedError (GaxError RPC failed, caused by 7:Permission monitoring.metricDescriptors.create denied (or the resource may not exist).)"
The environment variable GOOGLE_APPLICATION_CREDENTIALS is set, and it works fine for the Google Cloud Storage code below
storage = Google::Cloud::Storage.new project: project_id
# Make an authenticated API request
storage.buckets.each do |bucket|
puts bucket.name
end
At this point, I don't know what is the problem. Do I need to set up a different credential for Cloud Monitoring?

How to do configuration of PostgreSQL database in DHIS2?

I've downloaded and executed DHIS-2 in the Windows operating system. I want to connect with a PostgreSQL database. I'm trying the below configuration settings in the dhis.conf file but it's not working.
connection.dialect = org.hibernate.dialect.PostgreSQLDialect
connection.driver_class = org.postgresql.Driver
connection.url = jdbc:postgresql:dhis2
connection.username = dhis
connection.password = dhis
connection.schema = update
encryption.password = abcd
It's showing me following error message.
HTTP ERROR: 503
Problem accessing /. Reason:
Service Unavailable
Please verify that the database name, username and password is correct.
You can test this on the command line / terminal with the following command:
psql -d dhis2 -U dhis -p
Then enter your password. If you cannot connect, one or more of database name, username and password are incorrect.

FTPClient login method replies 530 PASS command failed from the server

FTPClient client = new FTPClient();
try
{
client.connect(currentServerHostname);
System.out.println("Connection is successful");
System.out.println("Reply String: " + client.getReplyString());
client.login(currentServerUser, currentServerPass);
System.out.println("login ok");
System.out.println("Reply String: " + client.getReplyString());
}
catch (Exception e) {
System.out.println("No connection was established");
}
This code shows error like 530 Pass command failed in the line client.login() method.
Maybe you are trying to login with a user with a RACF account but that user (maybe) don't have an UID defined in the OMVS segment.
See if this helps:
Problem(Abstract)
An FTP client user attempts to log on to a z/OS FTP server. After the correct password is entered for user verification, the following server reply is received:
530 PASS command failed
Diagnosing the problem
With the ACC and FLO DEBUG options specified for the FTP server (see the section "Documentation for FTP Server Problems" in the Technote MustGather: Collect Troubleshooting Data for FTP for the z/OS Communications Server for instructions on starting an FTP server trace), the following messages are included in the FTP server trace:
RA0786 pass: use __passwd() to verify the user
RA0809 pass: __passwd() failed - EDC5163I SAF/RACF extract error. (errno2=0x090C1C00)
RA0888 pass: The username access has been revoked
SR2910 reply: entered
SR2947 reply: --> 530 PASS command failed
In v1r12 and later, the messages appear as:
RA0862 pass: use __passwd() to verify the user
RA1100 pass: getpwnam() failed - EDC5163I SAF/RACF extract error. (errno2=0B490808)
SR3360 reply: entered
SR3397 reply: --> 530 PASS command failed
Consider adding an ACCESSERRORMSGS TRUE statement to the FTP.DATA input used by the server (typically referenced via the SYSFTPD DD in the started proc). This will cause the server to provide more information to the end user about the nature of any logon failure (besides just '530 PASS command failed'). Some sites' security policies restrict providing more information in these cases, which is ACCESSERRORMSGS defaults to FALSE.
Resolving the problem
Each user logging in to the FTP server must have a UID defined in the user's OMVS segment. In this case, the user logging in does not have a UID defined in the OMVS segment, resulting in the PASS command failure. To resolve the problem, define a UID in the user's OMVS segment.

connect server over net::ssh

hy
i write this code in my script
def connect_sql
Net::SSH.start( #host, #user, :port=>22, :verbose => :debug ) do |ssh|
puts ssh.exec!("./root/scripts/MysqlCleanInstance.sh #{#uid}")
end
end
The probleme is for etablish a conenction between two server we use dns .The DNS information are in /etc/resolv.conf.
i dont know why when i try to connect to another server i get this error:
, [2014-01-08T17:55:34.905977 #28115] DEBUG -- tcpsocket[3f87c7e6b534]: received packet nr 5 type 51 len 44
D, [2014-01-08T17:55:34.906129 #28115] DEBUG -- net.ssh.authentication.session[3f87c7e5b2b0]: allowed methods: publickey,password
D, [2014-01-08T17:55:34.906309 #28115] DEBUG -- net.ssh.authentication.methods.keyboard_interactive[3f87c7e58948]: keyboard-interactive failed
E, [2014-01-08T17:55:34.906487 #28115] ERROR -- net.ssh.authentication.session[3f87c7e5b2b0]: all authorization methods failed (tried none, publickey, hostbased, password, keyboard-interactive)
/var/lib/gems/1.8/gems/net-ssh-2.7.0/lib/net/ssh.rb:215:in `start': Net::SSH::AuthenticationFailed (Net::SSH::AuthenticationFailed)
from clean_instance.rb:87:in `connect_sql'
Make sure your SSH keys are in place. It appears you are not able to authenticate over SSH, even after all authentication methods have been tried.
The reason you are unable to connect to another server is likely because you are not able to authenticate with that other server using a SSH key, which I assume you were able to do with the first server.

Resources