Codeigniter connection to Filezilla Server is getting rejected - codeigniter

Here's my controller class
public function download_ftp(){
$this->load->library('ftp');
$config['hostname'] = 'localhost';
$config['username'] = 'Admin';
$config['password'] = 'admin';
$config['debug'] = TRUE;
$this->ftp->connect($config);
}
And this is the server log for the operation.
(000126)03/12/2017 23:01:53 - (not logged in) (::1)> Connected on port 21, sending welcome message...
(000126)03/12/2017 23:01:53 - (not logged in) (::1)> 220 Welcom
(000126)03/12/2017 23:01:53 - (not logged in) (::1)> USER Admin
(000126)03/12/2017 23:01:53 - (not logged in) (::1)> 331 Password required for admin
(000126)03/12/2017 23:01:53 - (not logged in) (::1)> PASS *****
(000126)03/12/2017 23:01:53 - admin (::1)> 230 Logged on
(000126)03/12/2017 23:01:53 - admin (::1)> EPSV
(000126)03/12/2017 23:01:53 - admin (::1)> 229 Entering Extended Passive Mode (|||983|)
(000126)03/12/2017 23:01:53 - admin (::1)> could not send reply, disconnected.
The filezilla server is hosted on localhost. As you can see the function successfully logs in, but the server seems unable to respond and it terminates the connection.

By default, Filezilla accepts passive mode for connection. But at times, the environment dose not support clearly for passive modes. What we normally do in such scenario from ftp client - we switch the mode of connection from Passive to Active.
The Passive property controls whether data connections for uploads/downloads are established in Active or Passive mode. To use Active mode, set the Passive property = false
// turn passive mode on
ftp_pasv($conn_id, true);
// turn active mode on
ftp_pasv($conn_id, false);

Related

How to Auto Logon in Webbrowser with Windows Login credentials

I have a website (internal application) which requires a username and password which is the same as their windows login credentials. Single sign on is technically not possible. I have about 1000 clients which need to enter their account details every time so I would like to automate this. Is it possible to script something where the user clicks on a shortcut on their desktop and is automatically logged in with the windows credentials on the website? Thanks for any ideas.
If your site is hosted on the IIS server for internal use than you can try to refer example below may help you to solve your issue.
Code:
// Ensure Directory Security settings for default web site in IIS is "Windows Authentication".
string url = "http://localhost";
// Create a 'HttpWebRequest' object with the specified url.
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
// Assign the credentials of the logged in user or the user being impersonated.
myHttpWebRequest.Credentials = CredentialCache.DefaultCredentials;
// Send the 'HttpWebRequest' and wait for response.
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
Console.WriteLine("Authentication successful");
Console.WriteLine("Response received successfully");
DefaultCredentials represents the system credentials for the current security context in which the application is running. For a client-side application, these are usually the Windows credentials (user name, password, and domain) of the user running the application. For ASP.NET applications, the default credentials are the user credentials of the logged-in user, or the user being impersonated.
Reference:
CredentialCache.DefaultCredentials Property

Dynatrace login failure after password change

I have installed the Dynatrace client and I've been using if for months. After a Windows password reset I am getting this error. I have tried entering the new and old password.
Error on Login - The login failed because either the specified user name or password is incorrect, or you are not allowed to access this Dynatrace Server.
Thank you
This could be cache issues or something at the AppMon server:
If the LDAP server is down completely, LDAP users cannot log in.
However, successful user authentications are cached on the AppMon
Server for 10 minutes by default. If the same user logs in within this
time frame, no LDAP request is sent again and the user's
authentication timeout is prolonged. The user's group membership is
not verified or updated within this time frame.
You can configure the authentication timeout by changing the value of the following system property in the dtserver.ini file:
-Dcom.dynatrace.diagnostics.ldapAuthenticationTimeout=600
Reference: Dynatrace AppMon Documentation

Spring Web Application Login with Active Directory

I had configured active directory login with spring and able to do login and fetch attributes but the problem is I have to submit raw password from my browser to server as AD requires it.
I just checked that when I posted from browser as SHA2 encoded password and passed it to AD login it gives me authentication failure. Due to security reason I need to encode password as SHA2 before posting it to Server. Is there any way to work around?
AndFilter filter = new AndFilter();
ldapTemplate.setIgnorePartialResultException(true);
filter.and(new EqualsFilter("userPrincipalName", authentication.getName()));
boolean authenticateUser = ldapTemplate.authenticate("", filter.toString(),password);
The documentation doesn't say anything about accepting an encrypted password.
The password may already be encrypted when transmitted, though I don't know off hand how that works. If you want to make extra sure, you can connect via LDAPS (LDAP with SSL). This page (under 8.1.1) makes it look as easy as replacing "ldap://" with "ldaps://" and adding the port on the end of the server name:
ldaps://myserver.example.com:636
Port 636 is the default port for LDAPS.

Safari can't login to my FTP server

I've implemented an FTP server (in Qt/C++), and all clients can login, but Safari tries with anonymous login, and then gives up.
This is the control connection log:
connection from "192.168.0.102"
reply 220 "Welcome to QFtpServer."
command "USER anonymous"
reply 331 "User name OK, need password."
command "PASS cfnetwork#apple.com"
reply 530 "User name or password was incorrect."
At that point other FTP clients will pop-up a dialog asking their user to supply a user-name and password, but Safari just says "You don't have permission to open this page".
The only way to open is to specify the username and password in the URL.
Should I change how the FTP server responds?
Edit: I just tested that Safari can't login to Filezilla Server as well, and it always asks for password, even for non-existant usernames, just like my server.

How to check if user is authenticated with CAS server?

I need to check if user is authenticated in the system in a PHP application that is not a PHPCas client. Does the RubyCAS server provide API for this? How do you make secure communication in this case?
The solution to the problem is the gateway feature of the CAS protocol. This feature will redirect a user to a CAS server so that the user’s browser can be authenticated via the initial ticket-granting cookie given to it the first time the user submitted credentials. If the ticket-granting cookie is found, then the CAS server will redirect the user back to the app without having to re-enter credentials. Read more at Techslate about this user authentication solution

Resources