date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,426,405,492,000 |
Is there any program or script available for decrypt Linux shadow file ?
|
Passwords on a linux system are not encrypted, they are hashed which is a huge difference.
It is not possible to reverse a hash function by definition.
For further information see the Hash Wikipedia entry.
Which hash function is used, depends on your system configuration. MD5 and blowfish are common examples for used hash functions.
So the "real" password of a user is never stored on the system.
If you login, the string you enter as the password will be hashed and checked against your /etc/shadow file. If it matches, you obviously entered the correct password.
Anyway there are still some attack vectors against the password hashes. You could keep a dictionary of popular passwords and try them automatically. There are a lot of dictionaries available on the internet. Another approach would be to just try out all possible combinations of characters which will consume a huge amount of time. This is known as bruteforce attack.
Rainbowtables are another nice attack vector against hashes. The idea behind this concept, is to simply pre calculate all possible hashes and then just lookup a hash in the tables to find the corresponding password. There are several distributed computing projects to create such tables, the size differs on the characters used and is mostly several TB.
To minimize the risk of such lookup tables its a common practice and the default behaviour in Unix/Linux to add a so called "salt" to the password hash. You hash your password, add a random salt value to the hash and hash this new string again. You need to save the new hash and the salt to be able to check if a entered value is the correct password. The huge advantage of this method is, that you would have to create new lookup tables for each unique salt.
A popular tool to execute dictionary or brute force attacks against user passwords of different operating systems is John The Ripper (or JTR).
See the project homepage for more details:
John the Ripper is a fast password
cracker, currently available for many
flavors of Unix, Windows, DOS, BeOS,
and OpenVMS. Its primary purpose is to
detect weak Unix passwords.
| Program for decrypt linux shadow file |
1,426,405,492,000 |
I am running through some system upgrades and my package manager is showing changes between the upstream /etc/shadow and mine.
I would like to put some comments in the file for next time this happens. How would I accomplish putting comments in the /etc/shadow file without breaking things.
I am thinking default "#" would likely do it, but if I get this wrong the reboot won't be that enjoyable.
|
On Linux systems using GNU libc, lines starting with # are ignored in /etc/shadow. The parsing is done by __fgetspent_r(), and its source code explicitly handles (and documents) this behaviour.
So on the vast majority of Linux systems you can comment lines in /etc/shadow with # without causing problems.
Unfortunately comments are dropped when /etc/shadow is updated, e.g. by passwd; so storing comments isn't actually safe (from the comments' point of view).
This means you need to find somewhere else to store your comments: two good suggestions are dr01's idea of using /etc/shadow.README, or better yet Gilles' idea of using commit messages with etckeeper.
| How do I put comments in my /etc/shadow file? |
1,426,405,492,000 |
I am testing if the passwd command could run if the setuid bit is disabled. I disabled the setuid by running the following command:
chmod 0554 /bin/passwd
After doing so, I tested if the passwd command would still be able to function. But as expected, it didn't. Instead, it gave me the following errors:
passwd: Authentication token manipulation error
passwd: password unchanged
I tried to look for these error messages in the source code, but I couldn't find them in this file. Can anyone please direct me to find the source file that contains the error messages shown above?
|
The first error message is from the PAM library, see e.g. https://github.com/linux-pam/linux-pam/blob/master/libpam/pam_strerror.c
const char *pam_strerror(pam_handle_t *pamh UNUSED, int errnum)
{
switch (errnum) {
/* ... */
case PAM_AUTHTOK_ERR:
return _("Authentication token manipulation error");
/* ... */
}
return _("Unknown PAM error");
}
A search in the linked Git repository finds the second error message in
https://github.com/shadow-maint/shadow/blob/master/libmisc/pam_pass.c
This is the function that prints both error messages:
void do_pam_passwd (const char *user, bool silent, bool change_expired)
{
pam_handle_t *pamh = NULL;
int flags = 0, ret;
FILE *shadow_logfd = log_get_logfd();
if (silent)
flags |= PAM_SILENT;
if (change_expired)
flags |= PAM_CHANGE_EXPIRED_AUTHTOK;
ret = pam_start ("passwd", user, &conv, &pamh);
if (ret != PAM_SUCCESS) {
fprintf (shadow_logfd,
_("passwd: pam_start() failed, error %d\n"), ret);
exit (10); /* XXX */
}
ret = pam_chauthtok (pamh, flags);
if (ret != PAM_SUCCESS) {
fprintf (shadow_logfd, _("passwd: %s\n"), pam_strerror (pamh, ret));
fputs (_("passwd: password unchanged\n"), shadow_logfd);
pam_end (pamh, ret);
exit (10); /* XXX */
}
fputs (_("passwd: password updated successfully\n"), shadow_logfd);
(void) pam_end (pamh, PAM_SUCCESS);
}
| Source of passwd error messages |
1,426,405,492,000 |
Suppose for the sake of argument my password below is abc123@
I need to authenticate my linux machine through a corporate proxy to get patches and updates... normally I'd use this:
export HTTP_PROXY='http://<Americas\Username>:<Password>@proxy.foo.com'
export http_proxy='http://<Americas\Username>:<Password>@proxy.foo.com'
However, when I substitute a real password ending with @ and then run aptitude update, I get...
[mpenning@netwiki ~]$ sudo -E aptitude update
Err http://mirror.anl.gov squeeze Release.gpg
Could not resolve '@proxy.foo.com'
Err http://mirror.anl.gov/debian/ squeeze/main Translation-en
Could not resolve '@proxy.foo.com'
I have tried escaping the password with \@, escaping both with \@\@, double characters (@@), and nothing seems to get this to proxy correctly; I never had a problem until I changed my password recently.
What is the right way to escape my password in bash?
|
You could try URL-encoding your password. @ should be replaced by %40.
Tackling Special Characters in Proxy Passwords on Linux indicates this should work, but looking around other people seem not to get that to work (and I have no way of testing this).
| export HTTP_PROXY and special characters in passwd |
1,426,405,492,000 |
So I have a Debian distro at home (considering getting ubuntu), and I can't login. When I use the correct password is does this thing where it makes it look like it's going to login, and then it redirects to the login screen, but when I use an incorrect password it says "authentication failure". Does anyone know what could be causing this?
|
Perhaps your .profile, .bash_profile, /etc/profile, or .bashrc contains an error, and makes the shell exit?
If thats the case, use ctr-alt-F1 to enter the shell. use the command su - root to enter a root session, and then use nano or vi to edit the file that is broken.
| Debian Log In Failure With Correct Password |
1,426,405,492,000 |
I want to know how can I create an encrypted password in Ubuntu 14.04 LTS. Tried this:
makepasswd --crypt-md5 password_here
It did not work for me. It is throwing this Error:
sysadmin@localhost:~$ makepasswd --crypt-md5 admin123
makepasswd: Non-argument options specified: admin123
makepasswd: For more information, type: makepasswd --help
I want to add those encrypted password in one of the installation so I need the way of doing it.
|
# echo -n admin123 | makepasswd --crypt-md5 --clearfrom -
admin123 $1$ZUNNSLzQ$XsViFC1bhucsr3f8AzMPt/
As commented bellow this command is unsecure. True method - write password in file with text editor, and read password from file.
| How to Create an Encrypted Password |
1,426,405,492,000 |
I am behind a corporate firewall, which brings lots of pains in the area of proxies. There are two main approaches I've found to work:
Use Cntlm at the cost of not being able to connect (from the command line) to HTTPS and external SSH locations. (Cntlm allows you to hash your username and password using PassNTLMv2 (thus avoiding plain text) and set http://localhost:3128/ as your proxy which then redirects to your "real" proxy. As I mentioned, I cannot connect to HTTPS and external SSH using this method.)
Put my username and password in plain text in the http_proxy variable at the cost of having my username and password in plain text.
Clearly, if security was not a concern, I'd just do with option 2.
I found somewhat of a solution, in doing this in my .babrunrc (I use Babun, it's basically Cygwin with a little extra, the same could be in a .bashrc or .zshrc though)
export http_proxy="http://`echo "Y21hbjpwYXNzd29yZA==" | base64 -d`@20.20.20.20:20/"
This way my password is at least encoded. If someone came to my computer and typed echo $http_proxy they'd see my password, but I don't think there's any way around this.
Are there any alternative approaches to this? Or maybe a way to encrypt the string as opposed to encoding it? I wouldn't mind typing in some password when I open a prompt if there was no way around it.
|
Using base64 is useless, it's just a simple transformation. Using encryption with a key that's stored alongside the encrypted data is also useless because it's still just a simple transformation. If you're worried about someone getting access to your configuration files, then you need to encrypt with a key that isn't in your configuration files, and that means you'll have to type a password¹ when you log in.
Rather than make your own, use an existing encryption mechanism.
On Linux, if you go with file encryption, encrypt your home directory with eCryptfs, or encrypt the whole disk with Linux's disk encryption layer (dm-crypt, cryptsetup command), or create a small per-file encrypted filesystem with encfs. In the latter case, have a script that mounts the encfs filesystem and then runs a script stored there.
On Windows, put the file on a TrueCrypt/VeraCrypt.
Alternatively, use a password manager (set a master password, of course). Gnome's password manager (gnome-keyring) can be queried from the command line with the secret-tool utility. Seahorse provides a convenient GUI for exploring and modifying the keyring and setting a master password.
secret-tool store --label='Corporate web proxy password' purpose http_proxy location work.example.com
export http_proxy="http://cman:$(secret-tool lookup purpose http_proxy location work.example.com)@192.0.2.3/"
This required D-Bus, which is normally available by default under Linux (most modern desktop environments require it) but needs to be started manually under Cygwin (I don't know exactly how).
¹ or otherwise supply secret material, e.g. stored on a smartcard.
| Avoiding plain-text password in http_proxy |
1,426,405,492,000 |
If KeePassXC is sandboxed in a Flatpak, browsers can only access it, if they are not sandboxed, i.e. installed as an deb/rpm package or similar on the host.
Sandboxing both the browser, i.e. Firefox, and KeePassXC – or at least the browser and installing KeePassXC natively, which you'd actually want for security reasons – is not possible.
TL;DR:
this should work out-of-the box: Firefox (host-installed), KeePassXC (flatpak from flathub)
this does not: Firefox (sandboxed), KeePassXC (host or sandboxed, does not matter)
So how to make that communication work?
|
Background
If you just want the solution, you can skip this part. But for the curious, I'll explain the problems we face:
KeePassXC creates an UNIX socket in $XDG_RUNTIME_DIR/kpxc_server for applications to listen too. keepassxc-proxy is started – via native messaging – by the browser (triggered by the add-on [email protected], i.e. KeePassXC-Browser) and tries to listen on that socket to find messages.
If Firefox is not sandboxed, that proxy can start as usual. The only thing it possibly needs to do is get into the KeePassXC flatpak.
Flathub KeePassXC has a patch that allows the keepassxc-proxy to be started via flatpak run, i.e. Firefox can now run a
That is, so far, why Firefox installed on the host does work…
Now why it does not work if Firefox is installed as a flatpak: The very good official Firefox flatpak by Mozilla really does have few permissions for being a browser. E.g. it does not have any generic access to the file system (it uses portals). Anyway, whatever it does, it cannot do one thing: Spawn a process on the host or in another flatpak.
So we could solve that by making wrapper scripts and using flatpak-spawn to let Firefox escape it's sandbox. However, seeing how lovely and quite securley the Firefox sandbox is already built, I would not dare to destroy that security for such a feature. After all, from a security POV you could then also just install Firefox on the host, yet again.
So glad news ahead: This solution preserves all sandboxes and security aspects!
However, even if we've solved the fact of Firefox having to run the proxy, there are more problems. To spoiler, this are the main points we need to solve:
Starting keepassxc-proxy by Firefox (solution: we run it inside the Firefox sandbox)
Allowing Firefox to access the socket of KeePassXC
Note: At that step, you can already run the variation: Firefox (sandboxed), KeePassXC (host-installed)
Exposing the UNUX socket from the KeePassXC flatpak to other applications outside of the Flatpak. (solution: an symbolic link)
Current workaround
v1.2
Tested with: Fedora 32, org.mozilla.firefox v75 from flathub, org.keepassxc.KeePassXC v2.5.4 from flathub
Starting keepassxc-proxy by Firefox
Worst things first: We need the keepassxc-proxy as a binary, because we want to have it run inside of the Firefox flatpak. Good for us: it has not many depenencies and is available as a stand-alone application.
So I chose the Rust proxy application (because why should not I? 🙃). If you trust me, you can get my compiled binary below, just skip to two steps ahead.
Clone the git repo and compile it (run cargo build --release).
You find the result in ./target/release.
The keepassxc-proxy binary, version 211ae91, compiled with rustc 1.43.0 (the current stable in Fedora 32) for x86_64 (and if it helps and you wanna know more that .rustc_info.json).
And altghough Rust is not (yet) totally reproducibly compiling I did got the same bit-by-bit result on two machines with Fedora 32. The SHA-256 hash is c5c4c6c011a4d64f7e4dd6c444dcc70bee74d23ffb28c9b65f7ff6d89a8f86ea.
So if you are in a risky mood, you can just download my keepassxc-proxy binary here. (hosted by GitHub ;P)
Now we need to tell Firefox about the new binary.
Go to ~/.var/app/org.mozilla.firefox/.mozilla/native-messaging-hosts. Actually, the native-messaging-hosts likely does not exist yet, so do create it.
Create a file org.keepassxc.keepassxc_browser.json in there, and paste in the following content:
{
"allowed_extensions": [
"[email protected]"
],
"description": "KeePassXC integration with native messaging support, workaround for flatpaked Firefox, see https://is.gd/flatpakFirefoxKPXC",
"name": "org.keepassxc.keepassxc_browser",
"path": "/home/REPLACE_WITH_USERNAME/.var/app/org.mozilla.firefox/.mozilla/native-messaging-hosts/keepassxc-proxy",
"type": "stdio"
}
Note that only absolute paths work (I guess), so replace REPLACE_WITH_USERNAME with your $USER name, so that the paths leads to it's own working dir.
You see what I am doing: We now place the downloaded/compiled keepassxc-proxy in the same dir. Obviously, you could use any other path there, but this was the first one that is obviously accessible by Firefox and you have everything in one place. (If you have better suggestions, feel free to let me know.)
Note: Remember to make it executable (chmod +x) if it is not, already.
Allowing Firefox to access the socket
KeePassXC, by default, creates it's socket in $XDG_RUNTIME_DIR/kpxc_server. So this is what we need to give the Firefox flatpak access to (read-only is obviously enough).
Fortunately, this is easy. Just run:
$ sudo flatpak override --filesystem=xdg-run/kpxc_server:ro org.mozilla.firefox
Hooray!: For those, who install KeePassXC on the host (without any sandbox/flatpak), this is enough. Start KeePassXC and then Firefox and it should be able to connect. :tada:
Please note the "existing problems" section at the bottom, though.
Continue, if you also want to run KeePassXC in a flatpak.
Exposing the UNIX socket from the KeePassXC flatpak
Note: Again skip to the bullet point (point 1) below, if you don't wanna know the technical background.
The flatpaked KeePassXC from Flathub creates it's Unix socket in the location flatpaks should do so, in $XDG_RUNTIME_DIR/app/org.keepassxc.KeePassXC/kpxc_server. (If it would use $XDG_RUNTIME_DIR directly like the "native" KeePassXC, it would only exist in the sandbox.)
As we know, the usual keepassxc-proxy expects the file at $XDG_RUNTIME_DIR/kpxc_server. To solve this, we just create a symbolic link.
As you can verify, this actually solves our problem. For some very strange reason, the Flatpak sandbox now allows Firefox (and all other flatpaks! Just FYI, be aware of that.) to see that UNIX socket file.
As it should turn out later, this does not work when you move that symbolic link anywhere else (even another file name already prevents it from working – I've tried a lot of things.).
However, $XDG_RUNTIME_DIR is usually deleted at shutdown. So we need to recreate it at startup/user login. Good for us there, is already a tool for that. (you could also mangle with shell scripts in your autostart of course, but that is ugly.)
That's why we make use of systemd-tmpfiles. (The man page for tmpfiles.d is more useful for us actually.)
Go to ~/.local/share/user-tmpfiles.d. Again, there is a high chance the user-tmpfiles.d dir does not exist yet. If so… well… you know what to do…
Now download and place the following config file in there: kpxc_server.conf
This is basically a config file for systemd-tmpfiles that says it to create that symbolic link for the user.
Reboot, so systemd-tmpfiles can apply the changes and create the config file. (Alternatively, you can also manually run systemd-tmpfiles --user --create to apply the changes.)
Hooray!: Afterwards start the KeePassXC flatpak and then Firefox and it should be able to connect. :tada:
Please note the "existing problems" section below.
Existing problems
Firefox, for some reason, cannot see the $XDG_RUNTIME_DIR/kpxc_server file, if the file (respectively it's symbolic link target) does not exist yet.
In practise, this results in one big disadvantage: You always need to start KeePassXC before Firefox.
For some more strange reason, if you have this workaround setup, the usual way that you run a non-flatpaked native Firefox and connect it by spawning the proxy inside the flatpak (like flatpak run org.keepassxc.KeePassXC) may not work. Delete the symbolic link again to make this work.
Debugging tips
In Firefox use about:debugging to access add-on internals. [email protected] is the add-on ID. It actually also logs failed attempts. Note there are different results (logs and visibly) when it cannot start the proxy vs when it can start the proxy, but no connection suceeds (because the UNIX socket is not there, e.g.)
To manually get into the flatpak and "see" in a shell what it has access to/looks like, use something like flatpak run --command=/bin/sh org.mozilla.firefox.
To check whether the socket file is accessible (a symbolic link can point to a non-existant file) just cat it and you'll see a strange error that cat cannot find a resource
Things I've tried
Things that do not work:
Preserved for future solutions and betterâ„¢ workarounds.
all things in $XDG_RUNTIME_DIR/app are highly sandboxed, even with flatpak overrides I could not get the Firefox flatpak to read the content of the ../org.keepassxc.KeePassXC dir. Even with crazy symbolic links in it's own dir. (Do try it though, maybe you'll make it! At least you'll learn something. :wink:.)
what works though is: You can override the KeePassXC flatpak to get access to Mozilla. Only write access possible though! Thus, if it would place the proxy there (again: symbolic links here don't work!), Firefox could also read it.
The symbolic link must be created by an application outside of the sandbox. Inside of it, it's again – sandboxed – and one only visible inside of it.
Final notes
That took quite some time to figure it out.
I do try to continue improving this workaround and find solutions in this GitHub issue. It's best to follow there, if you are interested.
I've cross-posted this question and answer in the Fedora community and in the Flathub forum.
| How to setup Firefox and KeePassXC in a flatpak and get the KeePassXC-Browser add-on to work? |
1,426,405,492,000 |
Is it possible to determine the passphrases of private keys added to ssh-agent?
I'm thinking along the lines of someone with root privileges trying to find out my passphrase after I have added the key (so I don't mean something like keylogging while typing the password).
|
No, it does not store the passphrase.
What it does do is store the unlocked/decrypted key in memory so that it can use it to sign requests on an add-needed basis without prompting the user to unlock it each time. As long as you have the agent running your session is vulnerable to somebody with the needed permissions (your user or root) accessing the socket that talks to the agent and using whatever keys are loaded in your agent to sign their own requests and thus log into anything that your private key gets you into.
| Does ssh-agent store my passphrase? |
1,426,405,492,000 |
The sudo -A (SUDO_ASKPASS) option apparently causes sudo to lose the timeout (e.g., timestamp_timeout) setting.
I want to use the sudo -A option but I want to retain the default timeout (e.g., 15 minutes on Ubuntu) in a bash script. I want to ask for the user's password securely and in a GUI dialog, but I only want to prompt once for my script (not 50+ times).
Furthermore, I do not want to run my entire script as the root user because I just think that is a bad idea. Furthermore, files created by my script have the wrong ownership in this case.
The sudo -A option would work for me if it retained the default timeout.
From the sudo manual:
Option: ‑A
Normally, if sudo requires a password, it will read it from the user's terminal. If the ‑A (askpass) option is specified, a (possibly graphical) helper program is executed to read the user's password and output the password to the standard output. If the SUDO_ASKPASS environment variable is set, it specifies the path to the helper program. Otherwise, if /etc/sudo.conf contains a line specifying the askpass program, that value will be used. For example:
# Path to askpass helper program
Path askpass /usr/X11R6/bin/ssh-askpass
BTW, kdesudo has this same problem -- it requires the password every time it is called, even if just a second later in the same script.
I'm using Kubuntu 12.04 64 bit.
Here are full working example of all parts of the solution. It consists of a bash script, a "myaskpass" script as suggested here, and a ".desktop" file. The whole things should be 100% GUI (no terminal interaction at all), so the .desktop file is essential (afaik).
$ cat myaskpass.sh
#!/bin/bash
kdialog --password "Please enter your password: "
exit 0
$ cat askpasstest1.desktop
#!/usr/bin/env xdg-open
[Desktop Entry]
Comment=SUDO_ASKPASS tester1
Exec=bash /home/user/test/askpasstest1.sh
GenericName=SUDO_ASKPASS tester1
Name=SUDO_ASKPASS tester1
NoDisplay=false
Path[$e]=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
Categories=Application;Utility;
X-KDE-SubstituteUID=false
X-KDE-Username=
And a test script itself. This one will ask for your password twice when using this solution.
#!/bin/bash
sudo -k
SUDO_ASKPASS="/home/user/test/myaskpass.sh" sudo -A touch filemadeas_askpass1
touch filemadeas_regularuser1
SUDO_ASKPASS="/home/user/test/myaskpass.sh" sudo -A touch filemadeas_askpass2
touch filemadeas_regularuser2
ls -la filemadeas* > /home/user/test/fma.log
kdialog --title "Files Created" --textbox /home/user/test/fma.log 640 480
sudo rm filemadeas_*
rm fma.log
exit 0
|
I add this to my bash script:
# ask for password up-front.
sudo -v
# Keep-alive: update existing sudo time stamp if set, otherwise do nothing.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
Found it here:
https://serverfault.com/questions/266039/temporarlly-increasing-sudos-timeout-for-the-duration-of-an-install-script
https://gist.github.com/cowboy/3118588
I use another script to launch my main script and I use a .desktop file to launch that helper script. It's not very straightforward, but it can be made to work 100% GUI. I'm still looking for the perfect solution, but this is doing the trick for now.
| Graphically ask for password in a bash script and retain default sudo timeout setting |
1,426,405,492,000 |
By default, Subversion allows users to save their password in plaintext in ~/.subversion/auth/svn.simple. I'm investigating options for storing encrypted passwords in svn, but at the very least and ASAP, I want to completely disable the ability to store passwords for all of our users. We are running Subversion 1.6.17.
I can disable this within a user's home directory via the config file.
~/.subversion/servers:
[global]
# Password / passphrase caching parameters:
store-passwords = no
store-plaintext-passwords = no
However, the user could change the config file if they wanted to. Is there not a system-wide svn config file? A few options I've seen:
Option 1
In 1.8-dev, Subversion's configure script accepts a
--disable-plaintext-password-storage option to bypass the logic which stores plaintext passwords and client certificate passphrases.
I prefer not to update to a development release.
Option 2
/etc/subversion/config
AFAIK, this config file is only used when a user doesn't have a config file already in their home directory.
Option 3
Add a cron job to delete the user's auth cache in ~/.subversion/auth/svn.simple. So, even if they alter their svn config file, then our cron job would kill any stored passwords. However, even running it every minute doesn't guarantee that our backup system wouldn't grab the file(s) containing plaintext passwords.
Ideas?
|
You can't.
Whatever you do, your users can bypass it and store their password in a plain text file anyway. If you disable the feature in the client binary, they'll download or compile a different client. As a rule, if you set up obnoxious security measures (such as having to type a password for every svn operation), your users will bypass them in a way that makes security worse. (For example, writing a wrapper script that contains their password. Which they'll leave world-readable.) So don't do that.
To reiterate: you cannot, by technical measures alone, prevent users from storing their password in a file. You can forbid it, but if it makes their life difficult, they'll do it anyway.
If you're concerned about laptop or backup theft, encrypt the users' home directory. This will protect the passwords as well as the data. If the whole home directory is encrypted, the encryption password is usually the same as the login password, for usability reasons. Be sure to have a password backup policy (e.g. a sealed envelope), since losing an encryption password is irrecoverable.
If you're concerned about password reuse, impose a random (hence unique) password, which they will type once and for all into their client. Have a simple process for changing compromised passwords, of course.
| Disable svn plaintext password storage for all users |
1,426,405,492,000 |
I'd like to set up my laptop so that if a wrong password is entered when the screen is locked, a picture is taken using the laptop's webcam. I examined xlock (from xlockmore package), but there is no option to run a customized action when a wrong password is entered.
There is a similar question on SuperUser, but only targets Windows: Taking a picture after entering wrong password.
(For those who like funny cat photos: My laptop is set up to take a picture after 3 incorrect password attempts.)
|
Copied this post on ask Ubuntu by gertvdijk, pointed out by mazs in the comments. In the effort of closing this question.
Based on this post on the Ubuntuforums by BkkBonanza.
This is an approach using PAM and will work for all failed login attempts. Using SSH, a virtual terminal or via the regular login screen, it doesn't matter as everything is handled by PAM in the end.
Install ffmpeg, we're going to use this as a command line way of grabbing the webcam images. Update: ffmpeg is removed when you upgrade to Ubuntu 14.04. We can use avconv in place of ffmpeg in the below script. No need to install anything separately.
Create a small script somewhere, e.g. /usr/local/bin/grabpicture with the following content
#!/bin/bash
ts=`date +%s`
ffmpeg -f video4linux2 -s vga -i /dev/video0 -vframes 3 /tmp/vid-$ts.%01d.jpg
exit 0 #important - has to exit with status 0
Change the /dev/video0 with the actual video device of your webcam and choose a path where the pictures are being saved - I just choose /tmp. In the newer version of Ubuntu use avconv instead of ffmpeg (sudo apt-get install libav-tools).
Make it executable, e.g. chmod +x /usr/local/bin/grabpicture.
Test it, by just calling it: /usr/local/bin/grabpicture. Check if you see files appearing in /tmp/vid....jpg.
Configure PAM to call this on every failed attempt.
Note: do this carefully - if this fails you'll not be able to gain access to your system again in a regular way.
Open a terminal window with root access (sudo -i) and leave it open - just in case you screw up in the next steps.
Open /etc/pam.d/common-auth in your favourite editor, e.g. by doing gksudo gedit /etc/pam.d/common-auth. Keep in mind for the following steps that order of lines in this file matters.
Locate the line below. By default there's one line before the one with pam_deny.so. On my 12.04 system it looks like this:
auth [success=1 default=ignore] pam_unix.so nullok_secure
In this line change the success=1 to success=2 to have it skip our script on succes. This is an important step.
Right below there, add a new one to call the actual script:
auth [default=ignore] pam_exec.so seteuid /usr/local/bin/grabpicture
Save and close the file. No need to restart anything.
Test it.
In a new terminal window, as regular user, try su -l username to log in as another user with username username (change with an actual one of course). Deliberately enter the wrong password. Check if this result in a new picture.
The same as above, but now enter the correct password. Check if you log in and it doesn't result in a picture being taken.
If the tests have succeeded you can log out from your DE (Unity/KDE/...) and you should see the same when entering a wrong password from the login screen.
| Taking a picture with a laptop webcam after entering an incorrect password |
1,426,405,492,000 |
I am trying to chroot into an old HD to change a forgotten password,
but chroot says permission denied? what gives? I am root! The harddrive I am trying to chroot into is an old version of edUbuntu 7.10 might that have anything to do with it?
root@h:~# chroot /media/usb0/
chroot: failed to run command `/bin/bash': Permission denied
|
Chroot in ubuntu or recovering Ubuntu,Debian Linux
boot from livecd of ubuntu, if you installed with system 32bit use 32bit Live CD, If 64bit use 64 bit live cd.
Mount the Linux Partitions using
# sudo blkid
Output:
sysadmin@localhost:~$ sudo blkid
[sudo] password for sysadmin:
/dev/sda1: UUID="846589d1-af7a-498f-91de-9da0b18eb54b" TYPE="ext4"
/dev/sda5: UUID="36e2f219-da45-40c5-b340-9dbe3cd89bc2" TYPE="swap"
/dev/sda6: UUID="f1d4104e-22fd-4b06-89cb-8e9129134992" TYPE="ext4"
Here my / Partition is /dev/sda6
Mount the / Partition to mount point using
# sudo mount /dev/sda6 /mnt
Then Mount the linux access points, Linux devices, Proc, sys
Linux Device
# sudo mount --bind /dev/ /mnt/dev
proc system information
# sudo mount --bind /proc/ /mnt/proc
Kernel information to user space
# sudo mount --bind /sys /mnt/sys
If we need to enable the networking we need to do the following steps (Optional).
# cp /etc/resolv.conf /mnt/etc/resolv.conf
Change the Linux root to be the device we mounted earlier in step 2
# sudo chroot /mnt
Now try to change the root password it will work.
| chroot permission denied! But I'm root! |
1,426,405,492,000 |
I'm running Debian in a virtual machine and for convenience I would like to remove the password on root (since it doesn't really matter what happens to this box). Internet hasn't been too helpful on this one, which I suppose is OK because this is not normally something you'd want to do!
I tried passwd -d root, but su won't accept the empty password. I assume there is some sort of PAM policy blocking me, but I haven't been able to find a working solution. Any help appreciated!
(Just to clarify: I don't want to always run as root. I'd like a little bit of accident proofing in case I spaz out and rm -rf /. Just, when I'm ready to run as root, I don't want to be second guessed.)
Edit: I also know about the sudoers hack. I'm just curious to find out what in Debian is blocking this.
|
I totally agree this is a bad thing to do. But it can be done in debian by doing as you have done passwd -d root to clear the password then editing /etc/pam.d/common-auth. Find the pam_unix.so line and add nullok to the end if its not there or change nullok_secure to be just nullok if yours says nullok_secure.
This works on Debian Wheezy (and Squeeze).
| How to remove root password on Debian? |
1,426,405,492,000 |
Is it possible to change password database file(/etc/passwd) to some other file. How does this authentication mechanism work internally ?
Does it depend on pam ?
|
You're right: /etc/passwd and /etc/shadow are consulted by pam_unix.so, which are part of PAM. At least on modern Linuxes. You could change this by patching pam_unix.so. If the manpage is to be believed, you can't change the location of the system databases.
And you really don't want to. /etc/passwd isn't just used for authentication, it's also used for (reverse) name resolution and to look up things like the user's full name, shell, et cetera. The name and location are so standardised that moving them would almost definitely break things outside of just PAM. You'd have to patch a lot more than you bargained for.
Update: If you're trying to hide the /etc/{passwd,shadow,group} files for security, don't worry about it. Security by obscurity rarely helps as a policy. Leave them where they are and tighten the rest of your policies.
Update: a possible solution
If you have some custom software you need to access a different set of user/group databases, you could make a copy of the relevant PAM and NSS modules and patch them to use your custom databases. The original unix databases stay where they are so software isn't confused, but you can set PAM and NSS to use your custom modules wherever you need to and using whatever policy makes sense to you.
Keep the unix databases essentially pristine and you have what you asked for. This is pretty much what the radius and ldap PAM/NSS modules do: they provide an additional (not replacement) source of credentials and user/group information.
Going one step further: you can go back to PAM and NSS and disable the unix database lookups altogether. Leave the files there for old software (naturally, their views of the user/group databases will be inaccurate, but at least they won't break).
| Is it possible to change password database file(/etc/passwd) in linux? |
1,426,405,492,000 |
I would like to authenticate to neomutt using keepassxc. I could not find a way to send password to neomutt's stdin. How can i do that ?
I imagine something like this:
keepassxc-cli exportpass mydatabase.kdbx [email protected]
end output would be the password it self. How can I achieve this ?
EDIT: I have found out out keepassxc-cli show Database.kdbx accounts.google.com. But it does not show password. Instead it returns PROTECTED.
Thank you for help
|
The solution is to use the -s (--show-protected) and -a (--attributes) flags as follows:
keepassxc-cli show -sa password database entry
-s will display the password instead of PROTECTED , and -a password will output only the password.
| KeepassXC-cli: Send password to stdout |
1,426,405,492,000 |
I've got a laptop which I haven't used since the last summer vacation: I did put Debian 7 on it and used Debian's feature to fully encrypt the disk, besides a tiny bootloader (or a tiny partition) I guess (not too sure which encryption this is nor how to find out).
I do know the password of the encrypted filesystem so the system boots, but I'm stuck the login prompt: I did forgot my password(s).
Seen that I know the password of the encrypted filesystem, I take it I can boot from a Live CD (or even maybe from the Debian install CD?) and somehow "mount" the encrypted partition.
If that's the case, can someone explain me how to do this? (knowing that I've never mounted an encrypted partition / filesystem manually)
|
Full disk encryption is usually done using the dm-crypt Device Mapper target, with a nested LVM (Logical Volume Manager) inside. So to reset your password you'll have to
Unlock/open the crypto container; this is done using cryptsetup
Activate the logical volumes; vgchange is used for this.
Usually you won't need to care about this. Just let the initrd provided by your distribution do the job but tell it not to start /sbin/init but something else — a shell would be good. Simply append init=/bin/sh to your kernel's command line in your boot loader (with GRUB you could press E with the appropriate boot entry selected to edit the entry).
Then your kernel should boot up normally, booting into the initrd which should ask for your passphrase and set up your file-systems but instead of booting the system up drop you into a shell. There you'll have to
remount / read-write: mount -o rw,remount /
reset your password using passwd <user> (since you're root you won't get prompted for the old one)
remount / read-only: mount -o ro,remount / (skipping this might confuse your init scripts)
Start the regular init with exec /sbin/init (or simply reboot -f).
If this does not work, you'll have to take the approach with greater effort and do it from "outside", a.k.a. booting a Live CD. Usually this should be possible by using the Debian install CD — the tools should be installed, since the installer somehow has to set up encryption which uses the same schema:
Boot a Live CD
Open the encrypted partition by issueing
# cryptsetup luksOpen /dev/<partition> some_name
where <partition> should be your encrypted partitions name (sda2, probably). some_name is just… some name. This will prompt you for the disk's encryption passphrase and create a block device called /dev/mapper/some_name.
Activate the logical volumes. This should usually work by issueing
# vgscan
# vgchange -ay
This will create block device files for every logical volume found in the LVM in /dev/mapper/.
Mount the volume containing your / file system:
# mount /dev/mapper/<vgname>-<lvname> /mnt
where <vgname> and <lvname> are the names of the volume group and the logical volume. This depends on the way distributions set it up, but just have a look into /dev/mapper/, normally names are self-explanatory.
Change your password with passwd <user> accordingly.
| How to reset password on an encrypted fs? |
1,426,405,492,000 |
If I cat /etc/shadow I can get the encrypted passwords of root and my user.
These passwords are the same (I know, bad security) for each account, but in /etc/shadow they show up as being different encrypted strings.
Why? Are different algorithms used for each?
|
Separate users means a separate User ID, and therefore separate hashes will be involved with the algorithm.
Even a user with the same name, same password, and created at the same time will (with almost certain probability) end up with a different hash. There are other factors that help create the encryption.
If you want to look at a quick example here it may explain it better.
| Root and my password are the same |
1,426,405,492,000 |
I have an Ubuntu 10.04 Linux server that I normally ssh into (from my home machine) using ssh key authentication. However, sometimes I need to ssh remotely from potentially insecure machines (like internet cafes, public computers at the library, etc) on which my password could become compromised. In this case, I'd want to use a one-time password system like OTPW or Steve Gibson's Perfect Paper Passwords.
How can I configure my server to first check for ssh keys, then use an OTPW system for authentication? (Would I have to make two users?)
|
Edit: sorry for answering my own question! (The other two answers are great, but don't completely answer the question. But still very helpful!)
The OTPassword Pluggable Authentication Module implements Steve Gibson's Perfect Paper Password system in a PAM for Linux. Once you install that, you'll have PPP authentication. But what about a ssh keys bypass? An FAQ on their site answers this question:
If you have a trusted machine from which you often log into your remote system use ssh keys. Generate them with ssh-keygen, and copy your new ~/.ssh/id_rsa.pub into ~/.ssh/authorized_keys on remote computer. When SSH authenticates user with keys it omits PAM.
Conveniently automatic!
Edit: Google Authenticator and Duo Security also seem like good solutions. They don't provide one time passwords on paper; instead they use your smartphone to generate a constantly changing TOTP key. (Duo Security also works with dumbphones by sending them a text message with a couple of one time passwords. However Duo Security is not local; you must rely on their servers...)
| SSH authentication: either SSH keys or one time password |
1,426,405,492,000 |
ARM machines often have a default password. On Arch Linux, this is:
User: alarm
Password: alarm
I am assuming that the "arm" part of "alarm" refers the architecture, but what does the "al" stand for?
Perhaps I am completely off on my assumption.
|
The al part stands for Arch Linux, the arm part for ARM as you surmised.
| What does the "al" in "alarm", the default Arch Linux ARM processor username+password stand for? |
1,426,405,492,000 |
I have an SSH standard user account on my personal server, and it has sudo access (via its password).
I ssh in using a public key, so I don't have to type in the account password to log in. Is it safe for me to allow this user passwordless sudo access to run only the apt-get update and apt-get upgrade (or apt-get dist-upgrade) commands? I'm asking from a security standpoint, not from a 'broken/buggy update' standpoint. I am the only one logging in, and if I break something with an update, I can always sudo (with a password) to fix things.
The main point is to be able to run timely updates on my server without needlessly typing in a password. But, if someone did get access to this account, I don't want them to be able to install anything, and I don't know if there are other concerns I should have with these two commands.
Here is the exact line in my sudoers file:
stephen ALL=(root) NOPASSWD: /usr/bin/apt-get update, /usr/bin/apt-get upgrade, /usr/bin/apt-get dist-upgrade
|
Allowing a less trusted user to run apt-get update is ok. They worst they can do is consume a lot of bandwidth and fill up some disk space, and they have plenty of other means to do this unless you've taken stringent measures to prevent this.
Allowing a user to run apt-get upgrade is likely to give them root access. Some packages query the user and might allow a shell escape; for example the user who has access to the terminal that apt-get upgrade (or any dpkg -i call) is running on might get prompted for what to do if a configuration file has been updated, and one of the options there is to run a shell to examine the situation.
You need to restrict the command some more:
#!/bin/sh
set -ex
exec </dev/null >"/var/log/automatic-apt-upgrade-$(date +%Y%m%d-%H%M%S)-$SUDO_USER.log" 2>&1
apt-get --assume-no upgrade
This shouldn't give the user a way to become root, since they can't interact with the package manager. As upgrades can sometimes break a system, and a user with only these permissions wouldn't be able to repair anything, this should only be done with a stable release, with only security updates pending. If it's a kernel update, let a user with full root access decide when to trigger a reboot.
By the way, the user wouldn't be able to inject package content — to do that, they'd need to be in control of the server distributing the package, and in addition to the server signing the package if the package is signed (which is the case for all official sources). It's irrelevant for this attack vector who's in command of the machine at the time of the upgrade.
All this being said… use unattended-upgrades, if that's what you want.
| Is it safe for my ssh user to be given passwordless sudo for `apt-get update` and `apt-get upgrade`? |
1,426,405,492,000 |
I know several ways to reset root user's password, but want to know which is the best and why it is. For example: A method:
Grub > e
init=/bin/sh (Remove rhgb and quiet tags if necessary) > Ctrl+x
/usr/sbin/load_policy -i
mount -o remount,rw /
passwd root or passwd
mount -o remount,ro /
B method:
Grub > e
rd.break > Ctrl+x
mount -o remount,rw /sysroot/
chroot /sysroot/
passwd root or passwd
touch /.autorelabel
Which is the best? Why is it best? I'm preparing for RHCSA (Red Hat Certified System Admin) exam. I need to know the relative merits of each approach. Is one of them more portable? Safer? Is there a reason to choose one over the other?
|
I think the best way is as is shown in Red Hat documentation.
This is your second method. For GRUB2/RHEL7 single/emergency mode should not work since it will use sulogin to authenticate you before presenting the command prompt.
So lets mark off different methods.
For RHEL5, RHEL6, append 1, s or init=/bin/bash to kernel cmdline
For RHEL7, RHEL8, CentOS7, CentOS8, append rd.break or init=/bin/bash to kernel cmdline
It appears that the second method is not available on RHEL5 and RHEL6. But for RHEL7 I will prefer the first because adding init=/bin/bash is a bit tricky when single mode is password protected and may be appending rd.break is a way to standardize it.
| What is the difference between using 'init' and 'rd.break' for reseting the root password? |
1,426,405,492,000 |
I would like to manage my ssh passwork with gnome-keyring. I am on Ubuntu 12.04.3 LTS, gnome3. I don't have root access to the system.
The question is in the title indeed:
gnome-keyring-daemon: insufficient process capabilities, unsecure memory might get used
This worries me. What does it mean?
|
Since you are not root on system, the process calling gnome-keyring-daemon does not have the privileges to prevent a possible write of the sensitive cryptographic key data to the system's hard disk.
What happens is that the gkd process does not have the ability to perform a CAP_IPC_LOCK to lock memory. If your filesystem supports capabilities, you can give the executable this capability with this terminal command:
sudo setcap cap_ipc_lock=+ep `which gnome-keyring-daemon`
Without this capability the key storage memory can not be locked, there is a chance the memory might swap out and be written to the hard disk, where it could be read by someone with either root access on the machine or physical access to the hard disk the memory swapped to.
Here is the source code of the file that generates that warning: https://github.com/GNOME/gnome-keyring/blob/master/daemon/gkd-capability.c
More information about memory locking: http://man7.org/linux/man-pages/man2/mlock.2.html
| gnome-keyring-daemon: insufficient process capabilities, unsecure memory might get used |
1,426,405,492,000 |
I recently installed OpenBSD 4.9 in my computer, so I could learn a little bit about Unix-like operating systems. I added a new user to the system called bruno. Ok. When I use the 'sudo' command, it asks me for a password. So, I enter the password. But it keeps me telling that the password is wrong, even though I'm sure that the password is correct. What am I missing here? I know if add
bruno ALL = (ALL) NOPASSWD: ALL
to the /etc/sudoers file it stops asking for the password, and I can execute the sudo command. What should I do here? What's the most correct/secure option? I'm sorry if it's a trivial question. I couldn't find a good explanation for this issue. I'm not only looking for solutions, but for explanations on how this whole user/permission/password thing works.
|
This is an illustration of the difference between authentication and authorization.
Sudo is primarily a tool for authorization. Its job is to determine whether you are allowed to execute a command with elevated privileges, and if you are, to execute that command. An entry like
bruno ALL = (ALL): ALL
in the sudoers file allows the user bruno to execute any command with any privilege.
In order to apply this rule, Sudo needs to know that the user invoking it is indeed bruno. In principle, it can rely on the system's authentication mechanism: if you can run commands as bruno, it means you've already authenticated as bruno. However, since using Sudo can have major consequences, Sudo requires some extra authentication: you need to type your password again, sometimes. This means that if you've left your console unattended and a passer-by gets to run command as bruno, they won't be able to use Sudo: they might be able to damage your account, but not the rest of the system.
Another advantage of requesting a password is that it alerts you that something unusual is taking place. For example, an application cannot silently call sudo: it would need to ask you for your password, and an unexpected password prompt would alert you that something bad is taking place.
In practice, asking for a password each and every time you run Sudo would be annoying. Therefore the default behavior is to compromise: ask for a password every few minutes. This way, a passerby or application can cause harm by running sudo only if you've done it within the last few minutes.
| Why is sudo telling me my password is wrong? |
1,426,405,492,000 |
Since yesterday, each time I try to connect to an ssh server, I got asked for my password. What should I do to make SSH not ask for my password each time.
|
Put your public key in hostmachine:~/.ssh/authorized_keys and make sure it has the appropriate permissions (use chmod 600). See the man page, section AUTHENTICATION, for more details. Note that sshd maybe configured to disallow this method of login although I cannot fathom why.
| Why SSH is asking for my private key password each time |
1,426,405,492,000 |
I use some GNOME apps, and some KDE apps, so some of them use G-keyring and some KWallet... What I would like to have is a single place for managing passwords.
Is there a way to integrate G-keyring and KWallet? Or is there maybe a way to force GNOME apps to use KWallet or KDE apps to use G-keyring? OR is there maybe a way to force them all to use KeePassX or something similar (automaticaly using it after entering the master password)...?
|
I found this
One annoyance of the free desktop at present is the use of incompatible systems for storing sensitive user data such as passwords. Every web browser may have its own password store and anyone using both KDE and Gnome applications will likely have to open both KWallet and Gnome Keyring in every desktop session.
Michael Leupold presented a collaboration between KDE and Gnome to develop a unified standard for storing secrets. The aim is that KDE and Gnome applications will both be able to share a common secrets architecture but still have separate graphical interfaces.
A KDE user will be presented with a KDE interface if they need to unlock an account in Empathy (the Gnome instant messaging application) while a Gnome user will see a Gnome interface for password management even if they prefer to chat using KDE's Kopete. It is also hoped that the standard will attract the support of other vendors, such as Mozilla.
this seems older, but might be a link to the actual project?
After having hinted at it now and then, I can finally gladly announced that we (GNOME Keyring + KDE Wallet) managed to kick off a joint freedesktop.org project with the goal of creating a common infrastructure (or more technically: protocol) for managing passwords and other secret values.
| GNOME-keyring KWallet integration? |
1,422,481,728,000 |
I always boot up my GNU/Linux laptop in console mode. But sometimes I need to bring up the GUI mode. it always requires entering the root password. So I wrote the following script "gogui.sh" and put it in /usr/bin:
#!/bin/bash
echo "mypassword" | sudo service lightdm start
It is a really stupid idea, as if someone read the file, can easily see my password.
Is the an alternative to this?
|
Passing a password to sudo in a script is utterly pointless. Instead, add a sudo rule adding the particular command you want to run with the NOPASSWD tag. Take care that the command-specific NOPASSWD rule must come after any general rule.
saeid ALL = (ALL:ALL) ALL
saeid ALL = (root) NOPASSWD: service lightdm start
But this is probably not useful anyway. lightdm start starts a login prompt, but you only need that if you want to let other users log in graphically. You don't need it if all you want is to start a GUI session. Instead, call startx to start a GUI session from your text mode session. This does not require any extra privilege.
You may need to explicitly specify your window manager or desktop environment, as startx might not pick up the same default session type that lightdm uses.
startx -- gnome-session
| Passing root password safely in a shell script |
1,422,481,728,000 |
After understanding the problem with using a password in the command line, I need to find a way of feeding a program with a password without it being a problem (without the password being recorded somewhere).
I have a bash script that automatically installs an entire LAMP server from source: Apache, FastCGI, PHP & MySQL.
These installations require a password, especially MySQL.
How can I make the script fully automated without revealing the password?
Edit (9 June, 3:55 UTC):
I'm invoking mysql with a password on the command line, via root:
root@dor-desktop:/home/dor# PASS=`cat /home/dor/tmpf/pass`
root@dor-desktop:/home/dor# mysql -u root -p"$PASS"
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
(PASS="p4ssw0rd" in our case)
And I execute ps aux | grep mysql via my regular user (dor), which doesn't show me the password!
(Some of) ps output is:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 3562 0.0 0.0 34156 2864 pts/0 S+ 05:53 0:00 mysql -u root -px xxxxxx
How's that possible?
|
In regard to your update:
When a process is started it has a dedicated area of memory where arguments are stored and a int which tells how many arguments was passed.
MEMORY
argc 2
argv[0] program_name
argv[1] foo
argv[2] bar
MySQL check if password was passed on command line by -p, and if it was copy it to a new variable that is not visible, then overwrite that region of memory with x'es.
In simple terms e.g.:
argc 2
argv[1] -p
argv[2] p4ssw0rd
new_var = copy(argv[2]);
argv[2] = "xxxxx";
You can find it e.g. in client/mysqladmin.cc of the source code:
case 'p':
...
opt_password=my_strdup(argument,MYF(MY_FAE));
while (*argument)
*argument++= 'x'; /* Destroy argument */
When ps run it reads the memory region of the arguments, (argv[N]), and thus it is xxxx.
For a very short while the password is visible, but only for a few CPU cycles.
You can update the MySQL password using the special --init-file option and procedure. C.5.4.1.2. Resetting the Root Password: Unix Systems
mysqld_safe --init-file=/home/me/mysql-init &
Edit:
As @Gilles say, you can echo, printf or use here document from a script.
You can also add this to .my.cnf of your home directory or in a (temporary) file and use the --defaults-extra-file option. (Believe you have to add that option early on the command line.) optionally also include user. Also note the extra in the option name unless you want to use only that file as configuration:
[client]
user=foo
password='password!'
shell> chmod 400 my_tmp.cnf
shell> mysql --defaults-extra-file=my_tmp.conf -...
Optionally the [client] grouping makes mysqld skip the configuration.
One can also use MYSQL_PWD environment variable, but that should never be used as you can list environment, in many ps implementations by ps -e, in the /proc/<PID>/environ file on Linux etc.
tr '\0' '\n' < /proc/<PID>/environ
More on the topic here.
You might also want to have a look at the MySQL Configuration Utility which enables you to store password in a encrypted file in your home directory – .mylogin.cnf.
| Securely feeding a program with a password |
1,422,481,728,000 |
I am an absolute starter on Linux and I am operating on an OpenSUSE Leap 42.1 and here is my situation:
I was given a task to build a PC with very similar configs and properties to one already in operation. The steps I took are based on very brief instructions from a colleague and on going through the files from the already-built computer.
I was able to correctly set up the autostart for x11vnc server by creating a symbolic link from the executable to the "autostart-scripts" folder:
ln -s /usr/bin/x11vnc /home/"myusernamefolder"/.config/autostart-scripts/x11vnc
However, my problem is password-related... Using the terminal, I store the desired password as follows:
x11vnc -storepasswd "mypassword" /home/"myusernamefolder"/.vnc/passwd
Then, I create the following file:
edit /home/"myusernamefolder"/.x11vncrc
Containing the following:
display :0
rfbauth /home/"myusernamefolder"/.vnc/passwd
forever
bg
Then, when I try to remote access from another computer, there is an authentication error, as if the password I type on the VNC client does not correspond to the one I stored on the server...
I already tried not setting up a password and not creating the file above and the remote access happens successfully, but I really need this remote access to have a password.
Any tips? Can you see where I went wrong?
Thanks in advance.
|
I was able to correctly set up the autostart for x11vnc server by
creating a symbolic link from the executable to the
"autostart-scripts" folder:
Creating a symbolic is not needed.
Store your password in /home/user/.vnc/passwd
Encrypted
x11vnc -storepasswd mypassword /home/user/.vnc/passwd
Clear Text
echo mypassword > /home/user/.vnc/password
Create an autostart script at /home/user/.config/autostart/x11vnc.desktop. Desktop files in this directory are executed as soon as the GUI loads.
x11vnc.desktop
[Desktop Entry]
Name=X11VNC Server
Comment=Share this desktop by VNC
Icon=computer
Type=Application
NoDisplay=false
Hidden=false
X-GNOME-Autostart-Delay=0
Exec=x11vnc -forever -shared -display :0 -rfbauth /home/user/.vnc/passwd
Look at last line
Use this if password is in Encrypted form
Exec=x11vnc -forever -shared -display :0 -rfbauth /home/user/.vnc/passwd
Clear Text saved in file
Exec=x11vnc -forever -shared -display :0 -passwdfile /home/user/.vnc/passwd
Clear Text via Command Line (not recommended)
Exec=x11vnc -forever -shared -display :0 -passwd mypassword
forever option is used to make x11vnc server persistent. It won't exit after the first connection get disconnected.
shared options is used to allow more than 1 connections on same display
| Password problem x11vnc |
1,422,481,728,000 |
I know the typical encryption types for Linux are $1$, $2a$, $2y$, $5$, and $6$, but I haven't found any answers for what $y$ is. I'm using the latest version of Kali Linux. The two accounts are dummy accounts made for an exercise.
exam_user_1:$y$j9T$Sn7.l9zwy3VX0vbgSX1JQ0$iHN/q4Q9CPnTxm/x01joswdLKgfbexP1BKCkc13pqI6:18845:0:99999:7:::
exam_user_2:$y$j9T$ylZ/f6ILdzB/AFXh3lhRI/$adutx/xXKNf5PmGLUMMfzCa4/uIlS7ZzbU/5LIiPjo3:18845:0:99999:7:::
|
From man 5 crypt, AVAILABLE HASHING METHODS
yescrypt
yescrypt is a scalable passphrase hashing scheme designed by Solar Designer, which is based on Colin Percival's
scrypt. Recommended for new hashes.
Prefix
"$y$"
Hashed passphrase format
\$y\$[./A-Za-z0-9]+\$[./A-Za-z0-9]{,86}\$[./A-Za-z0-9]{43}
Maximum passphrase length
unlimited
Hash size
256 bits
Salt size
up to 512 bits
CPU time cost parameter
1 to 11 (logarithmic)
| What's the encryption type $y$ used in /etc/passwd on Kali Linux? |
1,422,481,728,000 |
I want to be able to script with a password in variable $password.
htdigest -c /etc/apache2/pw/$user $user $password
At the moment it asks me to manually enter a password; this is not going to be possible since it will be an automated setup by a PHP script.
Could someone please show me how to script this? Or an equivalent scriptable function?
|
See https://stackoverflow.com/questions/645659/how-do-you-htdigest-400-user-accounts
The easiest method, based on one of the suggestions in the top-voted answer, is probably this:
digest="$( printf "%s:%s:%s" "$user" "$realm" "$password" |
md5sum | awk '{print $1}' )"
printf "%s:%s:%s\n" "$user" "$realm" "$digest" >> "/etc/apache2/pw/$user"
I've used md5sum from GNU coreutils and awk rather than just md5 because it's what i have installed on my system and I couldn't be bothered finding out which package contains /usr/bin/md5 - you could also use sha512sum or other hashing program.
e.g. if user=foo, realm=bar, and password=baz then the command above will produce:
foo:bar:5bf2a4095f681d1c674655a55af66c5a
htdigest doesn't do anything magical or even unusual - it just outputs the user, realm, and password in the right format...as the command above does.
Deleting the digest for a given user:realm instead of just adding one, can easily be done with sed.
sed -i -e "/^$user:$realm:/d" "/etc/apache2/pw/$user"
And updating/changing the digest for a user:realm can also be done with sed in combination with the method above to generate the digest line. e.g.
digest="$( printf "%s:%s:%s" "$user" "$realm" "$new_password" |
md5sum | awk '{print $1}' )"
sed -i -e "/^$user:$realm:/ c$user:$realm:$digest" "/etc/apache2/pw/$user"
| Scripting htdigest -c /path/to/file/$user $user $password in Bash |
1,422,481,728,000 |
I've found various solutions to cache SSH key passphrases using such methods as ssh-agent, keychain, gpg-agent and so on. They all seem to cache it per-login or per-session, so that every time you reboot your computer, you will have to re-enter your passphrase to SSH (but subsequent SSHs won't ask for the password until you reboot).
I don't want the cache to clear on reboot. I want to enter the passphrase once, and never be asked for it again, even if I turn off my computer. How can I do this?
In case it matters, I'm on Manjaro.
|
The Gnome keyring can store an SSH passphrase and serve as an SSH agent. Make sure that you are running gnome-keyring with the ssh component; the environment variable SSH_AUTH_SOCK should point to gnome-keyring and not to ssh-agent. The keyring will contain the SSH key, so it doesn't need to be re-read from the key file in ~/.ssh. The keyring is persistent, so adding a key to it survives a reboot. Once you unlock the Gnome keyring, all of its contents including the SSH key are available to applications.
| How can I get computer to remember SSH key passphrase between reboots? |
1,422,481,728,000 |
I'm puzzled by the hash (ASCII) code stored under Linux (Ubuntu) /etc/shadow.
Taking a hypothetical case, let password be 'test', salt be 'Zem197T4'.
By running following command,
$ mkpasswd -m SHA-512 test Zem197T4
A long series of ASCII characters are generated (This is actually how Linux store in the /etc/shadow)
$6$Zem197T4$oCUr0iMuvRJnMqk3FFi72KWuLAcKU.ydjfMvuXAHgpzNtijJFrGv80tifR1ySJWsb4sdPJqxzCLwUFkX6FKVZ0
When using online SHA-512 generator (e.g. http://www.insidepro.com/hashes.php?lang=eng), what is generated is some hex code as below:
option 1) password+salt
8d4b73598280019ef818e44eb4493c661b871bf758663d52907c762f649fe3355f698ccabb3b0c59e44f1f6db06ef4690c16a2682382617c6121925082613fe2
option 2) salt+password
b0197333c018b3b26856473296fcb8637c4f58ab7f4ee2d6868919162fa6a61c8ba93824019aa158e62ccf611c829026b168fc4bf90b2e6b63c0f617198006c2
I believe these hex code should be the 'same thing' as the ascii code generated by mkpasswd. But how are they related?
Hope someone could enlighten me?
|
On Ubuntu/Debian mkpasswd is part of the package whois and implemented in mkpasswd.c which as actually just a sophisticated wrapper around the crypt() function in glibc declared in unistd.h. crypt() takes two arguments password and salt. Password is "test" in this case, salt is prepended by "$6$" for the SHA-512 hash (see SHA-crypt) so "$6$Zem197T4" is passed to crypt().
Maybe you noticed the -R option of mkpasswd which determines the number of rounds. In the document you'll find a default of 5000 rounds. This is the first hint why the result would never be equal to the simple concatenation of salt and password, it's not hashed only once. Actually if you pass -R 5000 you get the same result. In this case "$6$rounds=5000$Zem197T4" is passed to crypt() and the implementation in glibc (which is the libc of Debian/Ubuntu) extracts the method and number of rounds from this.
What happens inside crypt() is more complicated than just computing a single hash and the result is base64 encoded in the end. That's why the result you showed contains all kinds of characters after the last '$' and not only [0-9a-f] as in the typical hex string of a SHA-512 hash. The algorithm is described in detail in the already mentioned SHA-Crypt document.
| SHA512 salted hash from mkpasswd doesn't match an online version |
1,422,481,728,000 |
Zip encryption has had often a bad reputation of being weak, but some would argue that a zip file encrypted using certain algorithms (such as by using AES), together with strong password, is really safe (see: https://superuser.com/questions/145167/is-zips-encryption-really-bad )
My question is: how strong is the encryption of a zip file in Linux Mint 17.1, when one compress a file by right clicking on it in Nemo and then selecting the context "Compress..."? Does it use this same AES standard as recommended by the link above? Please assume a strong password using upper and lower case letters, numbers, symbols, 16+ digits and not a dictionary word.
|
File Roller (the GNOME application whose variant/fork/whatever-you-call-it you use) depends on zip.
That should not be the case - according to the fileroller news page, p7zip is used to create zip archives since version 2.23.4 - see this somewhat outdated fileroller news page.
It's also stated on 7-Zip's Wiki page:
7-Zip supports:
The 256-bit AES cipher. Encryption can be enabled for both files and the 7z directory structure. When the directory structure is encrypted, users are required to supply a password to see the filenames contained within the archive. WinZip-developed zip file AES encryption standard is also available in 7-Zip to encrypt ZIP archives with AES 256-bit, but it does not offer filename encryption as in 7z archives.
Checking a standard-encrypted zip file from fileroller on the terminal shows:
7z l -slt [myStrongFile.zip]
-> Method = AES-128 Deflate
Where 7-Zip's own deflate algorithm applies (which yields better compression, too), according to the Wiki.
** If you want stronger encryption, you have two options: **
use the terminal and use the higher zip encrypt security option:
7z a -p -mem=AES256 -tzip [myStrongerFile.zip] [fileToEncrypt1] [fileToEncrypt2] ...
Checking the encrypted 7z file on the terminal shows:
7z l -slt [myStrongerFile.zip]
-> Method = AES-256 Deflate
use the 7z format and encryption with fileroller, which also supports directory folder encryption, in contrary to zip files:
Checking the encrypted 7z file on the terminal shows:
7z l -slt [myStrongerFile.7z]
-> Method = LZMA:3m 7zAES:19
Which means AES-256
| How strong is the encryption of a zip file in Linux Mint |
1,422,481,728,000 |
I've created a encrypted volume with LUKS at home and was looking to use it at work too. Unfortunately, that's not possible. Whyever, I'm unable to access the encrypted data on any other computer than my workstation at home.
After entering the passphrase, I do recieve this error message:
No key available with this passphrase.
Strangely enough, I've no WTF complications to access the encrypted data on my home workstation. How can I encrypt the volume ?
|
LUKS sometimes gives the No key available error message when the cipher isn't supported. Which cipher did you use? For supported ciphers, check /proc/crypto.
Also, passphrase may depend on keyboard layout and (if it has non-ascii characters) charset encoding. The keyboard layout problem can be worked around by adding another passphrase that would match the same keysequence typed in the other layout. So for example if you have one box with a QWERTZ keyboard and another with QWERTY, you could just switch Z and Y for the second passphrase.
Also check dmesg if there are any kernel messages related to opening the encrypted container, it may point you to other errors.
If you're looking for a simpler solution and don't mind redoing it from scratch, how about encrypting the disk at your work computer and then see if you can open that at home.
| luksOpen: No key available with this passphrase |
1,422,481,728,000 |
When I connect to my remote machine I do authenticate using a rsa key (I think is rsa, don't remember).
If I do ssh from a regular shell I get logged on the machine without a password. However if I do ssh from within tmux I get asked for a password.
What is different within tmux that I get asked a password and the ssh key is not used? How can I get to not type the password from within tmux?
|
Your tmux session was started before your ssh agent was started, so the SSH_AUTH_SOCK and SSH_AGENT_PID variables are not set inside it. There are two ways to solve this. You can either copy those variables into the tmux session or run ssh-agent inside tmux to get them set, then run ssh-add to add the key to your ssh agent.
| SSH password requested when in Tmux |
1,422,481,728,000 |
I used the pam-auth-update tool in order to enable some pam configuration profiles:
PAM configuration
PAM profiles to enable:
[*] encfs encrypted home directories
[*] Unix authentication
[*] Mount volumes for user
[*] GNOME Keyring Daemon - Login keyring management
[*] ConsoleKit Session Management
All the features work as expected, but there's one thing -- the Mount volumes for user option seems to affect the su command.
I added the following line to /etc/security/pam_mount.conf.xml file:
<volume user="morfik" fstype="fuse" path="encfs#/media/Server/Dropbox.encfs/Dropbox/encrypted" mountpoint="/media/Server/Dropbox" />
and when I type in a terminal su morfik (as root), there's shouldn't be any password prompt, but instead I see this:
# su morfik
reenter password for pam_mount:
If I unchecked the Mount volumes for user option in the menu above, everything seems to be file and the reenter password disappears. I tried to play with /etc/pam.d/ files, but I don't have any experience with PAM, and I wasn't able to make it work.
Does anyone know what has to be changed in these files?
UPDATE#1
This is the content of /etc/pam.d directory:
# ls -al /etc/pam.d/
total 104K
drwxr-xr-x 2 root root 4.0K Mar 21 16:21 ./
drwxr-xr-x 153 root root 12K Mar 21 16:11 ../
-rw-r--r-- 1 root root 197 Sep 8 2013 atd
-rw-r--r-- 1 root root 384 May 25 2012 chfn
-rw-r--r-- 1 root root 92 May 25 2012 chpasswd
-rw-r--r-- 1 root root 581 May 25 2012 chsh
-rw-r--r-- 1 root root 1.2K Mar 20 17:35 common-account
-rw-r--r-- 1 root root 1.3K Mar 20 17:35 common-auth
-rw-r--r-- 1 root root 1.5K Mar 20 17:35 common-password
-rw-r--r-- 1 root root 1.3K Mar 20 17:35 common-session
-rw-r--r-- 1 root root 1.2K Mar 20 17:35 common-session-noninteractive
-rw-r--r-- 1 root root 527 Jul 3 2012 cron
-rw-r--r-- 1 root root 69 Jul 16 2013 cups-daemon
-rw-r--r-- 1 root root 4.8K Mar 5 10:18 login
-rw-r--r-- 1 root root 92 May 25 2012 newusers
-rw-r--r-- 1 root root 520 Jul 22 2008 other
-rw-r--r-- 1 root root 147 Feb 13 07:15 passwd
-rw-r--r-- 1 root root 255 Oct 15 18:40 polkit-1
-rw-r--r-- 1 root root 84 Dec 27 12:40 samba
-rw-r--r-- 1 root root 2.1K Feb 15 03:11 sshd
-rw-r--r-- 1 root root 2.3K May 25 2012 su
-rw-r--r-- 1 root root 95 Jan 15 22:58 sudo
-rw-r--r-- 1 root root 108 Oct 19 23:42 xscreensaver
There's no file /etc/pam.d/system-auth.
I checked what files have pam_mount in their content, and I got this:
# egrep -i pam_mount *
common-auth:auth optional pam_mount.so
common-session:session optional pam_mount.so
The content of the files:
#
# /etc/pam.d/common-auth - authentication settings common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of the authentication modules that define
# the central authentication scheme for use on the system
# (e.g., /etc/shadow, LDAP, Kerberos, etc.). The default is to use the
# traditional Unix authentication mechanisms.
#
# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
# To take advantage of this, it is recommended that you configure any
# local modules either before or after the default block, and use
# pam-auth-update to manage selection of other modules. See
# pam-auth-update(8) for details.
# here are the per-package modules (the "Primary" block)
auth sufficient pam_encfs.so
auth [success=1 default=ignore] pam_unix.so nullok_secure try_first_pass
# here's the fallback if no module succeeds
auth requisite pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
auth required pam_permit.so
# and here are more per-package modules (the "Additional" block)
auth optional pam_mount.so
# end of pam-auth-update config
and:
#
# /etc/pam.d/common-session - session-related modules common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of modules that define tasks to be performed
# at the start and end of sessions of *any* kind (both interactive and
# non-interactive).
#
# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
# To take advantage of this, it is recommended that you configure any
# local modules either before or after the default block, and use
# pam-auth-update to manage selection of other modules. See
# pam-auth-update(8) for details.
# here are the per-package modules (the "Primary" block)
session [default=1] pam_permit.so
# here's the fallback if no module succeeds
session requisite pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
session required pam_permit.so
# and here are more per-package modules (the "Additional" block)
session required pam_unix.so
session optional pam_mount.so
session optional pam_ck_connector.so nox11
# end of pam-auth-update config
UPDATE#2
I'm using Debian testing. I tried to change the position of pam_mount, but it's always the same. I've read some sections of the manual, and there was something like:
When "sufficient" is used in the second column, you must make sure that
pam_mount is added before this entry. Otherwise pam_mount will not get
executed should a previous PAM module succeed. Also be aware of the
"include" statements. These make PAM look into the specified file. If
there is a "sufficient" statement, then the pam_mount entry must either
be in the included file before the "sufficient" statement or before the
"include" statement.
I even added pam_mount to the /etc/pam.d/su file to check if this makes any difference, but it doesn't matter. If pam_mount if first, like they say, instead of a password prompt, I get pam_mount password prompt when I log to my system, and it still asks for password when I try su morfik
|
Ran into the same problem.
Turns out the problem is solved by adding the disable_interactive option next to pam_mount.so in the config files ( /etc/pam.d/common-{auth,session}).
It comes right after pam_mount.so and the options are separated with spaces (from the so file name and between each two options).
When the pam_mount.so code gets executed upon a login, it'll receive the password from the top of the stack and use that password to decrypt your volume.
When you're doing su from a root session, no password is required and therefore pam_mount.so will not get any password. So, without the disable_interactive option, it will try to obtain the password.
Fortunately, as you can see from https://sourceforge.net/p/pam-mount/pam-mount/ci/master/tree/src/pam_mount.c , line 493, pam_mount will try to proceed even without a password, which is good, because the password isn't needed if the volume is already unlocked and mounted.
| Why does pam_mount ask for password? |
1,422,481,728,000 |
Some applications allow to pass password as an argument. For example:
mysql --user=user_name --password=your_password db_name
Is it safe? Besides the fact that typed password would be saved in bash history, someone can type w command in the appropriate moment and will see the full command line of process (including password).
It's quite surprising for me that every user can see what command I'm currently executing.
|
The command line arguments of every process in the system is considered "public". Not just the w command, but ps and top and many other commands access that information as a matter of course. Indeed no special privileges are required to get that information. On Linux, you can read the command line of another process, even a process belonging to another user, by reading /proc/<pid>/cmdline.
This is not a flaw or unsafe behaviour on the part of w or top or ps (or cat). Rather, the onus is on the side of not passing sensitive information on command lines on multi-user systems, ever.
Most utilities that have the ability to accept passwords on the command line document that it's not recommended to do it. For example, from mysql's manpage:
Specifying a password on the command line should be considered insecure. See Section 5.3.2.2, "End-User Guidelines for Password Security". You can use an option file to avoid giving the password on the command line.
By the way, passing passwords or sensitive data in environment variables is less blatantly unsafe, but is also actually unsafe on most systems.
| Is w command safe for users? |
1,422,481,728,000 |
I want to automate the login process with sudo su.
I have seen lot of questions on these, but none of them are working for me.
Automate login with sudo and su
Here's my what I tried so far
echo "mypassword" | sudo -S su - user
echo "mypassword\n" | sudo -S su - user
echo mypassword | sudo -S su - user
echo "mypassword" | sudo -S su user
echo mypassword | sudo -S su user
I am just getting the below response
-bash: line 1: mypassword: command not found
My Bash version
GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
As a note, my password contains special character @
@ sudo
usage: sudo [-D level] -h | -K | -k | -V
usage: sudo -v [-AknS] [-D level] [-g groupname|#gid] [-p prompt] [-u user name|#uid]
usage: sudo -l[l] [-AknS] [-D level] [-g groupname|#gid] [-p prompt] [-U user name] [-u user name|#uid] [-g groupname|#gid] [command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C fd] [-D level] [-g groupname|#gid] [-p prompt] [-u user name|#uid] [-g groupname|#gid] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C fd] [-D level] [-g groupname|#gid] [-p prompt] [-u user name|#uid] file ...
|
Do not do that! That will leave your password in your shell's history!
If you really have to do that, what I recommend is that you configure your sudoers file to allow a passwordless login.
To do that, run the command sudo visudo and add a line like this one:
reddy ALL=NOPASSWD: /bin/su - *
(where reddy would be your username).
If you need to give this access to the whole team, create a (UNIX) group with the team, and replace reddy with %team (the team group).
(Also, a little off-topic: the echo command already adds the \n you needed. If you actually wanted the opposite (which you don't), the command would be echo -n.)
| Sudo Su automated login |
1,422,481,728,000 |
Running MariaDB 10.1.23-MariaDB-9+deb9u1 on Debian 9.1.
Fresh OS installation, installed MariaDB with apt-get install mariadb-server mariadb-client
Apparently MariaDB doesn't ask for a root password on install so I'm going to set it after the fact:
# mysql -uroot
> select user from mysql.user;
+------+
| user |
+------+
| root |
+------+
Ok, so root exists. Now to change its password:
> set password for 'root'@'localhost' = PASSWORD('P@ssw0rd');
> flush privileges;
> exit
Did it work?
# mysql -uroot -pblabla
MariaDB [(none)]>
Setting the password went ok but why is MariaDB accepting any random password and even an empty one?
This installation doesn't accept ALTER USER statement.
|
The answer: https://www.percona.com/blog/2016/03/16/change-user-password-in-mysql-5-7-with-plugin-auth_socket/:
Apparently the mysql-server installation on 16.04 (or any 5.7
installation?) allows root access not through password, but through
the auth_socket plugin. Running sudo mysql -u root (n.b. w/o a
password) will give you mysql console whereas running the command as
non-root prompts you for a password.
It would seem that changing the password doesn't make much of a
difference since the auth backend doesn't even check for a password.
To disable this auth_socket plugin, on the mysql prompt do
update mysql.user set plugin=null where user='root';
flush privileges;
This makes MariaDB also ask a password for [Linux] root.
Thanks jesse-b and derobert for the in-depth discussion and your answers.
| MariaDB accepts any password |
1,422,481,728,000 |
man 5 shadow says this about the 2nd field:
encrypted password
Is that true nowadays? I think it should say "hashed password". Am I correct?
|
No, the shadow file does not contain encrypted passwords, not on any Unix variant that I've seen. That would require an encryption key somewhere — where would it be?
Even the original version of the crypt function was in fact a hash function. It operated by using the password as a key for a variant of DES. The output of crypt is the encryption of a block with all bits zero. Although this uses an encryption function as part of the implementation, the crypt operation is not an encryption operation, it is a hash function: a function whose inverse is hard to compute and such that it is difficult to find two values producing the same output.
Within its limitations, the original DES-based crypt implementation followed the basic principles of a good password hash function: irreversible function, with a salt, and a slow-down factor. It's the limitations, not the design, that make it unsuitable given today's computing power: maximum of 8 characters in the password, total size that makes it amenable to brute force, salt too short, iteration count too short.
Because of the crypt name (due to the fact that crypt uses encryption internally), and because until recently few people were educated in cryptography, a lot of documentation of the crypt function and of equivalents in other environments describes it as “password encryption”. But it is in fact a password hash, and always has been.
Modern systems use password hashing functions based on more robust algorithms. Although some of these algorithms are known as “MD5”, “SHA-256” and “SHA-512”, the hash computation is not something like MD5(password + salt) but an iterated hash which meets the slowness requirement (though common methods lack the memory hardness that protects against GPU-based acceleration).
| Does the shadow file have encrypted passwords? |
1,422,481,728,000 |
I always login a server with a ssh key, so I am not sure what my actual password was anymore. I would need to guess a couple of times. However the server has fail2ban and I don't want to trigger that. Is there any way to check which of my passwords corresponds to the ssh key which is accepted by the server?
Is there anyway I can check my password after logging in with the ssh-key without triggering fail2ban?
|
No, there is no relation between an account password and the ssh key.
You can logon to an account with ssh with a key even if it has no password.
For the updated question, yes, type:
su YOURUSERNAME
then try if you remember your password
| How to retrieve ssh password with a working ssh key |
1,422,481,728,000 |
I'm trying to make a script that will unzip a password protected file, the password being the name of the file that I will get when unzipping
Eg.
file1.zip contains file2.zip and its password is file2.
file2.zip contains file3.zip and its password is file3
How do I unzip file1.zip, and read the name of file2.zip so it can be entered in the script?
Here's a screenshot of the command line:
root@kaliVM:~/Desktop# unzip 49805.zip
Archive: 49805.zip
[49805.zip] 13811.zip password:
I just need Bash to read that output in order to know the new password
(In this case the password is 13811).
Here's what I've done so far
#!/bin/bash
echo First zip name:
read firstfile
pw=$(zipinfo -1 $firstfile | cut -d. -f1)
nextfile=$(zipinfo -1 $firstfile)
unzip -P $pw $firstfile
rm $firstfile
nextfile=$firstfile
Now how can I make it do the loop?
|
If you don't have and cannot install zipinfo for any reason, you can imitate it by using unzip with -Z option. To list the contents of the zip use unzip -Z1:
pw="$(unzip -Z1 file1.zip | cut -f1 -d'.')"
unzip -P "$pw" file1.zip
Put it to a loop:
zipfile="file1.zip"
while unzip -Z1 "$zipfile" | head -n1 | grep "\.zip$"; do
next_zipfile="$(unzip -Z1 "$zipfile" | head -n1)"
unzip -P "${next_zipfile%.*}" "$zipfile"
zipfile="$next_zipfile"
done
or a recursive function:
unzip_all() {
zipfile="$1"
next_zipfile="$(unzip -Z1 "$zipfile" | head -n1)"
if echo "$next_zipfile" | grep "\.zip$"; then
unzip -P "${next_zipfile%%.*}" "$zipfile"
unzip_all "$next_zipfile"
fi
}
unzip_all "file1.zip"
-Z zipinfo(1) mode. If the first option on the command line is -Z, the remaining options are taken to be zipinfo(1) options. See the appropriate manual page for a description of these options.
-1 : list filenames only, one per line. This option excludes all others; headers, trailers and zipfile comments are never printed. It is intended for use in Unix shell scripts.
| Bash loop unzip passworded file script |
1,422,481,728,000 |
I found an old laptop lying around and I figured I would install Kali Linux on it to learn more about penetration testing and to try to break into my servers for practice and learning more about creating a secure network.
I used unetbootin to install the Kali Linux ISO I downloaded via the torrent from their site, and the install to my flash drive went successfully.
On the laptop I was wanting to put Kali on, I went into the BIOS and ordered the USB to be the priority to boot from. After that, I booted live into Kali and installed the operating system from there. It loaded up the graphical install page from Kali and the install seemed to go successfully.
However, once the installation was successful, it would take me to the login page and prompt me for the root password. I would type in the root password I had used during the initial setup, yet it gives me the Incorrect password prompt, even though I am 100% sure I was using the password I had installed at the start.
To confirm this, I tried reinstalling from the live boot multiple times, using the same password from the first attempt and even just doing "password" for testing purposes. Neither one worked.
As a final measure, I opened up the GParted Partition Editor from the Kali live boot and deleted all of the partitions on my laptop's hard drive. From there, I went through the Kali installation process again successfully, only to encounter the EXACT same issue as before when trying to log in after installation.
Does anyone know what is going on? I am clueless as to what I could do to be able to log into my Kali installation... thanks.
|
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
| Kali Linux: On install, designated root password cannot login - incorrect password |
1,422,481,728,000 |
I want to know my /etc/shadow password hash if its SHA or MD or something else. From what I read, it is related to the $ sign, but I don't have any dollar signs.
Im using Ubuntu 16
Example:
user:0.7QYSH8yshtus8d:18233:0:99999:7:::
|
The shadow(5) manual on Ubuntu refers to the crypt(3) manual. The crypt(3) manual says that the default password encryption algorithm is DES.
It goes on to say that the glibc2 library function also supports MD5 and at least SHA-256 and SHA-512, but that an entry in /etc/shadow for a password encrypted by one of these algorithms would look like $1$salt$encrypted (for MD5), $5$salt$encrypted (for SHA-256), or $6$salt$encrypted (for SHA-512), where each $ is a literal $ character, where salt is a salt of up to 16 characters, and where encrypted is the actual hash.
Since your encrypted password does not follow that pattern, I'm assuming that it's encrypted using the default DES algorithm.
| How to know if password in /etc/shadow is hashed with SHA or MD? |
1,422,481,728,000 |
I have created a user using
useradd myuser
Then, I tried to change the user's password with
usermod --password mypwd myuser
(I know a plain password on the command-line is not a good way.)
I have tried to login as myuser with mypwd. But it's failing with an "incorrect password" message.
I could use passwd myuser (this works fine). There are some constraints, so I am trying to use usermod.
Am I missing anything in usermod? or Are there any alternatives to change passwords other than passwd username?
|
The parameter given to usermod --password is expected to be the encrypted password, as returned by the crypt() function. If you look in /etc/shadow (assuming you're using local password storage) you'll see the string you specified stored as-is in myuser's entry...
If you really want to use usermod for this, you can generate the appropriate value using openssl passwd:
usermod --password $(openssl passwd mypwd) myuser
or better still
usermod --password $(openssl passwd -1 mypwd) myuser
| usermod to change user password is not working |
1,422,481,728,000 |
In order to verify a password hash we can use openssl passwd as shown below and explained here
openssl passwd $HASHING-ALGORITHM -salt j9T$F31F/jItUvvjOv6IBFNea/ $CLEAR-TEXT-PASSWORD
However, this will work only for the following algorithm: md5, crypt, apr1, aixmd5, SHA-256, SHA-512
How to calculate the hashing password, from bash or python or nodeJS for a $CLEAR-TEXT-PASSWORD, with salt using yescrypt ?
|
perl's crypt() or python3's crypt.crypt() should just be an interface to your system's crypt() / crypt_r(), so you should be able to do:
$ export PASS=password SALT='$y$j9T$F31F/jItUvvjOv6IBFNea/$'
$ perl -le 'print crypt($ENV{PASS}, $ENV{SALT})'
$y$j9T$F31F/jItUvvjOv6IBFNea/$pCTLzX1nL7rq52IXxWmYiJwii4RJAGDJwZl/LHgM/UD
$ python3 -c 'import crypt, os; print(crypt.crypt(os.getenv("PASS"), os.getenv("SALT")))'
$y$j9T$F31F/jItUvvjOv6IBFNea/$pCTLzX1nL7rq52IXxWmYiJwii4RJAGDJwZl/LHgM/UD
(provided your system's crypt() supports the yescript algorithm with the $y$... salts)
| Verifying a hashed salted password that uses yescrypt algorithm |
1,422,481,728,000 |
I have ssh-copy-id root@c199 succeeded before.
I can login by ssh root@c199 without password prompt
I want to auto login by another user ufo (remote machine has this user)
ssh-copy-id ufo@c199 ask me enter password,
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
ufo@c199's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'ufo@c199'"
and check to make sure that only the key(s) you wanted were added.
But login by ssh ufo@c199 still prompt password input .
I try to login remote centos on msys2(on Windows) by ssh , I found there are many same lines like
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCs7RTfvn83Rxdmvgfh+F4kUlM5FzIUb9rRHaqq11xKIW1gztn/+G4tr+OWl4o6GTW2Z361hIi
ugy8DPtMATN66nTTDUYO0sSvw2BrQfDY4iIENdLpkkHO8KQVGpQE+8tDkaZfD6EQLVtl0uvDE3D77tfcnBLODXgZPQsUSlssMi+pxDbSVjjKgrP
hM1G/L9OTrEHKWDhF+ZBgY1RuLl7ZEdoATbhJaK4FFb9hNn/2CSibVfLts8HJGYQXIQRX/RBzaDZp47sKZvq302ewkkVorNY+c9mmoze6mi8Ip2
zEQOMi6S9zM/yRiD0XZrbmzYfNkoXA03WTmMR/DynVvX2nV /c/Users/xxxx/.ssh/id_rsa
in centos's /home/ufo/.ssh/authorized_keys ,
I have changed .ssh user's folder permissions to 700 and authorized_keys file to 644 .
Same ssh key, ssh root@c199 promptless login , but ssh ufo@c199 prompt password input ..
UPDATE
ssh ufo@c199 -vv output:
....
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:zmCg5vHhBAMd5P4ei82+KsVg072KXbC63C44P0w3zbU
debug1: Host 'c199' is known and matches the ECDSA host key.
debug1: Found key in /c/Users/xxxxx/.ssh/known_hosts:35
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug2: key: /c/Users/xxxxx/.ssh/id_rsa (0x60006bec0), agent
debug2: key: /c/Users/xxxxx/.ssh/id_dsa (0x0)
debug2: key: /c/Users/xxxxx/.ssh/id_ecdsa (0x0)
debug2: key: /c/Users/xxxxx/.ssh/id_ed25519 (0x0)
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /c/Users/xxxxx/.ssh/id_rsa
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /c/Users/xxxxx/.ssh/id_dsa
debug1: Trying private key: /c/Users/xxxxx/.ssh/id_ecdsa
debug1: Trying private key: /c/Users/xxxxx/.ssh/id_ed25519
debug2: we did not send a packet, disable method
debug1: Next authentication method: password
|
Thanks to https://unix.stackexchange.com/a/55481/106419, which told me how to debug ssh.
To enable ssh debug to see what happen
systemctl stop sshd
/usr/sbin/sshd -d -p 22
I found:
Authentication refused: bad ownership or modes for directory /home/ufo
All guys only told:
/home/ufo/.ssh ownership is correct 700
/home/ufo/.ssh/authorized_keys ownership is correct 600/644
But sshd still check the user home folder !!! No one mentioned this !
sudo chmod 700 /home/ufo solve this problem.
Summary:
You need ensure:
/home/ufo ownership is 700
/home/ufo/.ssh ownership is 700
/home/ufo/.ssh/authorized_keys ownership is 600
change ufo to you home folder name
| ssh-copy-id succeeded, but still prompt password input |
1,422,481,728,000 |
I have a script that asks for the user's password and I want to check if the given password is wrong or not.
#A little fragment of my script
read -sp 'Your password: ' password;
if [[ $password -ne WHAT GOES HERE? ]]; then
MORE CODE HERE
else
MORE CODE HERE
fi
|
There's no fully portable way to check the user's password. This requires a privileged executable, so this isn't something you can whip up from scratch. PAM, which is used on most non-embedded Linux systems as well as many embedded systems and most other Unix variants, comes with a setuid binary but it doesn't have a direct shell interface, you need to go via the PAM stack.
You can use a PAM binding in Perl, Python or Ruby.
You can install one of several checkpassword implementations.
If the user is allowed to run sudo for anything, then sudo -kv will prompt for authentication (unless this has been disabled in the sudo configuration). But that doesn't work if there's no sudoers rule concerning the user.
You can run su. This works on most implementations. This is probably the best bet in your case.
if su -c true "$USER"; then
echo "Correct password"
fi
| Check user's password with a shell script |
1,422,481,728,000 |
I have a working bash script, that may run from 0 to 8-9 minutes. It requires sudo if it finds a problem and needs to change permissions/ownership on a file. I do not want to wait for the sudo prompt, as this might be a few minutes into the run, so I do sudo -v at the beginning of the script.
If I expect the script to take long, I often walk over to the cafeteria. So some time ago I included a trap handler, that calls a function, that does sudo -k to drop my credentials. This way pressing Ctrl+C does not leave someone with access to sudo while I am not back yet. I do also call that function at the end of the script, in case the script terminates before I am back.
If I already did a sudo command before calling the script, sudo -v, it doesn't ask me for my credentials. That is nice.
Depending on where I start I know the script is not going to take long, and I wait for it to finish. If I started it after having just done a sudo command, every time I end up without sudo credentials after it finishes.
I did check the return value of sudo -v. On exit 0, that doesn't tell me if the credentials were already there (from before running the script) or that the password was typed in correctly just before. That doesn't help me to know if I should run sudo -k at the end or not.
I thought about making two versions of the script, one with and one without sudo -v/sudo -k, but I don't think that is a nice solution and I am bound to select the wrong version at times.
Is there a better way to solve this? Am I missing something?
|
You can use sudo -nv 2> /dev/null to get an exit value of 0 when the credentials were there without being prompted for the password.
I have something like that for running fdisk and dropping the credentials
if the were not there to begin with. Combined with catching Ctrl+C you would get something like (I am not a good bash programmer!):
#! /bin/bash
# this only removes credentials if logging in at the start was necessary
reset_sudo()
{
if [ $SUDOCREDCACHED != 0 ] ; then
# drop credentials if acquired in script
sudo -k
fi
}
Ctrl_C()
{
reset_sudo
exit 0
}
sudo -nv 2> /dev/null
SUDOCREDCACHED=$?
if [ $SUDOCREDCACHED != 0 ] ; then
# acquire credentials
sudo -v
if [ $? != 0 ] ; then
exit 1
fi
fi
trap Ctrl_C SIGINT
### your stuff here ###
reset_sudo
| sudo testing for credentials |
1,422,481,728,000 |
Is there any way in which I can set the password for a newly created user account in AIX in a one line command?
I don't want to give any prompt to the user. If there is a command, it should set the password to that user without asking anything on the screen.
I need to use that command in another technology like Java/.Net. I need to create the accounts with password on a AIX machine at run time by executing one line of code where I can pass parameters.
Suppose a user is giving a username in the text box of a Java application and in the background the command needs to be executed which will create the user accounts(with the password) at a remote AIX server. I am successful to add a user account, but setting the password is something where I am stuck.
|
You can use chpasswd
The chpasswd command administers users' passwords. The root user can
supply or change users' passwords specified through standard input.
Each line of input must be of the following format.
username:password Only root users can set passwords with this command.
Example 1:
echo username:password | chpasswd
Example 2:
Also for security you can pass encrypted password to chpasswd
# Create Password in Encrpyted Form Using below command
# perl -e'print crypt("YourPassword", "salt")' ; echo -e
echo username:cryptedPass | chpasswd -e
| How to set password for users in AIX using single line command? |
1,422,481,728,000 |
I need to create bunch of new users with given password. What I want is a script that I would pass the user name of new user and it will create/add the user and set its password. (the password is the same for all new users - no security issues here.)
Any suggestions how to do that on SuSE from command line?
|
Does SuSE useradd have the -p option? That takes the password (albeit in encrypted form, but you should be able to generate that I think).
So useradd -p <crypt'ed password> <new username> should do it I think
| How to create a user with given password on SuSE from command line? |
1,422,481,728,000 |
Debian Jessie, XFCE 4.10, KeePass2, IceDove (with Enigmail)..
I'm using KeePass2 generated passwords for my gpg private key, to de/encrypt mails. Icedove is my client which uses the enigmail.
As soon as I want to de/encrypt a mail pinentry (pinentry-gtk2) pops up and I can't paste into the password field, nor can I move it - thus I'd like to have KeePass2 auto-type my long-ass password for me. Which does not work with the keyboard shortcut (working for anything else), but with a right-click in the KeePass2 entry for 'perform auto-type'.
this is slowly driving me nuts.. I've now read a ton of forum discussions - where none were really helpful and tried to alter my gpg-agent settings to use pinentry-curses. I even removed pinentry-gtk2 which rendered icedove completly incapable of de/encryption.
Any suggestions to make the auto-type feature or paste working in the pinentry window. Or an alternative pinentry?
|
In Keepass2, "Add Entry," and set "Title" to "GPG." Move from "Entry" tab to "Auto-Type" tab. Select "Override default sequence" and set to "{PASSWORD}".
Before you send email, open Keepass2 with Keepass2 password. Ask IceDove with Enigmail to "Send" and pinentry should appear (locking keyboard, preventing "Ctrl+V" (or any other keyboard shortcut you normally use to perform auto-type), preventing switch windows "Alt+Tab", etc.).
Use mouse to highlight "GPG" entry in Keepass2 and click "Perform Auto-Type" icon in Keepass2 (left of "Find" icon and underneath "Help" menu). As the keyboard "focus" was last on the pinentry text input box, Keepass2 will now start typing your long password for you.
Use mouse to click "OK" on pinentry. Done!
For more details on "Auto-Type" (http://keepass.info/help/base/autotype.html).
| Usage of pinentry with keepass2 for gpg mail encryption |
1,422,481,728,000 |
I fight with svn since 2 hours to store my password inside the gnome keyring, but nothing worked.
I'm on a fresh installed archlinux system with the following packages installed:
acl 2.2.52-1
alsa-lib 1.0.27.2-1
alsa-utils 1.0.27.2-1
apr 1.4.8-1
apr-util 1.5.2-1
arandr 0.1.7.1-1
archlinux-keyring 20130818-1
aspell 0.60.6.1-1
at-spi2-atk 2.8.1-1
at-spi2-core 2.8.0-1
atk 2.8.0-1
attr 2.4.47-1
aurvote 1.5-2
autoconf 2.69-1
automake 1.14-1
avahi 0.6.31-10
bash 4.2.045-5
binutils 2.23.2-3
bison 3.0-1
boost-libs 1.54.0-3
bzip2 1.0.6-4
ca-certificates 20130610-1
ca-certificates-java 20130815-1
cairo 1.12.16-1
cdparanoia 10.2-4
chromium 29.0.1547.65-1
cloog 0.18.0-2
clucene 2.3.3.4-7
colord 1.0.2-2
compositeproto 0.4.2-2
coreutils 8.21-2
cracklib 2.9.0-1
cronie 1.4.9-5
cryptsetup 1.6.2-1
curl 7.32.0-1
customizepkg 0.2.1-2
damageproto 1.2.1-2
db 5.3.21-1
dbus 1.6.12-1
dbus-glib 0.100.2-1
dconf 0.16.1-1
desktop-file-utils 0.21-1
device-mapper 2.02.100-1
dhcpcd 6.0.5-1
dialog 1.2_20130523-2
diffutils 3.3-1
dirmngr 1.1.1-1
dnssec-anchors 20130320-1
dotconf 1.3-3
e2fsprogs 1.42.8-1
elfutils 0.155-1
enca 1.14-1
enchant 1.6.0-4
exo 0.10.2-1
expat 2.1.0-2
faac 1.28-4
faad2 2.7-3
fakeroot 1.19-1
farstream-0.1 0.1.2-2
fftw 3.3.3-1
file 5.14-1
filesystem 2013.05-2
findutils 4.4.2-5
firefox 23.0.1-1
fixesproto 5.0-2
flac 1.3.0-1
flashplugin 11.2.202.297-1
flex 2.5.37-1
fontconfig 2.10.95-1
fontsproto 2.1.2-1
freeglut 2.8.1-1
freetype2 2.5.0.1-1
fribidi 0.19.5-1
garcon 0.2.1-1
gawk 4.1.0-1
gcc 4.8.1-3
gcc-libs 4.8.1-3
gconf 3.2.6-2
gcr 3.8.2-1
gdbm 1.10-1
gdk-pixbuf2 2.28.2-1
gettext 0.18.3.1-1
giflib 5.0.4-2
git 1.8.4-1
glib-networking 2.36.2-1
glib2 2.36.4-1
glibc 2.18-3
glu 9.0.0-2
gmp 5.1.2-1
gnome-icon-theme 3.8.3-1
gnome-icon-theme-symbolic 3.8.3-1
gnome-keyring 3.8.2-1
gnupg 2.0.21-1
gnutls 3.2.4-1
gpgme 1.4.3-1
gpm 1.20.7-3
graphite 1:1.2.3-1
grep 2.14-2
grml-zsh-config 0.8.2-1
groff 1.22.2-5
grub 2.00.5086-1
gsettings-desktop-schemas 3.8.2-1
gsm 1.0.13-7
gstreamer0.10 0.10.36-2
gstreamer0.10-bad 0.10.23-4
gstreamer0.10-bad-plugins 0.10.23-4
gstreamer0.10-base 0.10.36-1
gstreamer0.10-base-plugins 0.10.36-1
gstreamer0.10-ffmpeg 0.10.13-1
gstreamer0.10-good 0.10.31-3
gtk-engines 2.21.0-1
gtk-update-icon-cache 2.24.20-1
gtk2 2.24.20-1
gtk2-xfce-engine 3.0.1-1
gtk3 3.8.4-1
gtk3-xfce-engine 3.0.1-1
gtkspell 2.0.16-2
gzip 1.6-1
harfbuzz 0.9.19-1
harfbuzz-icu 0.9.19-1
heirloom-mailx 12.5-3
hicolor-icon-theme 0.12-2
hspell 1.2-1
hunspell 1.3.2-2
hwids 20130607-1
hyphen 2.8.6-1
iana-etc 2.30-3
icon-naming-utils 0.8.90-2
icu 51.2-1
inetutils 1.9.1-6
inputproto 2.3-1
intel-dri 9.2.0-1
iproute2 3.10.0-1
iptables 1.4.19.1-1
iputils 20121221-3
isl 0.12.1-1
iso-codes 3.44-1
jasper 1.900.1-8
jdk7-openjdk 7.u40_2.4.1-3
jfsutils 1.1.15-4
jre7-openjdk 7.u40_2.4.1-3
jre7-openjdk-headless 7.u40_2.4.1-3
js 17.0.0-1
json-c 0.11-1
kbd 2.0.0-1
kbproto 1.0.6-1
keyutils 1.5.5-5
kmod 15-1
krb5 1.11.3-1
ladspa 1.13-4
lcms2 2.5-1
ldns 1.6.16-1
less 458-1
lib32-gcc-libs 4.8.1-3
lib32-glibc 2.18-3
lib32-libstdc++5 3.3.6-6
lib32-ncurses 5.9-2
lib32-zlib 1.2.8-1
libarchive 3.1.2-2
libass 0.10.1-1
libassuan 2.1.1-1
libasyncns 0.8-4
libatasmart 0.19-2
libcap 2.22-5
libcap-ng 0.7.3-1
libcdaudio 0.99.12-6
libcroco 0.6.8-1
libcups 1.6.3-1
libdaemon 0.14-2
libdatrie 0.2.6-1
libdc1394 2.2.1-1
libdca 0.0.5-3
libdrm 2.4.46-2
libdv 1.0.0-4
libdvdnav 4.2.0-2
libdvdread 4.2.0-1
libedit 20130601_3.1-1
libevent 2.0.21-2
libexif 0.6.21-1
libffi 3.0.13-3
libfontenc 1.1.2-1
libgcrypt 1.5.3-1
libglade 2.6.4-3
libgme 0.6.0-2
libgpg-error 1.12-1
libgssglue 0.4-1
libgusb 0.1.6-1
libice 1.0.8-1
libidn 1.26-1
libimobiledevice 1.1.5-1
libjpeg-turbo 1.3.0-2
libksba 1.3.0-1
libldap 2.4.35-4
liblrdf 0.5.0-1
libltdl 2.4.2-10
libmbim 1.4.0-1
libmms 0.6.2-1
libmng 2.0.2-2
libmodplug 0.8.8.4-1
libmp4v2 2.0.0-2
libmpc 1.0.1-1
libmpcdec 1.2.6-3
libnice 0.1.4-1
libnl 3.2.22-1
libnotify 0.7.5-1
libofa 0.9.3-4
libogg 1.3.1-1
libpcap 1.4.0-1
libpciaccess 0.13.2-1
libpipeline 1.2.4-1
libplist 1.10-1
libpng 1.6.3-1
libproxy 0.4.11-2
libpulse 4.0-2
libpurple 2.10.7-4
libqmi 1.4.0-2
libraw1394 2.1.0-1
libreoffice-af 4.1.1-1
libreoffice-base 4.1.1-2
libreoffice-calc 4.1.1-2
libreoffice-common 4.1.1-2
libreoffice-draw 4.1.1-2
libreoffice-gnome 4.1.1-2
libreoffice-impress 4.1.1-2
libreoffice-math 4.1.1-2
libreoffice-postgresql-connector 4.1.1-2
libreoffice-sdk 4.1.1-2
libreoffice-sdk-doc 4.1.1-2
libreoffice-writer 4.1.1-2
librsvg 1:2.37.0-1
libsamplerate 0.1.8-2
libsasl 2.1.26-4
libsecret 0.15-2
libsm 1.2.1-1
libsndfile 1.0.25-2
libsoup 2.42.2-1
libssh2 1.4.3-1
libtasn1 3.3-1
libthai 0.1.19-1
libtheora 1.1.1-3
libtiff 4.0.3-3
libtirpc 0.2.3-1
libtool 2.4.2-10
libunique 1.1.6-5
libusbx 1.0.16-2
libvdpau 0.7-1
libvisual 0.4.0-4
libvorbis 1.3.3-1
libvpx 1.2.0-1
libwebp 0.3.1-3
libwnck 2.30.7-1
libwpd 0.9.9-1
libwps 0.2.9-1
libx11 1.6.1-1
libxau 1.0.8-1
libxcb 1.9.1-2
libxcomposite 0.4.4-1
libxcursor 1.1.14-1
libxdamage 1.1.4-1
libxdmcp 1.1.1-1
libxext 1.3.2-1
libxfce4ui 4.10.0-1
libxfce4util 4.10.1-2
libxfixes 5.0.1-1
libxfont 1.4.6-1
libxft 2.3.1-1
libxi 1.7.2-1
libxinerama 1.1.3-1
libxkbcommon 0.3.1-1
libxkbfile 1.0.8-1
libxklavier 5.3-1
libxml2 2.9.1-2
libxmu 1.1.1-1
libxpm 3.5.10-1
libxrandr 1.4.1-1
libxrender 0.9.8-1
libxres 1.0.7-1
libxslt 1.1.28-1
libxss 1.2.2-1
libxt 1.1.4-1
libxtst 1.2.2-1
libxv 1.0.9-1
libxvmc 1.0.8-1
libxxf86vm 1.1.3-1
libzeitgeist 0.3.18-3
licenses 20130203-1
linux 3.10.10-1
linux-api-headers 3.10.6-1
linux-firmware 20130725-1
llvm-libs 3.3-1
logrotate 3.8.6-1
lpsolve 5.5.2.0-2
lsb-release 1.4-13
lsof 4.87-2
lvm2 2.02.100-1
lzo2 2.06-1
m4 1.4.16-3
make 3.82-6
man-db 2.6.5-1
man-pages 3.53-1
mcpp 2.7.2-4
mdadm 3.2.6-4
mesa 9.2.0-1
mesa-libgl 9.2.0-1
mime-types 9-1
mjpegtools 2.0.0-3
mkinitcpio 0.15.0-1
mkinitcpio-busybox 1.21.1-2
modemmanager 1.0.0-1
mozilla-common 1.4-3
mpfr 3.1.2-1
mtdev 1.1.3-1
mumble 1.2.4-2
musicbrainz 2.1.5-5
nano 2.2.6-2
ncurses 5.9-5
neon 0.29.6-4
net-tools 1.60.20130531git-1
netctl 1.3-1
nettle 2.7.1-1
networkmanager 0.9.8.2-1
nspr 4.10-2
nss 3.15.1-1
openjpeg 1.5.1-1
openresolv 3.5.6-1
openssh 6.2p2-1
openssl 1.0.1.e-3
opus 1.0.3-1
orc 0.4.17-1
p11-kit 0.18.4-1
package-query 1.2-2
pacman 4.1.2-1
pacman-mirrorlist 20130830-1
pam 1.1.6-4
pambase 20130113-1
pango 1.34.1-1
parted 3.1-2
patch 2.7.1-2
pciutils 3.2.0-3
pcmciautils 018-7
pcre 8.33-1
perl 5.18.1-1
perl-error 0.17021-1
perl-xml-parser 2.41-4
perl-xml-simple 2.20-1
pidgin 2.10.7-4
pinentry 0.8.3-1
pixman 0.30.2-1
pkg-config 0.28-1
pm-quirks 0.20100619-3
pm-utils 1.4.1-6
polkit 0.111-1
poppler 0.24.1-1
popt 1.16-6
postgresql-libs 9.2.4-2
ppp 2.4.5-8
procps-ng 3.3.8-2
protobuf 2.5.0-3
psmisc 22.20-1
pth 2.0.7-4
pygobject2-devel 2.28.6-9
pygtk 2.24.0-3
python 3.3.2-1
python-xdg 0.25-1
python2 2.7.5-1
python2-cairo 1.10.0-1
python2-gobject2 2.28.6-9
qt4 4.8.5-2
randrproto 1.4.0-1
raptor 2.0.9-2
rasqal 1:0.9.30-1
readline 6.2.004-1
recode 3.6-7
recordproto 1.14.2-1
redland 1:1.0.16-2
reiserfsprogs 3.6.24-1
renderproto 0.11.1-2
rsync 3.0.9-6
rtmpdump 20121230-2
run-parts 4.4-1
schroedinger 1.0.11-1
scrnsaverproto 1.2.2-1
sdl 1.2.15-3
seahorse 3.8.2-1
sed 4.2.2-3
serf 1.3.0-1
sg3_utils 1.36-1
shadow 4.1.5.1-6
shared-color-profiles 0.1.5-1
shared-mime-info 1.1-1
slim 1.3.5-3
snappy 1.1.0-1
soundtouch 1.7.1-1
speech-dispatcher 0.8-1
speex 1.2rc1-3
sqlite 3.8.0.1-1
startup-notification 0.12-3
strace 4.8-1
subversion 1.8.1-2
sudo 1.8.7-1
sysfsutils 2.1.0-8
systemd 204-3
systemd-sysvcompat 204-3
sysvinit-tools 2.88-11
tar 1.26-4
texinfo 5.1-1
thunar 1.6.3-1
thunar-volman 0.8.0-1
thunderbird 17.0.8-1
tmux 1.8-1
ttf-bitstream-vera 1.10-9
tumbler 0.1.29-1
tzdata 2013d-1
udisks 1.0.4-8
unixodbc 2.3.1-1
upower 0.9.20-2
usbmuxd 1.0.8-2
usbutils 007-1
util-linux 2.23.2-1
vi 1:050325-3
videoproto 2.3.2-1
vim 7.4.0-2
vim-runtime 7.4.0-2
vte 0.28.2-3
vte-common 0.34.7-1
wayland 1.2.1-1
wget 1.14-2
which 2.20-6
wildmidi 0.2.3.5-2
wpa_supplicant 2.0-4
xcb-proto 1.8-2
xcb-util 0.3.9-1
xdg-utils 1.1.0.git20130520-1
xextproto 7.2.1-1
xf86-input-evdev 2.8.1-1
xf86-input-synaptics 1.7.1-1
xf86-video-intel 2.21.15-1
xf86-video-vesa 2.3.2-3
xf86vidmodeproto 2.3.1-2
xfce4-appfinder 4.10.1-1
xfce4-mixer 4.10.0-2
xfce4-panel 4.10.1-1
xfce4-power-manager 1.2.0-4
xfce4-session 4.10.1-2
xfce4-settings 4.10.1-1
xfce4-terminal 0.6.2-1
xfconf 4.10.0-3
xfdesktop 4.10.2-1
xfsprogs 3.1.11-1
xfwm4 4.10.1-1
xfwm4-themes 4.10.0-1
xineramaproto 1.2.1-2
xkeyboard-config 2.9-2
xorg-bdftopcf 1.0.4-1
xorg-font-util 1.3.0-1
xorg-font-utils 7.6-3
xorg-fonts-alias 1.0.3-1
xorg-fonts-encodings 1.0.4-3
xorg-fonts-misc 1.0.1-2
xorg-iceauth 1.0.6-1
xorg-mkfontdir 1.0.7-1
xorg-mkfontscale 1.1.1-1
xorg-server 1.14.2-2
xorg-server-common 1.14.2-2
xorg-setxkbmap 1.3.0-1
xorg-xauth 1.0.7-1
xorg-xinit 1.3.2-3
xorg-xinput 1.6.0-1
xorg-xkbcomp 1.2.4-1
xorg-xrandr 1.4.1-1
xorg-xrdb 1.0.9-2
xorg-xset 1.2.3-1
xproto 7.0.24-1
xvidcore 1.3.2-1
xz 5.0.5-1
yajl 2.0.4-1
yaourt 1.3-1
zip 3.0-3
zlib 1.2.8-1
zsh 5.0.2-3
my svn configs looks like this:
~/.subversion/config:
cat ~/.subversion/config | grep -v "^#"
[auth]
store-passwords = yes
store-auth-creds = yes
password-stores = gnome-keyring
~/.subversion/servers
cat ~/.subversion/servers | grep -v "^#"
[global]
store-passwords = yes
store-plaintext-passwords = ask
I also played with store-plaintext-passwords = no|yes while not having a proper result! According to several Threads it should work with this configuration. Has Anyone an idea what I#m doing wrong or can try next?
|
The gnome-keyring-daemon must be running for Subversion to store passwords in it. When the daemon starts, it emits two variables that need to be exported into your environment. So if it's already running, it might be easier to kill it and start over.
Start it up like this:
export $(nohup gnome-keyring-daemon 2>/dev/null)
The output that gets sent to export looks something like this:
GNOME_KEYRING_SOCKET=/tmp/keyring-OpuUEI/socket
GNOME_KEYRING_PID=9256
Now when you execute a Subversion subcommand that requires it to contact the server, the client will prompt for your Subversion password first, then your Gnome keyring password. The keyring should stay unlocked for at least the duration of your login session (and maybe longer).
There are also some pointers on the ArchWiki that may be Arch-specific, so take a look there if my suggestions don't work.
| Subversion (svn) doesn't store passwords in gnome-keyring |
1,422,481,728,000 |
Do all Linux distributions use the same cryptographic hash function?
If yes, is it provided with the kernel itself?
EDIT:- I refer to the function mainly used for storing user login passwords.
|
No & no to your questions.
I'd take a look at the crypt(3) function for more info. From man crypt(3):
GNU EXTENSION
The glibc2 version of this function has the following additional features. If salt is a character string starting with the three characters $1$ followed by at most eight characters, and optionally terminated by $, then instead of using the DES machine, the glibc crypt function uses an MD5-based algorithm, and outputs up to 34 bytes, namely $1$&‹string›$, where ‹string› stands for the up to 8 characters following $1$ in the salt, followed by 22 bytes chosen from the set [a–zA–Z0–9./].
The entire key is significant here (instead of only the first 8 bytes).
You can check your pam setup to see whether you're using MD5 or DES:
$ egrep "password.*pam_unix.so" /etc/pam.d/system-auth
password sufficient pam_unix.so md5 shadow nis nullok try_first_pass use_authtok
And you can see in this systems /etc/shadow file that it's using MD5 as well:
root:$1$<DELETED PASSWORD HASH>:14245:0:99999:7:::
The codes you'll see in the /etc/shadow for each type of hashing:
$1 – MD5
$2 – blowfish
$2a – eksblowfish
$5 – SHA-256
$6 – SHA-512
On Red Hat distros you can change this using the authconfig command.
$ sudo authconfig --passalgo=sha512 --update
References
How to create SHA512 password hashes on command line
| Do all Linux distributions use the same cryptographic hash function? |
1,422,481,728,000 |
What is the default root password for raspbian jessie or debian 9?
I have Raspbian Jessie stretch iso "Raspberry Pi Desktop" or pixel Virtualbox and I need to install keys with root "su", what is the default password since raspberry nor pi aren't working.
|
From the offical documentation:
Linux users
User management in Raspbian is done on the command line. The default user is pi, and the password is raspberry.
Root user/sudo
You won't normally log into the computer as root, but you can use the sudo command to provide access as the superuser. If you log into your Raspberry Pi as the pi user, then you're logging in as a normal user. You can run commands as the root user by using the sudo command before the program you want to run.
You can also run a superuser shell by using sudo su. When running commands as a superuser there's nothing to protect against mistakes that could damage the system. It's recommended that you only run commands as the superuser when required, and to exit a superuser shell when it's no longer needed.
| What is the root password for raspbian jessie or debian 9 |
1,422,481,728,000 |
How can I run a script to log into a remote server and execute a remote ssh command without entering in my passphrase?
For example:
When I log onto a remote server and execute the git pull command I see ssh prompt me for my passphrase:
$ git pull origin master
Enter passphrase for /home/v3ed2/.ssh/id_rsa:
Once I enter my passphrase I continue with the command.
I want to run a script that will log into the remote server and run the command for me. I already tried this script:
ssh ve "cd clients/ ; git pull"
However, when the script runs, it does not prompt me for my passphrase. The script just hangs while it waits for my passphrase, but when I try to enter a passphrase, I get the error:
bash: line 1: [REDACTED]: command not found
|
When you run ssh with no command, it sets up a pseudo-terminal on the server side and runs an interactive shell in that terminal. When you pass a command, the command is executed with its input and output directly connected to the SSH channel, there is no remote terminal. If you pass the -t option, then a terminal is created on the remote side, and you will get a password prompt where you can type your password.
ssh -t ve "cd clients/ ; git pull"
However, this is not a convenient way to do it. The convenient way is to run an SSH agent on your local machine, and forward that agent's connection.
First, you need to use public key authentication, not password authentication, on the second connection (to the git server). You're already doing this so I won't go into more detail.
Copy the private key for the second server (/home/v3ed2/.ssh/id_rsa on the intermediate machine) to your local machine. Alternatively, on the git server, authorize a public key for which you have the private key on your local machine. Alternatively, first run ssh -t ve ssh-add .ssh/id_rsa to register the intermediate machine's key with your local agent.
Some distributions and desktop environments already set up an SSH agent. Check if you have one running with ssh-add -l. If this tells you you have no agent running, you'll need to start one with your session. Either run ssh-agent your-session-manager instead of calling your-session-manager directly, or run eval $(ssh-agent) in your session startup script, or tick the “run SSH agent” checkbox in your GUI configuration. You need to do two things: start the ssh-agent program, and get the SSH_AUTH_SOCK variable that it sets or prints into your session's environment. The details of how to do this are very specific to your distribution and desktop environment.
Once you have the SSH agent running locally, make sure that it is forwarded. It may or may not be forwarded by default. Run ssh ev ssh-add -l to check whether the agent is forwarded. If it isn't, add the line ForwardAgent yes to your local ~/.ssh/config.
If you're running Windows with PuTTY locally, it comes with a key agent too, Pageant. See the PuTTY manual for instructions.
When you have a working SSH agent setup, register your key(s) with the agent once per session, with the command ssh-add ~/.ssh/id_rsa (or whatever the path to the private key is). After this, you can use the key with no prompting for the remainder of the session.
| Remote shell script Enter passphrase for |
1,422,481,728,000 |
I am asking, because I generated a live CD using the hash from an existing /etc/shadow, assuming I will then be able to login with the corresponding password, but apparently login fails.
|
It's possible if
the target system uses shadow passwords, and
/etc/shadow is not overridden by other mechanisms (via PAM, nss, etc.), and
the target system doesn't hash /etc/shadow, and
the target system has the same usernames as the source system, and
the UIDs on the target system are the same as the UIDs on the source system, and
the encryption methods used by the passwords need to be supported on the target system, and
/etc/passwd on the target system must be in sync with the injected /etc/shadow.
I hope I didn't forget anything. :)
The easier (and safer) way to do it is to use vipw to save credentials for the relevant users on the source system, then copy them on the target system
| When I copy /etc/shadow to another system, is it possible to login with the according passwords? |
1,422,481,728,000 |
Is it possible to define a rule in sudoers to allow one user to run one well defined command as root, without password or other authentication except being the right user?
Are there alternatives to solve this (or something very similar)?
Use suid permission bit?
Maybe make use of ssh keys somehow?
|
The sudoers file allows specifying commands to permit:
username ALL=(root) NOPASSWD: /bin/foo bar baz
Here username is the user you want to permit, and the command goes at the end of the line. If you specify arguments to the command, the user can only run it with exactly those arguments, but if you don't specify them here, the user can run the command with any arguments they choose. You can specify multiple commands separated by commas, or just as separate lines.
Edit the sudoers file with visudo (as root) and add a line in that format, with the appropriate details changed, and the user will be allowed to run exactly the command you specify with elevated privileges.
NOPASSWD: allows the user to run the command without prompting. The ALL is a host restriction, which you can probably ignore (you'll know if you can't). (root) means they can only run the command as the root user.
Since you ask, it is strictly possible to do this with ssh too, although sudo is better. You can put COMMAND=something at the start of a line in /root/.ssh/authorized_keys and give the user a special-purpose SSH key corresponding to that command. The only possible reasons that would be better than sudo are if you didn't want the user to have any other access to the machine, or if you didn't want them to have to write the command out themselves.
| No password to run command as root for fixed command? [duplicate] |
1,353,055,005,000 |
The following should be done in a bash script:
curl --digest --user schmijos https://bitbucket.org/u/p/get/tip.zip -o tip.zip
How can I automatically submit a password to curl when it asks for it? Since I don't want to see the password in any logfile, I won't do the following:
curl --digest --user schmijos:$password https://bitbucket.org/u/p/get/tip.zip -o tip.zip
|
Use empty:
With the password safely stored (it's a way of saying...)
$ echo password > pwd-file
Start process with empty. (You would omit -L log in the real case.)
$ empty -f -i fifo1 -o fifo2 -L log curl -u user http://example.com
Send the contents of pwd-file to empty's input pipe, which the process sees as both its stdin and /dev/tty.
$ empty -s -c -o fifo1 < pwd-file
This is what happened in the pseudo terminal:
$ cat log
<<<Enter host password for user 'user':>>>password
<<<
| Pipe Password to Application When Asked |
1,353,055,005,000 |
I have set up sudo on my FreeBSD server. As I now never want to log in as root anymore, I was wondering whether I should do sudo pw lock root.
My questions are:
Is this possible, without forever disabling my machine?
Is it a smart idea, or is there a good reason to not do this?
Will I still be able to do sudo su to get a root shell?
|
I actually did this on my FreeBSD box - so yes, it is possible, but of course you should take care to verify that sudo works properly before you do so ;-)
sudo su will not work anymore, but you can still do sudo bash to get a root shell.
| Is it possible (and a good idea) to do `pw lock root` on FreeBSD? |
1,353,055,005,000 |
When trying to run a backup with Vorta on Debian 10/KDE I'm prompted to enter my password "Enter password to unlock your login keyring" but after entering my current password it displays:
The login keyring did not get unlocked when you logged into your computer.
After looking it up it seems like this is happening because I changed my sudo password.
-> Why does changing the password not update any other relevant files so that this prompt accepts the current password (why does this error still occur at all)? And what's the simplest, most recommended way to solve it on Debian/KDE?
I don't have a .gnome2/keyrings directory.
|
The solution was:
Install seahorse sudo apt-get install seahorse && seahorse
On the left under Passwords right click on "Login" or a password you'd like to use for Vorta and select "Set as default".
Verify that the password is the password you'd like to use (and not e.g. a former user password) by selecting "Lock" and then "Unlock" which prompts you for the password.
Further steps for making Vorta work here.
(Removing (or moving to have a backup) files under ~/.local/share/keyrings/ only solved this until the next restart. In the case of Vorta I could then create a new backup repository without getting this error but not after a restart.)
| How to solve "The login keyring did not get unlocked when you logged into your computer" after changing password on Debian/KDE? |
1,353,055,005,000 |
I need to log ssh passwords attempts. I read somewhere you could get this done by patching openssh but I don't know if that is the correct way to get this done.
I am using Arch.
EDIT:
I want to get the passwords people tried to guess to gain access to my system.
It could be with journalctl or get piled in a text file.
If the person let's say types 1234 and tries to get access I want something like
"ssh loggin attempt failed, tried user "admin" with password "1234"
|
What I think is a better answer is to download the LongTail SSH honeypot which is a hacked version of openssh to log username, password, source IP and port, and Client software and version.
The install script is at https://github.com/wedaa/LongTail-Log-Analysis/blob/master/install_openssh.sh
I also do analytics at http://longtail.it.marist.edu
| How can I Log ssh login passwords attempts? |
1,353,055,005,000 |
I am writing a build script. This script has to copy a file in the end. This file will be placed in another users home directory and it is also necessary that the file belongs to this second user. My first attempt was to use su like this:
su fbgs -c "cp fbgs.jar /home/fbgs/server/plugins/"
This works in the command line but when I put this in the script I need the password to be entered automatically. So I tried the following command:
echo Password | su -S fbgs -c "cp fbgs.jar /home/fbgs/server/plugins/"
But then I get this output:
su: must be run from a terminal
How do I get this to work?
|
Consider setting up sudo for this particular process and perhaps set the specific command NOPASSWD: so that you do not have to echo a cleartext password (very bad in any event). Also, there are sudo flags that can allow you to either require or not require a TTY.
Example.
/etc/sudoers.d/mycmd:
theuser ALL=(fgbs) NOPASSWD: cp fbgs.jar /home/fbgs/server/plugins
my-build-script.sh:
#!/bin/sh
/usr/bin/sudo -H -u fbgs cp fbgs.jar /home/fbgs/server/plugins
| Unable to pass the password to su in a script |
1,353,055,005,000 |
Why is there a gap between the expiration of an account and its complete deactivation, when one can no longer log in or change his password when it became expired?
|
As explained in the venerable old Shadow Password HOWTO, between password expiration and the account's deactivation, the user can log in with the old password but must change it immediately. Or at least, that's the intention of the fields in the Linux "shadow password" system; specific implementations may not follow that strictly.
| Why do we need an expiration period? |
1,353,055,005,000 |
I've updated login.defs and password-auth to include a minimum length on passwords (12), but the minlen is not being enforced when I attempt to change a user's password with passwd.
None of the password case policies are being enforced. I can enter 'aaaa1234' as a valid but weak and too short password. I am also able to enter dictionary words, such as 'password'. The same password can be reused.
In summary, none of the settings in /etc/pam.d/password-auth appear to be recognized.
The password I'm entering for the following command is blue1234
# passwd testy
Changing password for user testy.
New password:
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
Here's what was logged in /var/log/secure from the operation above. This is the only line for the event.
Apr 1 11:41:37 myserver passwd: pam_unix(passwd:chauthtok): password changed for testy
config files
# login.defs
# Password aging controls:
#
# PASS_MAX_DAYS Maximum number of days a password may be used.
# PASS_MIN_DAYS Minimum number of days allowed between password changes.
# PASS_MIN_LEN 12
# PASS_WARN_AGE Number of days warning given before a password expires.
#
PASS_MAX_DAYS 30
PASS_MIN_DAYS 1
PASS_MIN_LEN 12
PASS_WARN_AGE 14
.
# /etc/pam.d/password-auth
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth sufficient pam_unix.so nullok try_first_pass
auth requisite pam_succeed_if.so uid >= 500 quiet
auth required pam_deny.so
auth [default=die] pam_faillock.so authfail deny=3 unlock_time=604800 fail_interval=900
auth required pam_faillock.so authsucc deny=3 unlock_time=604800 fail_interval=900
account required pam_unix.so
account sufficient pam_localuser.so
account sufficient pam_succeed_if.so uid < 500 quiet
account required pam_permit.so
password requisite pam_cracklib.so try_first_pass retry=3 lcredit=-1 ucredit=-1 dcredit=-1 ocredit=-1 minlen=12
password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
password required pam_deny.so
session optional pam_keyinit.so revoke
session required pam_limits.so
session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session required pam_unix.so
Why is the pam password policy not being enforced?
PS: This is a minimal installation.
|
You have to check your /etc/pam.d/passwd file if it includes /etc/pam.d/password-auth or /etc/pam.d/system-auth and to make required changed in file which is included.
In short:
An application that uses PAM can have a configuration file bearing its name in /etc/pam.d/. If a file exists, the rules in that file are processed whenever the application calls a PAM authentication function.
Files like /etc/pam.d/system-auth and to a larger extent /etc/pam.d/password-auth are somewhat distribution-specific. Since no applications identify themselves as "system-auth" or "password-auth", these files are actually never called on their own. Instead, the contents of these files are pulled into other PAM configuration files with the "include" directive. That way, common settings for multiple applications can be stored in a single file.
| Policy in /etc/pam.d/password-auth is not being enforced |
1,353,055,005,000 |
Logging onto a machine over ssh typically requires a password to be entered before access is granted. Alternatively, a key/certificate (without a passphrase) can be installed onto the remote machine so that logging on no longer requires a password. This is particularly useful for automated or scripted solutions.
However, it is considered inadvisable and unsafe to create a key/certificate without a passphrase. Solutions involving ssh-add and ssh-agent are proposed as a means to enter a passphrase only once per session, but to still use a key/certificate with a passphrase.
What is the solution for automated connections between machines? How can a machine automatically update from a remote Bazaar repository (via bzr+ssh?) on a regular basis, as in a cron job? How can a machine automatically backup data from another machine (via rsync) as part of a cron job? rsyncd? This would not be encrypted though, which is a major disadvantage. I haven't looked at Bazaar daemon/server options.
|
For automated logins you have to use keyless ssh keys as you would have to manually intervene at the startup and provide a pass-phrase and have to resupply it after an restart.
To secure such keys there are multiple solutions - see man sshd for more details:
Restrict the remote host for the key with the from= parameter, e.g:
from="*.example.com" ssh_key
this will only allow machines from example.com
Specify which command will be executed with the command= parameter, e.g:
command="some command" ssh_key
Use a dedicated user with an restricted shell or only with the necessary permissions, e.g. for backup the user can only run rsync with sudo.
| Automated ssh login with passphrase? |
1,353,055,005,000 |
On the local server, I have a program that stores the password in the predefined environment variable (SPECIAL_PASSWORD).
On the remote server I have a program that reads and uses a password from a predefined environment variable (SPECIAL_PASSWORD).
I want to execute the program on the remote server and supply the password already set in my local environment.
My attempt looks as follows:
local_command # produces the SPECIAL_PASSWORD Env Var
ssh -l remote_user remote_server <<EOSSH
export SPECIAL_PASSWORD=${SPECIAL_PASSWORD} # Transfer Env Var
remote_command # consumes SPECIAL_PASSWORD Env Var
EOSSH
It also seems to work as intended:
Unix ps does not seem to reveal the password
access to the password is only available to the current processes or their child processes.
But is it truly safe to do so ... is at any point the password readable? Is there a better alternative?
I could potentially change the sshd_config (AcceptEnv) and ssh_config (SendEnv) to allow to transmit a subset of environment variables without above trick. However the systems are tightly controlled, and sshd_config requires admin intervention. In my case, it doesn't seem a possibility to change the sshd_config.
UPDATE
I am using a different solution offered by piping data into the remote ssh command be ran. Note that this syntax does not work anymore in combination with HERE documents.
sendEnv() {
echo "var1=${var1}"
echo "var2=${var2}"
...
}
sendEnv | ssh -l remote_user remote_server "receiving_command".
In my case the receiving_command is a java program that reads the environment variables from System.in.
It works like a charm.
|
It's readable by remote_user and root. None other, unless remote_command is writing it to a globally readable file or something like that.
You can inspect the environment of a process in the /proc filesystem in /proc/$pid/environ. You either need to be the same user as the euid of $pid or you need to be root, as the permissions of that file seem to default to -r-- --- ---.
Apart from using the environment, you could also pass the password via stdin by piping into ssh. If you pipe into ssh, only root and the target program (and it's children) will be able to get to it as far as I know (assuming $(cat /proc/sys/kernel/yama/ptrace_scope) == 1 ).
| How to safely transmit a password over SSH for a remote command to use |
1,353,055,005,000 |
I would like to have different passwords for my account(s): When (e.g.) a certain USB stick is plugged in then an easy password is to be used. The idea is: If I leave my computer then I take the stick with me and the easy passwords shall be disabled then.
My general idea is:
Detect the stick with udev, maybe detect certain data on it (with a script run by udev) and react accordingly (e.g. create a file which is deleted when the stick is plugged out). This should be easy.
Have PAM check for the existence of this file and select the password database accordingly.
The main question is probably (i.e. if I understand the structure of the problem correctly): Can pam_unix2 be configured to use another shadow file? I just had a look at the man page for pam_unix2 and it seems that this is not possible because this module lets glibc NSS make this decision.
|
Both pam_unix and pam_unix2 use libc to look up the password hash, and Glibc has the locations /etc/nsswitch.conf and /etc/shadow hard-coded. It wouldn't even be as simple as recompiling pam_unix or pam_unix2: both go through the normal NSS mechanism to verify passwords, they only use their knowledge of /etc/passwd, /etc/shadow and NIS for password changes.
However, you can use the pam_pwdfile module. I've never used it, but the description looks like exactly what you're after.
This PAM module lets you use an arbitrarily-named text file similar in
structure to /etc/passwd to authenticate users.
Alternatively, you could use the pam_userdb, which checks a password in a database in Berkeley DB format with a file name passed as an argument.
Now, to detect the presence of the USB stick, you need another PAM module. pam_listfile looks right for the job. Arrange an udev rule that mounts your USB key, and only that USB key, in a particular location, say /media/authentication-key; create a file users.txt containing the list of user names that are allowed to use a shorter password. If you want a more complex test in the PAM stack, you can use `pam_exec.
Here's a stack that assumes that /etc/shadow contains your strong passwords and /etc/passwd.weak contains your weak passwords. Warning: untested, and I'm not fluent in PAM, so review it carefully.
auth [success=ignore default=1] pam_listfile.so file=/media/authentication-key/users.txt iter=user sense=allow onerr=fail
auth [success=1 default=bad] pam_unix.so
auth [success=ok default=bad] pam_pwdfile.so pwdfile=/etc/passwd.weak
auth requisite pam_deny.so
| different passwords depending on plugged-in devices |
1,353,055,005,000 |
Is it safe to have the same passphrase for the main (and only, in my case) ssh key as the user login-password to the computer I use on daily basis? Assuming I am the only user of that computer. What are the potential security risks?
|
Generally speaking, reusing passwords is a bad idea unless you're using the same password in the same realm, i.e. among machines or services that are administered by the same group, and where people who have access to one of the machines/services generally have access to all of them.
The password on your account on machine A is used on machine A and controls access to machine A. The password on your SSH private key on machine A is used on machine A and controls access to other machines. If you use the same password on both and it is leaked, this compromises both machine A and other machines. Therefore sharing the password is a bad for security.
The password on your account on machine A is used on machine A and controls access to machine A. The password on your SSH private key on machine B is used on machine B and controls access to machine A. If you use the same password on both, then it can be leaked from either A or B. Therefore sharing the password is bad for security.
The password may also leak through backups. For example, if a backup of your home directory is compromised (or you accidentally upload your private key file to Github — you wouldn't be the first¹), the attacker has access to the key file. The OpenSSH private key file format is vulnerable to brute force attacks on the password. Since OpenSSH 6.5, there is a new format (selected with ssh-keygen -o which properly uses a slow hash, but it isn't used by default as of OpenSSH 7.7. So if an attacker gains access to your key file, there's a serious risk that they'll get the password, which lets them use the key and lets them log in without the key. Even with a slow hash, if your password is too weak, an attacker who has the key file may be able to crack it offline (i.e. limited only by how much electricity they're willing to spend).
For these reasons, you should not use the same password for an SSH key and for a user account. If you want to protect the key file but you don't want to remember a separate password, it would be better to use a non-memorable password and store it in your keyring (the Gnome keyring does use a slow hash).²
¹ I think Github now protects against directly uploading the key file.
² And do remember not to leak backups of your keyring, but that's less of a problem than with SSH in practice because people tend to back up their .ssh directory which contains configuration files such as config and authorized_keys.
| Is it safe to have the same ssh-passphrase as the user login-password? |
1,353,055,005,000 |
Whenever a Windows application wants to do something requiring administrator privileges, my screen goes black and a prompt comes up, asking if I want to grant administrator privileges. I understand this security model: it relies on the user having control over the keyboard and mouse. Privileges go to whoever has control of input. If an application gains control of input while the security prompt is up, then it gains control of administrator privileges, even if it doesn't know my password.
In contrast, on Linux, the sudo command is the equivalent. When an application requests privileges, it prompts me to enter in my password. Thus, stealing input is insufficient to gain full privileges; an application must steal my password instead. However, I do not understand this model. It seems that this model just makes it easy to steal my credentials, because I am giving out my password constantly. What's stopping a malicious application from putting up a fake prompt and stealing my password, thus gaining privileges forever?
Is a security prompt bound in some way to the application that requests it?
If an application is able to impersonate a security prompt, or raise a security prompt while pretending to be another application, then is it assumed that the application already has full control of the computer and cannot raise its privileges by learning my password?
If I trust an application once, then is it ok for that application to steal my password?
Does Linux (theoretically) prevent non-root keyloggers, or can a non-root keylogger sniff my password even when I'm typing it into a legitimate security prompt?
I do not understand what stops a malicious unprivileged program from wrenching privileges from an administrator account. The security model could simply be that all programs run by an administrator are assumed to have access to root if they wish for it, and that administrators cannot rely on root/non-root being a meaningful barrier. Windows runs under this premise in practice. I can't tell if Linux tries to make any additional guarantees.
|
I read with Wayland there comes the infrastructure to prohibit it, but now it's still a problem.
Just see
xinput test-xi2
The first article I read about the problem:
http://theinvisiblethings.blogspot.de/2011/04/linux-security-circus-on-gui-isolation.html
Further and deeper discussion:
http://lwn.net/Articles/517375/
| security model of Linux password entry |
1,353,055,005,000 |
I'm currently fascinated by strace so, being new to it, I decided to play around a little. As suggested by the question title, I tried both strace su and strace ssh. Both commands displayed the password I typed in the strace output. su kept complaining of an incorrect password while ssh managed to log in normally.
My questions:
Is this a security flaw or am I missing something?
Is su reporting an incorrect password as a security measure because it detected it was being run through strace? If so how can it tell that it's being invoked through strace? Does it check /proc/self/cmdline maybe?
How much damage can be caused by something like
alias su="strace -o /tmp/output.log su"
|
It's not a security flaw; you're able to strace the process because it's your process. You can't just attach strace to any running process. For example:
$ sudo sleep 30 &
[1] 3660
$ strace -p 3660
attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted
su is reporting an incorrect password because it doesn't have sufficient permission to read /etc/shadow anymore. /etc/shadow is where your password hash is stored, and it's set so only root can read it for security reasons. su has the setuid bit set so it will be effectively run as root no matter who runs it, but when you run it through strace that doesn't work, so it ends up running under your account
I'm not sure what you mean by "how much damage could be caused". As you saw, su doesn't work from within strace, so you're going to render it nonfunctional. If you mean "could somebody use this to steal my password", they would need the ability to set aliases in your shell, which they shouldn't have permission to do unless you've made your login files world-writable or something similar. If they did have permission to set aliases, they could just alias su to a patched version that records your password directly; there's nothing special about strace
| Stracing su and ssh shows the password. Is this a security flaw or am I missing something? |
1,353,055,005,000 |
Is there any way to have your disk/partition/file encrypted (in Linux or as a hardware encryption; no Windows here) in such way that it locks itself for say 10 minutes after say 3 failed unlock attempts?...
The idea is to have a somewhat shorter password to remember without sacrificing security.
|
Not the way you describe, so @Damon's answer is correct.
But if you don't mind waiting regardless whether you know the password or not, you can crank up the iteration time of cryptsetup/LUKS to a very large value, even to 10 minutes if you think you need that much. That way the "lockout" would always be in effect, regardless of your attempts.
cryptsetup --iter-time=600000 luks[Format,AddKey,ChangeKey] /dev/thing
However, I don't recommend you actually go that route. It's not very practical.
A good password is more important in any case. If you find passwords hard to remember, maybe you should heed this advice: http://xkcd.com/936/
That's geared to web passwords (where lockout actually works, until an attacker grabs the database). For disk encryption you might want to use more than just four random words.
But in general, a good password does not have to be hard to remember.
| Any disk encryption that locks itself for some time after a number of failed attempts? |
1,353,055,005,000 |
I'm on FreeBsd 11. I have a user "user123" belonging to the group wheel and wheel has %wheel ALL=(ALL) NOPASSWD: ALL in /usr/local/etc/sudoers.
I don't know the password of root. However, I'm able to run "sudo" without one.
I've installed Postgresql and run it via "service start".
Now I want to log in as the postgresql user and create a database or other stuff:
$ su postgres
Password:
# or
$ su - postgres
Password:
But I don't know the password.
Is this the password of the user root or the user postgres? I don't know any of them. Is there a standard workaround for this?
|
If you want to login as postgres, and you have sudo access without password requirements, do:
sudo -iu postgres
The -i starts a login shell.
| "su" when the password is unknown but you're in "wheel" with "no password" |
1,353,055,005,000 |
I have a computer from the 1990s. It has an (extent) EFS file-system which cannot be wrote to in linux, so i cannot reset the password manually. So i have to crack my password. For this I am trying to use John the ripper.
in a file me2, I have an entry from the original /etc/passwd file:
root:8sh9JBUR0VYeQ:0:0:Super-User,,,,,,,:/:/bin/ksh
Some people from another thread suggested this might be a DES password.
So here, I am trying to crack this password, so I can get back into this computer.
sudo john me2
Loaded 1 password hash (descrypt, traditional crypt(3) [DES 128/128 SSE2-16])
Press 'q' or Ctrl-C to abort, almost any other key for status
Warning: MaxLen = 13 is too large for the current hash type, reduced to 8
I see the warning, and I am wondering what that means.
I left John the ripper running for a few hours and came back. It seems like its still going... So I'm thinking something must not be right.
|
Your root password is qwer134.
% /usr/sbin/john --show pwdfile
root:qwer134:0:0:Super-User,,,,,,,:/:/bin/ksh
lp:passwd1:9:9:Print Spooler Owner:/var/spool/lp:/bin/sh
nuucp:NO PASSWORD:10:10:Remote UUCP User:/var/spool/uucppublic:/usr/lib/uucp/uucico
3 password hashes cracked, 0 left
It took john 2.5 days to find the root password and could easily have taken much longer. You can crypt the password to verify the hashes really match:
% perl -le 'print crypt("qwer134", "8s")'
8sh9JBUR0VYeQ
| Trying to crack a weak password using John |
1,353,055,005,000 |
man 5 shadow gives the following description of the third field in each line:
The date of the last password change, expressed as the number of days since Jan 1, 1970.
The value 0 has a special meaning, which is that the user should change her pasword the next time she will log in the system.
An empty field means that password aging features are disabled.
Does this refer to times in UTC or the local timezone? In particular, if I want to calculate comparable numbers using something like $(( $(date +%s) / 86400 )), do I need to pass date the -u option?
|
The "seconds since 1970" timestamp is specifically defined as UTC in most usages. In particular, you may notice that date +%s gives the same result as date -u +%s.
The relevant line where this is set in the shadow password utilities is"
nsp->sp_lstchg = (long) time ((time_t *) 0) / SCALE;
Which would make it UTC.
SCALE is defined as 86400 (except via a specific ifdef that I can't quite trace what circumstances cause to be defined)
| /etc/shadow date of last password change—UTC or local time? |
1,353,055,005,000 |
Had to reset my password on a couple of client servers today, and despite following the rules I get the message "Your password failed to meet: minimum of 2 non-alphabetic characters" back from the AIX server (the Solaris box doesn't give error messages so just keeps prompting for new password)
The passwords I have tried include things like arstdyfu12445!! so I'm definitely including non-alphabetic characters.
|
An update from a colleague, which I have just tested:
12arstdyfu445!! works
It seems that for some legacy reason, the password strength rules need to be adhered to within the first 8 characters of the password.
I will do some hunting around to see if this is applicable to all AIX and Solaris versions, but I hadn't managed to find an answer when googling through the IBM manuals available.
| Why does this password fail AIX and Solaris rules |
1,353,055,005,000 |
Real dumb question, but suppose a computer with Linux does not have an encrypted hard drive. If I generated a hash with "openssl passwd", couldn't I just run a live version of Ubuntu and add my hash to the /etc/shadow file? Or is /etc/shadow encrypted even if the hard drive isn't?
|
What prevents me from just editing the /etc/shadow file in unencrypted systems?
Nothing, there is no specific protection for /etc/shadow. Some systems might have tampering detection, so the system administrator would know that /etc/shadow was changed (unless you also overrode the tampering detection, typically by updating it so it considered your modified /etc/shadow as correct), but nothing stops you from editing files in an unencrypted file system.
Encrypting the drive (or the partition holding /etc/shadow) is sufficient to prevent such attacks, but not to prevent more sophisticated attacks. Full protection against attacks involving physical access is still not quite there, although Secure Boot and TPM measurements do make successful attacks much harder.
| What prevents me from just editing the /etc/shadow file in unencrypted systems? [duplicate] |
1,353,055,005,000 |
I logged in as root and created a new account:
# useradd -d /home/onie -m onie
# su onie
Now I try to set the password for onie myself using the passwd command, but it's asking for my current password when I don't have one!
|
If you don't specify a password when running useradd (-p PASSWORD), it disables the password on that account; the only way to login to it is through some other authentication method (e.g. SSH keys), or by suing from root. Since passwords are disabled, you can't set a new one as a regular user. Root can change anyone's password without needing the current password though, so run:
[root@myhost ~]# passwd onie
| Not able to set password in ArchLinux |
1,353,055,005,000 |
How can I encrypt/hide my - wpa-psk "password" - line in the /etc/network/interfaces file? Since it's uncovered and readable for everyone who can get in the file now.
Or is it better that I use something else if I don't want to store my blank wifi password in a file?
I'm running on debian without desktop environment.
|
The best you can do is hash the password. Set wpa-psk to the output of:
wpa_passphrase <SSID> <KEY>
This will obfuscate the password, but it will not prevent someone else from using the hash to connect with another device.
As an additional measure you should also set /etc/network/interfaces file permission to rw------- (600), chmod og-rw.
| How to encrypt/hide password in /etc/network/interfaces file on debian? |
1,353,055,005,000 |
My username is user1 and password is mypass8@
I wish to pass this username and password to curl command.
How do i escape the @ in the password when passing it to curl command ?
curl -k -X POST https://user1:mypass8@@myshop.com/job/build
I get the error message:
MESSAGE:Invalid password/token for user: user1
I also tried the following but all fail stating the password is not right as the 2 charecter and not considered in the password by the curl command.
curl -k -X POST https://'user1:mypass8@'@myshop.com/job/build
curl -k -X POST https://"user1:mypass8@"@myshop.com/job/build
curl -k -X POST https://user1:"mypass8@"@myshop.com/job/build
curl -k -X POST https://user1:'mypass8@'@myshop.com/job/build
Update: the login I m trying is for Jenkins admin console.
Can you please suggest ?
|
I fixed the issue using a base64 conversion...
echo -n '[USERNAME]:[PASSWORD]' | base64
This will generate a token to pass to curl as a header in this way:
curl -H 'Authorization: Basic [add value obtained from the previous cmd]'
| How to escape '@' in curl command password field |
1,353,055,005,000 |
Updated as original was unclear.
I'm setting up postfix on a computer to work with my email's SMTP.
I don't want to enter my credentials in plain text, especially when typing in public.
Is it possible to make bash not show my input for a command or two?
Example:
I'm entering a series of commands and then I want to echo a username and password into a config file.
I'd like to quickly go into a mode where my input isn't shown on screen, then easily leave that mode with ctl+c.
|
You should use the stty command:
stty -echo
To re-enable echoing of terminal input:
stty echo
| Hide input for a command [duplicate] |
1,353,055,005,000 |
I am currently using
auth required pam_unix.so try_first_pass nullok
auth optional pam_ssh.so use_first_pass
(plus some other, probably irrelevant entries Arch Linux added by default), which means my login password is also used to attempt unlocking any ssh-key stored (or linked to) in ~/.ssh/login-keys.d/ thanks to pam_ssh (I could also use try_first_pass instead in order to get a passphrase prompt should no ssh key be unlocked by my login password).
This works fine so long as the SSH key passphrase is identical to the login one. However, what I would like to achieve is that I can basically login with one of two different passwords - either my login one or the SSH key one.
So I thought that pam_ssh should fist try to unlock my SSH key, and only if that fails should pam_unix be required, otherwise it should be skipped. Can this be achieved somehow?
At first I thought the solution lies in putting pam_ssh first, but additionally it has to be made sufficient instead of optional:
auth sufficient pam_ssh.so try_first_pass
auth required pam_unix.so try_first_pass nullok
However, in the real files there are some other required lines following required pam_unix.so, such as required pam_env.so, which would now be ignored! So how can I really solve this?
|
Thanks to two other SE posts (one on SO, one on SF), the answer lies in using advanced control syntax. The
auth required pam_unix.so try_first_pass nullok
# and sometime later
auth optional pam_ssh.so use_first_pass
should therefore become
auth [success=1 new_authtok_reqd=1 ignore=ignore default=ignore] pam_unix.so try_first_pass nullok
auth required pam_ssh.so use_first_pass
Now it is imperative that the pam_ssh line exactly precedes the pam_unix one, since success=N means to skip N following module(s).
Also, don't forget the session pam_ssh.so line while you're at it!
In my first attempt, I used
auth [success=1 default=ignore] pam_ssh.so try_first_pass
auth required pam_unix.so use_first_pass nullok
instead, but this method locks out all users without SSH keys! Turns out that default=ignore isn't sufficient, auth_err=ignore has to be added since that is apparently not considered part of default. Also, this attempt means there'll either be a "password" or "SSH passphrase" prompt depending on whether the user has an SSH key!
Note that in Arch Linux, the pam_unix line used by login lies in the include chain
login -> system-local-login -> system-login -> system-auth
and that system-login has some other required before including system-auth, so you cannot simply put auth [success=1 default=ignore] pam_ssh.so try_first_pass in before login's auth include system-local-login - you'd skip the wrong required and thanks to the pam_unix.so use_first_pass (instead of try_first_pass) you could still only login with your login password! On the other hand, by modifying system-auth, you're also allowing other services such as sshd to use your SSH key as authentication option to the login password. If you truly want only your login to use this, you have to pretty much break the include chain and manually copy all auths to login.
| How to achieve conditional PAM authentication? |
1,353,055,005,000 |
I'm trying to get the CLI password manager pass to work in my fish shell with auto completion. I've already found the necessary file, yet am having trouble finding out where to put it, or rather getting it to work. So far I've added it to:
~/.config/fish/pass.fish
~/.config/fish/completions/pass.fish
and added the content to my ~/.config/fish/config.fish file.
with no success.
|
The second option listed (~/.config/fish/completions/pass.fish) is the preferred approach. The third should also work.
I tried the following:
Put the file at ~/.config/fish/completions/pass.fish
Type pass followed by a space
Hit tab
And I see completions from that file.
It's possible that fish is looking somewhere else. Try echo $fish_complete_path and verify that it includes ~/.config/fish/completions/ . If it does not, you can put back the defaults by erasing it and starting a new session: set -e fish_complete_path.
| Adding pass completion to fish shell |
1,353,055,005,000 |
Is there a way to store my password in /etc/wpa_supplicant/wpa_supplicant.conf as some hash instead of plaintext?
By "password" I refer here to the password used for phase2 authentification. I do not refer to the Preshared Key (PSK) which could be hashed using wpa_passphrase.
For phase2 MSCHAPv2 or MSCHAP authentification I could store the password as MD4 hash using nt_password_hash (see example wpa_supplicant.conf line 659).
Is there any way to store my PAP password as hash?
Or: Is there a way to store the password in some sort of external storage?
The example wpa_supplicant.conf suggests the use of such an external storage (using ext:????) but I could not find any documentation about it.
I am aware that storing the password as hash does not increase wifi security. But as the password MUST be the same as the password for other services (account management, subscriptions, payments ...) I don't want it to be stored as plaintext.
|
Unfortunately I have to answer the question myself now. "Unfortunately" because the answer is "No, it is not possible".
I took a look at how PAP is working, and came to the conclusion that it is logically impossible to store the password as a hash value.
With PAP, the username and password are sent directly to the authentification side. Therefore, the password must be known, knowing some hash is not sufficient.
Thx @tink for searching nevertheless.
But I still could not find anything about this external storage thing. Solution for me in this special case is using a unencrypted wifi (which is also provided by my university) and a VPN.
| wpa_supplicant store password as hash (WPA-EAP with phase2="auth=PAP") |
1,353,055,005,000 |
Looking at all the ssh-login attempts by script-kiddies I assume that there are messed up systems connected to the internet that have password-less accounts set up.
But how to check a Linux/Unix system for such accounts (perhaps created by a broken installer script, a confused admin or something like this)?
As first approximation I can think of something like:
$ grep '^[^:]\+::' /etc/passwd /etc/shadow
Prints all accounts with an empty password - but perhaps on the concrete system such accounts are not even a problem because no program accepts empty entries - c.f. password(5):
However, some applications which read the
/etc/passwd file may decide not to permit any access at all if the password field is blank.
But what about hashed empty strings as passwords (e.g. crypt(""))?
How to check for them?
And how to check accounts when more sophisticated account databases are in use (NIS, LDAP, ...)?
|
An easy way to find encrypted empty or weak passwords is to use a password cracker like John the Ripper.
If you are using NIS or LDAP you need first to extract the password hashes from the database - one way is via getent, see the answer from maxschlepzig
| How to check for empty passwords? |
1,353,055,005,000 |
The place where I work forces me to use a proxy to get to the Internet. As we know, setting a proxy is nothing but putting a string like export http_proxy=http://account:[email protected]:8080 into a config file such as .bashrc. I tried like this and it worked well.
I'm just thinking if there is another more secure way to do so? In my opinion, writing the password as plaintext into some config file is not secure.
|
Someone getting the password from your terminal is the least of your problems.
The bigger problem is that using the proxy via a non-encrypted protocol over the network, your login and password can be easily sniffed. BASIC HTTP password authentication encoding is too weak and is deencoded on the fly.
An immediate improvement is tunneling the proxy requests over SSH, using autossh to be always logged in the proxy server.
Over time, the requests to the proxy service should be made over TLS if possible.
As for the terminal, I always have a lock icon on it, and when I have to leave my desk I click the lock icon.
Back to protecting the password on your disk:
protect the password in an encrypted file, with OpenSSL for instance.
Write a login script that fills your http_proxy variable at login time asking you for a password. If you are using Gnome and are able to get the password from Gnome keyring to fill http_proxy is other interesting solution.
| Proxy setting: How to keep my password more secure |
1,353,055,005,000 |
I would like to know how the password verification in Linux works.
I know that the passwords are stored as a hash in /etc/shadow file and user information is in /etc/passwd file. My understanding is this:
Selecting what user you want to login as decides what user name the system should check.
When you enter the password and hit enter, the system goes to the /etc/shadow file and finds the line corresponding to the user name.
From step 2 it gets the hash of the actual password. It then generates the hash of the entered password and compares both of them. If a match is found, voilà. Else, error message.
Is my understanding correct?
|
Yes. You're correct. Each steps can be split in minor tasks as well, but you describe the overall algorithm.
Follow a couple of articles describing in details the login process. [1] [2]
Note that this is only about the plain password, not mentioning PAM system. [3]
| How does Linux verify the login password? |
1,353,055,005,000 |
Create a new account called test:
$ sudo useradd test
test doesn't have a password right now. So
$ su test
doesn't work. If you try, you're asked for test's password. It doesn't have one. That's not the same as its password being empty so if you enter an empty password by pressing enter, you get message "su: Authentication failure".
The same is true if you switch to a tty and try to log in as test: An empty password isn't accepted.
Now assign test an empty password:
$ sudo passwd -d test
You can now log in as test on a tty by providing the empty string as the password. However, if you try
$ su test
again, you still get the message "su: Authentication failure" the session doesn't switch to the user test.
Why is this?
|
From the output of ldd /bin/su, the su binary is compiled with the pam libraries (libpam*), so the authentication, account management, session initiation etc stuffs will be managed by pam.
The following is how a typical Ubuntu system's su is managed by pam, you should find similar approach if you are using another distro.
The pam rules for su are defined in the file /etc/pam.d/su. This file also includes the common-auth, common-passwd, common-session files from same directory as common templates for covering the tasks their name suggest (and used in other pam enabled services).
On my system, at the bottom of /etc/pam.d/su i have:
@include common-auth
@include common-account
@include common-session
The preceding lines do not deal with the null password checking, it is mainly the job of pam_unix module.
Now /etc/pam.d/common-auth has:
auth [success=1 default=ignore] pam_unix.so nullok_secure
From man pam_unix:
nullok
The default action of this module is to not permit the user access to a service if their official password is blank. The nullok argument overrides this default and allows any user with a
blank password to access the service.
nullok_secure
The default action of this module is to not permit the user access to a service if their official password is blank. The nullok_secure argument overrides this default and allows any user
with a blank password to access the service as long as the value of PAM_TTY is set to one of the values found in /etc/securetty.
as you can see if the nullok_secure option is set, the unless the environment variable PAM_TTY is set in the mentioned manner, the user with null password will not be permitted to login using su.
So to allow any user with null password to do su, you need to have the nullok argument to the pam_unix module:
auth [success=1 default=ignore] pam_unix.so nullok
this is insecure as the common-auth file is used by many other services, even for only su this should not be done. (For the sake of testing you can set it once and then revert back to original. Although if you want to do the test, it's better to incorporate all the logics in /etc/pam.d/su file, and amend any changes afterwards rather than messing with any common-* file)
| Why can't `su` be used to switch to users with empty password? |
1,353,055,005,000 |
I'm building a jessie build of Debian. Passwords are saved in /etc/shadow in the build tree, but they are salted obviously so I cannot change it just by editing the file. If this was my installed system, I could call passwd, but here I want to change the password in the file in the build tree.
How do I change the root password before I flash a SD with a new build?
|
At the stage where you have a directory tree containing a file …/etc/shadow (before building the filesystem image), modify that file to inject the password hash(es) that you want to have.
The easiest way to do that is with recent enough versions of the chpasswd tool from the Linux shadow utilities suite (Debian wheezy is recent enough) with the -R option. Sample usage:
chpasswd -R /path/to/build/tree <passwords.txt
with passwords.txt containing lines like
root:swordfish
alibaba:opensesame
If your build environment doesn't support chpasswd -R, you can use a tool that generates a password hash by calling the crypt function and inject that into the shadow file by text manipulation. For example (untested code):
#!/usr/bin/python
import base64, crypt, os, re, sys
for line in sys.stdin.readlines():
(username, password) = line.strip().split(":")
salt = "$6$" + base64.b64encode(os.urandom(6))
hashes[username] = crypt.crypt(password, salt)
old_shadow = open("etc/shadow")
new_shadow = open("etc/shadow.making", "w")
for line in old_shadow.readlines():
(username, password, trail) = line.lstrip().split(":", 3)
if hashes.has_key(username):
line = username + ":" + hashes[username] + ":" + trail
new_shadow.write(line)
old_shadow.close()
new_shadow.close()
os.rename("etc/shadow.making", "etc/shadow")
| Change the root password of a Linux image |
1,669,048,418,000 |
Protecting a GNU screen session with a password is good security. However, how does one remove the password if you need to share a session with a colleague?
I tried the following to clear it and got locked out (I ought to have tested it before detaching, but...):
ctrl+a :password clear
So, what exactly is the password set to in the above scenario? Neither my previously set password nor my system account password would let me back in!
|
From man screen:
password [crypted_pw]
Present a crypted password in your ".screenrc" file and screen will ask for it, whenever someone attempts to resume a detached. This
is useful if you have privileged programs
running under screen and you want to protect your session from reattach attempts by another user masquerading as your uid (i.e.
any superuser.) If no crypted password is
specified, screen prompts twice for typing a password and places its encryption in the paste buffer. Default is `none', this
disables password checking.
ctrl+a :password none should do what you want.
| GNU Screen - any way to remove password when detached? |
1,669,048,418,000 |
I have an OpenSSH server which supports only password authentication:
[martin@ ~]$ ssh -v 10.10.1.183 -l root
OpenSSH_5.2p1 FreeBSD-20090522, OpenSSL 0.9.8k 25 Mar 2009
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to 10.10.1.183 [10.10.1.183] port 22.
debug1: Connection established.
debug1: identity file /home/martin/.ssh/identity type 0
debug1: identity file /home/martin/.ssh/id_rsa type -1
debug1: identity file /home/martin/.ssh/id_dsa type 2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.7p1 Debian-5
debug1: match: OpenSSH_6.7p1 Debian-5 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.2p1 FreeBSD-20090522
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-sha1 none
debug1: kex: client->server aes128-ctr hmac-sha1 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<2048<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '10.10.1.183' is known and matches the RSA host key.
debug1: Found key in /home/martin/.ssh/known_hosts:3
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: password
debug1: Next authentication method: password
[email protected]'s password:
In other words only the PasswordAuthentication in server sshd_config file is set to yes.
According to RFC 4252 section 8 It is up to the server how to interpret the password and validate it against the password database. Am I correct that in Linux this means that sshd directly checks the /etc/passwd and /etc/shadow files if UsePAM in sshd configuration is disabled?
|
Am I correct that in Linux this means that sshd directly checks the /etc/passwd and /etc/shadow files if UsePAM in sshd configuration is disabled?
Yes. But currently most of distributions handle login using pam, because the sessions in todays systems are getting more and more complicated. OpenSSH can communicate with shadow using <shadow.h> header file and functions defined in there.
For more information, this is in source code files auth.c and auth-shadow.c
| Understand the PasswordAuthentication in sshd configuration |
1,669,048,418,000 |
I am using rdesktop on a Fedora laptop to connect to Windows computers at work. To make it easier, I've made an alias in my .bashrc:
alias companyremote='rdesktop -u USER -p - -g 1920x1040 -K'
So I just have to type
companyremote NAME
to connect to a given computer. But I don't want to store my passwords in plaintext in my .bashrc, so I have to type the password every time in standard input. I'd rather have a clean command with no other required input that only requires me to be a certain user.
I suppose the VPN connection is the primary security layer, not the actual Windows password, but I'd rather be safe than not, and why not learn something?
How can I store an encrypted password that I can use with an alias like this?
|
A password agent (also known as a keychain/keyring or secrets store) is the tool for this. The idea is to keep all your passwords in an encrypted database protected by a master password. The agent starts when you log in, gets the master password from you, then decrypts individual passwords for other programs on request. Often the master password will be the same as your login password, in which case the agent gets the password automatically when you log in.
If you've got the Gnome-keyring password agent running, you can use the secret-tool command-line client to look up passwords and pipe them into rdesktop.
Since Gnome-keyring is designed to store a lot of passwords, it needs to tell them apart, so it stores identifying information with each password in the form of a set of attributes and values. These can be anything, but no two passwords can have the exact same set of identifiers. For remote Windows login, useful identifiers might be "user" and "domain", or "user" and "hostname". It also stores a label, which is for humans to tell the password entries apart.
$ secret-tool store --label "jander@mydomain" user "jander" domain "mydomain"
Password:
Then, you can use something like the following to start rdesktop:
$ secret-tool lookup user "jander" domain "mydomain.com" | rdesktop -d "mydomain" -u "jander" -p - remotehost.mydomain
The seahorse GUI tool is useful for inspecting your keychains, locking and unlocking them manually, and changing passwords. It's not great for adding passwords, though, since it doesn't provide any way to set identifiers.
For more technical details you might be interested in the Freedesktop.org secret storage spec, which Gnome-keyring implements.
Finally, keep in mind that when you use an agent, you are giving up security for convenience: anyone who can sit down at your laptop while you're logged in can now also log into your remote desktop without knowing the password. You'll probably want to use a locking screensaver at a minimum.
| How can I store an encrypted rdesktop password for easier sign-in? |
1,669,048,418,000 |
I have setup the server to only use LDAP for authentication by using authconfig-tui. Everything works well but, when I run passwd, I get two prompts for a password:
[beamin@rhel6-test-server1 ~]$ passwd
Changing password for user beamin.
Changing password for beamin.
(current) UNIX password:
Enter login(LDAP) password:
Why is it asking for both? Can I prevent that from happening?
Here is the content of /etc/pam.d/passwd:
$ cat /etc/pam.d/passwd
#%PAM-1.0
auth include system-auth
account include system-auth
password substack system-auth
-password optional pam_gnome_keyring.so
Here is the content of the include (/etc/pam.d/system.auth):
$ cat /etc/pam.d/system-auth
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth sufficient pam_unix.so nullok try_first_pass
auth requisite pam_succeed_if.so uid >= 500 quiet
auth sufficient pam_ldap.so use_first_pass
auth required pam_deny.so
account required pam_unix.so broken_shadow
account sufficient pam_succeed_if.so uid < 500 quiet
account [default=bad success=ok user_unknown=ignore] pam_ldap.so
account required pam_permit.so
password requisite pam_cracklib.so try_first_pass retry=3 type=
password sufficient pam_unix.so nullok try_first_pass use_authtok
password sufficient pam_ldap.so use_authtok
password required pam_deny.so
session optional pam_keyinit.so revoke
session required pam_limits.so
session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session required pam_unix.so
session optional pam_ldap.so
Contents of nsswitch.conf asked by @Nikhil:
$ egrep 'passwd|shadow' /etc/nsswitch.conf
#passwd: db files nisplus nis
#shadow: db files nisplus nis
passwd: files
shadow: files
|
It is the /etc/nsswitch.conf that tells the system where to look for the store of users,groups in maps of passwd, group & shadow. Whether it would be local files, nis/yp, or ldap, it is the nsswitch.conf. The configuration to support this change would later come in either pam configuration or the nss libraries. pam on Linux does simplification, since it also supports tcp_wrappers along with customisation of unix authentication in various ways.
Once you have run and changed /usr/bin/authconfig to use ldap,
Authconfig will alter your PAM files for you (among other things), specifically the file /etc/pam.d/system-auth. A typical system-auth file on a Red Hat system configured to authenticate using LDAP looks like this:
The 'pam_unix' module is invoked next, and will do the work of prompting the user for a password. The arguments "nullok" and "likeauth" mean that empty passwords are not treated as locked accounts, and that the module will return the same value (the value that is "like" the "auth" value), even if it is called as a credential setting module. Note that this module is "sufficient" and not "required".
The 'pam_ldap' module is invoked, and is told to "use_first_pass", in other words, use the password that was collected by the pam_unix module instead of prompting the user for another password. Note that the fact that this module is marked "sufficient", and it's positioned after pam_unix means that if pam_unix succeeds in checking a password locally, pam_ldap won't be invoked at all.
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth sufficient pam_unix.so nullok try_first_pass
auth requisite pam_succeed_if.so uid >= 500 quiet
auth sufficient pam_ldap.so use_first_pass
auth required pam_deny.so
account required pam_unix.so broken_shadow
account sufficient pam_succeed_if.so uid < 500 quiet
account [default=bad success=ok user_unknown=ignore] pam_ldap.so
account required pam_permit.so
password requisite pam_cracklib.so try_first_pass retry=3
password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok
password sufficient pam_ldap.so use_authtok
password required pam_deny.so
session optional pam_keyinit.so revoke
session required pam_limits.so
session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session required pam_unix.so
session optional pam_ldap.so
/etc/ldap.conf should have
pam_lookup_policy yes
pam_password exop
/etc/ssh/sshd_config should have and should be restarted after config change.
UsePAM yes
| Preventing `passwd` from asking for the local password |
1,669,048,418,000 |
In our organization, we are distributing pre-hashed password values for a number of local accounts. Currently, these accounts' passwords are hashed using Blowfish ($2a$[...]) or Blowfish-8-bit ($2y$[...]). Other distros we are using are capable of handling this, but RedHat / CentOS seems to deliberately be lacking support for Blowfish in glibc as it is.
Is there any way to make CentOS/RedHat systems handle Blowfish hashes without profoundly breaking its serviceability through the standard update channels?
I am deploying CentOS 7.2 with a simplistic kickstart configuration and a minimal package selection:
%packages --nobase --ignoremissing
@core
kexec-tools
%end
|
After Ulrich Schwarz mentioned a custom PAM module in the comments to the question, I figured I could go and see what SLES, which makes Blowfish the default, is using.
Turns out it is a separate module called pam_unix2.so not conflicting with anything on the CentOS system. As a proof-of-concept, I have copied /lib64/security/pam_unix2.so off a SLES 11 SP4 system to /usr/lib64/security/pam_unix2.so on the CentOS host and downloaded and installed its dependency libxcrypt which again is a SuSE package, but works on CentOS 7 for this narrow purpose.
Adding
auth sufficient pam_unix2.so
to /etc/pam.d/system-auth allows me to authenticate against a Blowfish-crypted password on the console.
To make sure authconfig will not break the configuration on the next invocation, the symlink /etc/pam.d/system-auth pointing to /etc/pam.d/system-auth-ac should be replaced with a copy of /etc/pam.d/system-auth-ac.
Bottom line:
SuSE's pam_unix2 module seems like the least invasive method to get Blowfish hashes accepted, although it also means that I would need to monitor security announcements for pam_unix2 and libxcrypt separately.
| CentOS 7: enabling blowfish hashes for password authentication |
1,669,048,418,000 |
I red about the password management program pass in a question on this forum and decided to try it.
I installed from the download page (tarball 1.6.3).
I created some test entries and then some real entries and committed them to git and pushed them to github. When I looked at my github repository I did see some non .gpg file with the plain text versions of the passwords pushed to github. Those file also exists local. I have removed my real passwords from ~/.password-store:
$ pass
Password Store
├── test
│ ├── test
│ └── test
├── test1
│ └── test2
└── test3
└── test4
The double test is strange already:
$ ls ~/.password-store/test
test test.gpg
$ more !$/test
more ~/.password-store/test/test
uJ94!qmv}E\41GjLxJx`
$ gpg -dq < ~/.password-store/test/test.gpg
uJ94!qmv}E\41GjLxJx`
Is this normal? What can I do against the plain text versions of the passwords being stored?
|
I have seen that application do that as well. I think it is a result of the bash script (that is the pass program) not catching some errors. For me it was reason not to start using the program for real.
If you can live with the plain text files being stored locally, you can prevent them from being stored in git (and pushed out to github) by setting up a .gitignore file in your ~/.password-store:
*
!*/
!.gitignore
!.gpg-id
!*.gpg
(this first ignores everything to be stored, then allows subdirs and allows the configuration files as well as all files ending in .gpg).
If you haven't done so yet, you should immediately change all passwords that you pushed out to github. Also remove ~/password-store/.git and everything underneath and reinitialize git (pass git init) for the password store, as the old, committed, plaintext files will still be in there.
| password store storing some passwords in plain text |
1,669,048,418,000 |
I have a user account on my server to which i access through ssh key authentication.
I want to give a temporary access to that account to a third person.
I was planning to create a password as an alternative authentication method (hence the server will be accessible either by password or by ssh key), give it to that third person for her to perform a job, and then delete the password once the job is done.
How can i create (and then delete) such a password?
|
The answer to the password question is:
Edit the /etc/ssh/sshd_config file to ensure that passwords are enabled.
PasswordAuthentication yes
PermitEmptyPasswords no
Then restart the ssh service (HT - @tonioc). This will work for sysvinit systems:
/etc/init.d/ssh restart
And this should work for systemd systems:
systemctl restart ssh
And then either:
Login with your key and change the passwd of the account if the password is locked.
Or (better):
Add a new user account for the new user and add that user to whatever minimum groups are required to accomplish the new user's task.
Or (even better):
Add a new user and have them give you a public key
Add their key to their ~/.ssh/authorized_keys file if they don't know how to copy it themselves.
However, for the least number of changes but rather poor security, you can simply add another key to:
~/.ssh/authorized_keys
on the server.
You can have as many keys as you want in the authorized_keys file. It's one key per line with options prepended.
There are many options that can be added to the authorized_keys file.
See here
And/or:
man authorized_keys
Of course, as others have pointed out, it's not a good idea to have more than one user per account unless it's run by a team. Temporary privileged access or accounts are probably not a good idea.
| linux - add a password to a user that already has ssh authentication |
1,669,048,418,000 |
Apologies if this is an abstract question - I'll try to be as specific as possible.
When I'm at the bash shell and switch to a different account via su - foo, I'm prompted for a password. The characters I type at this password prompt are hidden from the screen with no indication of how many characters I'm typing or what they are. How is bash (or Linux in general) doing this?
|
What you type is displayed in the terminal because the terminal "echoes" it back. When asking for password, the echoing is turned off. See also help read and its -s option.
| How is the su command masking/protecting my password from being displayed on screen? [duplicate] |
1,669,048,418,000 |
I am using watch to monitor the progress of a MySQL replication slave. The way I have it set up now, the password shows up in the header of the watch output. I am not exceedingly worried that someone will steal the password, but on principle I would prefer not to be showing a naked password to anyone who happens to wander up and look over my shoulder.
The command line I am currently using with watch is:
watch -n1 -d mysql -pmypass -e "'show slave status\G'"
Should I just bury the mysql command in a tiny little shell script?
|
A better option than providing the password on the command line at all is to make a ~/.my.cnf file with the credentials in it:
[client]
password=something
That way they are also protected against someone looking at the ps output, or your shell history.
That said, you can turn off the watch title entirely with the -t or --no-title option, which will:
Turn off the header showing the interval, command, and current
time at the top of the display, as well as the following blank
line.
You do lose a little more information than you were wanting, but it's not hugely vital. Otherwise, a shell script also works, as you suggested.
| How to mask passwords in 'watch' command? |
1,669,048,418,000 |
Today I tried to get Live Kali Linux working off a USB stick. When I got to the login screen, I tried entering root as the username and toor as the password like always, but the login failed. I am out of ideas, since the official Kali site still says those should be the correct login credentials.
Here are the steps for reproducing on my Lenovo y700 laptop:
Download a Kali linux iso image from the official website. I tried 32-bit and 64-bit versions of the latest Kali Linux and I also tried an old 2018 image, all with the same results
Burn the image onto a flash drive. For this I tried using Rufus, Etcher and the dd tool from Linux. I followed the instructions on the official website.
Plug the USB into the computer, choose "Legacy Mode" from BIOS boot screen (because if I choose UEFI, then even if USB boot is enabled, it says usb boot is disabled in uefi settings). When the grub screen comes up, I can choose either kali or "advanced options". There is no option for installation.
Choose the live version and it will boot into a login screen. Enter root as the username and toor as the password, and get invalid credentials as the response
|
I don’t know if you still need this, but to anyone who does, Kali changed the password structure from root/toor to kali/kali. This was driving me crazy as it was always root/toor before.
See: https://www.kali.org/news/kali-default-non-root-user/
| Live Kali Linux root/toor login not working |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.