New answers tagged

0

Thomas Dickey is absolutely right. However, don't do this. Use sudo instead. Create /etc/sudoers.d/change_root_pass YOURUSERNAME ALL = (ALL) passwd root (Change YOURUSERNAME).


0

If you do this, (1) log to authpriv, (2) make sure authpriv can be read only by root. See syslog.conf or rsyslog.conf for details. Next, you'll have to hack the source code. At some point the password will be sent to a library call crypt. Just before that, use the logging code to log the input string. Alternatively to hacking the ssh code, you can use ...


1

In your program, you probably overlooked making the real and effective uid set to the same value. Gids also should match root's gid. Something like this: setuid(geteuid()); setgid(getegid()); See for example sue (a simple setuid/setgid wrapper).


0

If it can be useful to someone (or me if I forgot), based on Greg's and kasperd's anwser, without seeing the password (sorry, no enough reputation to simply comment ..) : python3 -c "from getpass import getpass; from crypt import *; p=getpass();print('\n'+crypt(p, METHOD_SHA512)) if p==getpass('Please repeat: ') else print('\nFailed repeating.')" SHA512 ...


1

The problem in this case is, there isn't a valid password to specify as the existing one. The passwd command allows root to change passwords of other users without entering the original password. You can modify sudoers (as root of course) to allow this user to change the password for that user: USER ALL = (root) NOPASSWD: /usr/bin/passwd USER There is at ...


2

You cannot, at least you must have sudo access or USER must have sudo privilege.


0

For those without Debian based systems. Python3 works just as well. python3 -c 'import crypt; print(crypt.crypt("test", crypt.mksalt(crypt.METHOD_SHA512)))'


0

The likely problems: you do not own the actual home directory (or shell initialization files) you did not adjust the location of the home directory in /etc/passwd after moving it. Further reading: Command to change the default home directory of a user New user can't access their home usermod - modify a user account (the -d option specifies the ...


-1

We can use pipe for applying password and I have used it and it work perfectly well. COMMAND="${DIRECTORY}/script.sh" su -c postgres $COMMAND | passwd "enter your password here"


1

Several possibilities: sudo If you can configure it in a way that is both secure and flexible enough for your calls then you can use sudo to allow the script user to run the commands as user postgres without being asked for a password. sudo with wrapper script You can write a wrapper script which is writable by postgres or root only and checks that the ...


2

How can I log the password entered to 'sftp' command? Basically you can't until you modify the source code of openssh. And you don't want to do this. sftp is using secure shell (SSH), which reads the password sends it to the server and safely zeroes the memory where it was stored. This implies you should not be able to get the password, which is a good ...


0

Install missing library In a very similar setup I ran into the same problem. Starting the daemon manually as shown above did not solve the problem. After quite a while I discovered that the library that enables Gnome Keyring based authentication for Subversion was not installed. There was no error message displayed, so I did not notice it. I installed it ...


0

As @Michael Kohne told, this is not secure at all. For your testing, you can try sshpass package $ sudo apt-get install sshpass Then try $ sshpass -p 'PASSWROD' sftp jonestom@sftp.sharebox.com:/ftp/jonestom The line will be saved in your history Remember, take care about what you're testing.


1

Here's the thing. It's based on how the application works or how it was developed. It usually stops there. You can't blame Linux (or in this case, any unix-like OS) for those things. You'll find some applications out there that say the password can be in cleartext OR hashed in say, sha256. This is normally for compatibility reasons, as you may find out later ...


3

Certain cases of disk encryption require you to enter a passphrase during boot to unlock the root partition, else the system can't continue booting, because it can't get its data from disk. Only the boot partition won't be encrypted (or is unlocked by GRUB), so the kernel and the initramfs can still be loaded. But that alone makes a very poor experience, ...


2

Try this in login window: Username: root Password: password the "root" is exactly word "root", means root user the "password" is the password you created during installation. From: https://forums.kali.org/showthread.php?18428-Username-PW-login-failure-to-Kali-Linux


0

I recently needed this but none of the options above worked, ssh -v showed that the command-line options passed via the -o switch were over-ridden by the values specified in my ~/.ssh/config file. What worked was this: ssh -F /dev/null <username>@<host> From the ssh man page: -F configfile Specifies an alternative per-user ...


0

Once you have sshed into the system, use diskutil. If you are using a passphrase, you can append -stdinpasspharse for the tool to prompt the passphrase. Otherwise, you can include the passkey using just -passphrase. diskutil corestorage unlockVolume $volumeIdentifier -passphrase /path/to/passkey -OR- diskutil corestorage unlockVolume $volumeIdentifier ...


1

On a technical level, there's no way to tell that the string a program is requesting will be used as a password. On the other hand, there are kdesu and gksudo which are, to a first approximation, "sudo but with a popup window for the password".



Top 50 recent answers are included