How can I switch user using su command and adding password from file ?
I want to make a script which will automatically switch the user, having the user and the password ,without manually typing the password.
Note: I don't have super user rights.
Related
After using the CREATE USER command to create a user, what command can be used to obtain the new user's password?
I don't think you can somehow return the password of any user in the NebulaGraph database. You can set the password for a user when creating it, for example CREATE USER user1 WITH PASSWORD 'nebula', or reset the password with the GOD role after the user is created, for example ALTER USER user1 WITH PASSWORD 'nebulagraph';.
I'm a UNIX AIX administrator and as per the security design, each user should have specific privileges and some user have "sftp" only they don't have ssh.
When user password expires, I have to reset the password for the user by myself ( because he don't have access as ssh to execute commands ) so I'm thinking if there is some way I can enable SSH for users but show them only specific tasks like below scenario :
User: xxxxxx
password : *******
1- Reset User.
2- Change Password.
Choose Option :
Sounds like you'll need to write a little script for the users. AIX uses Korn shell, so you can write little scripts for the user based on whatever parameters you like.
Info for modifying the SSH permissions for the individual users.
Is it possible that when a user goes to our notebook server that he/she can login using their username and password defined in /etc/passwd (which in turn uses our institution's yp) and has all the permissions of that user? Perhaps starting a new session in the user's home directory?
You should use jupyterhub for this. There you can choose between several authencation-mechanism like PAM or LDAP. You may even want to write your own.
Check https://jupyterhub.readthedocs.io/en/latest/ for more info
I have a new requirement: PDF file should be password protected after download. It should be password protected not at the time of view, but at the time of download and when tried to open. I want to use PDFsharp.
Check the Protect Document sample:
http://pdfsharp.net/wiki/ProtectDocument-sample.ashx
And don't forget to pass the "user" password to the user. User must (*) enter the password after the download when opening the file.
If you want the user to enter a password before the download, then the password protection must be implemented on the web site, not in the PDF file.
(*) Adobe Reader will prompt for the password, but other programs may display the file without password.
I am using active directory in my ASP.NET project and whenever user register in the site,an account is created in AD. There is an Forgot Password link.Is it possible to get user password from AD.I can get the name or email, but I don't know if I can get the password.
That is impossible. I would suggest that you do not implement 'forgot password' functionality, but rather 'reset password'. You generate a new password, reset the password in Active Directory and send the new password to the user.
EDIT: Based on the information in your comment. First of all, it is a very bad idea to use an administrator account the way you use it now, with the account name and password as part of your code. You're running an ASP.NET site, so you should configure the application pool to run with this account.
Second, you should simply create a DirectoryEntry with the correct path and reset the password. I'm not sure what your oEntry is:
var userEntry = new DirectoryEntry(
"LDAP://CN=SomeUser,OU=Users,DC=yourdomain,DC=com");
using (userEntry)
{
userEntry.Invoke("SetPassword", new object[] { "NewPassword" });
userEntry.CommitChanges();
}
It is impossible to get existing password for users from active directory since it is hashed with sid. But you can get new password that are going to set for users in AD. For that you need to register a password filter in every domain controller. Whenever password change request come to dc it will invoke registered password filter on both pre , post password change to User.
Refer link
https://msdn.microsoft.com/en-us/library/windows/desktop/ms721882(v=vs.85).aspx