Ask for certain credentials when trying to open a file on windows - powershell

I have a file on windows 7 and what I want to do is once someone tries to open this file I want a window to appear asking for the username and password (which is not related to the windows credentials, these credentials would be stored somewhere in another file) and depending on the username and password entered a file will be copied from one location to another. So for example, if userA logged in with passUserA then fileA will be copied to a destination folder, if userB logged in with passUserB then fileB will be the one copied to a destination folder. Any thoughts please how this can be done?

Related

Importing a large .sql file into a database - repeated timeout error myPHPAdmin

I have a .sql file (db) which I am trying to import using myphpadmin and keep getting a time out error.
The file is 46.6 MB (zipped)
Please note I am not on XAMPP but using a Godaddy myphpAdmin platform to manage the database.
What I've tried:
Re-downloaded the file as a zip file - and tried importing it. Still failed.
For this option given in phpmyadmin import, I tried UNSELECTING this option > "Allow the interruption of an import in case the script detects it is close to the PHP timeout limit. (This might be a good way to import large files, however it can break transactions.)"....and I also tried importing the db keeping it selected, but this failed. Which should it be?
What else can I do?
nothing worked, except SSH.
What you need:
Database (that you are importing into) username and password
Cpanel username and password + IP address (for Putty)
I had to upload the .sql file to a folder on the public_html.
Download pUtty
In putty I needed the IP address (hosting server) as well as the cpanel username and password (so have that handy).
Once in, you have to enter your cpanel's password
Use the "cd" change directory command to change directory to where you have placed your .sql file.
Once there, use the following command:
mysql -p -u user_name database_name < file.sql*
(Note: replace 'user_name', 'database_name', and 'file.sql' with the actual name.)**
You will be prompted for your database password, and then your database will be imported.
Useful link: https://www.siteground.co.uk/kb/exportimport-mysql-database-via-ssh/
You can try unzipping the file locally and importing the uncompressed .sql file; the overhead of uncompressing the file in memory could be the problem for phpMyAdmin. Generally, though, what Shadow said is correct and you should use some other means for import (like the command-line client). You could also use the phpMyAdmin UploadDir feature to put the file on the file in a special folder that phpMyAdmin can directly access on the server. This can help with a lot of the resource limits the webserver imposes.

Cracking/changing htpasswd

I have an old website that I created a folder that's protected with htpasswd. However, it's over a decade old, and I have since forgotten the password. I wish to access the contents of the folder. I'm able to view the directory contents via the control panel, but I'm unable to access the individual protected files.
I have access to the htpasswd file, and it has lines of user:password, where the password seems to be hashed (13 characters, uppercase/lowercase/digits). I tried loading it into John and it detects it as CRYPT, but was unable to crack it even after a few hours. Are there better ways of accessing the files? Given server access, can I reset/remove the password protection? Or, failing that, are there better/faster ways of brute forcing the password hash?
So you have SSH access to the server, but don't remember the values used to generate the passwords stored in the htpasswd file so you can't access them via control panel?
You could just login and rename (disable) the .htaccess file:
$ mv protected_dir/.htaccess protected_dir/.old.htaccess
If you want to crack the old password first read this: https://www.slashroot.in/how-are-passwords-stored-linux-understanding-hashing-shadow-utils to understand the password format.
Then basically you can use John, but you have to take the password file and append the salt to each password.
$ john --wordlist=passwd_salted.txt passwords_to_crack.txt
Good luck!

Command line for Dropbox connection in Duplicati backup

I'm trying to backup Folders from local drive to Dropbox using Duplicati command in Command prompt. (Backup should be Incremental)
C:\Users\Desktop\Office_Works\Duplicati\Duplicati 1.3.4\Duplicati>Duplicati.CommandLine.exe backup a https://www.dropbox.com/
Enter passphrase: **
Confirm passphrase: **
**Unable to find backend for: https://www.dropbox.com/**
"a" is my folder in local drive. Now I want to know how to make a connection with Dropbox using command lines. Is any particular way to connect Dropbox using duplicati commands?
There is no direct support for DropBox in Duplicati.
Others have reported using a local folder under the DropBox folder as a destination, such that the DropBox client synchronizes the folder for you.
There's a project that can upload files to dropbox from the command prompt. It's very lightweight and both installation and usage couldn't have been easier!
PneumaticTube
If you use it the first time it will open your browser to ask for permission to access your dropbox account but from then on it's easy sailing.

owncloud with setup-owncloud.php installation not working

There is a possibility to install Owncloud with a php script setup-owncloud.php.
I have uploaded this file to my domain.
and startet the script with the Webbrowser.
I found out it has downloaded the files to the server, so far the script is working.
then it will request a admin name/pwd a db name, db user and db pwd.
I add this information hit the next button - then nothing happen except a white page (no error, no Information)
if i go to www.domain.com/owncloud/
the starting page come requesting again a admin name/pwd a db name, db user and db pwd
so the information are not stored nor the page corectly started
thanks for feedback
have a nice day
vinc
I think your file is not named correctly. The setup file with your values for database, etc, is
config/config.php

Change Administration Console Password in Jboss

How to change Administrator console password using web console
Now i start my Jboss and given the path till default port on Browser,
after that i click on Administration COnsole the it asked me for UserName and Password then i given it, But there is not any option of Change password there,
Then what can i do to change password?
Please tell me the steps
go to jboss installation root directory. And then navigate to bin folder. Launch ./add-user.sh and then type existing user name and after warning the user already exists just type new password.
1.Log in to your server and open the root directory.
2.Open the path "server > default > conf >props/" and look for the "jmx-console-users.properties" file.
3.Open "jmx-console-users.properties" with a text editor such as notepad. You will see a list of user names and passwords in the format of "username=password."
4.Delete the password for the admin console account and type in a new password.
5.Upload the changed file back into the props foloder