My (admittedly dated) understanding of unix is that in /etc/passwd if the second field is 'x' then the identity can login with a passwd that matches a hash found in /etc/shadow.  However, when I list /etc/passwd I see that all the identities are marked with an 'x' including those that should not be able to login. In the /etc/shadow file, the no-login entities have a double bang "!!" in the hash field whereas the loginable users have the expected hash.  So, I presume this double bang convention is some alternative to the old (?) mechanism of using '*' to mark no-login users. Why is the old method no longer used?
121566
The second field in the Linux /etc/shadow file represents a password. However, what we have seen is that:   Some of the password fields may have a single exclamation   &lt;account&gt;:!:.....  Some of the password fields may have a double exclamation   &lt;account&gt;:!!:.....  Some of the password fields may have an asterisk sign  &lt;account&gt;:*:.....    By some research on internet and through , I can understand that * means password never established, ! means locked.  Can someone explain what does double exclamation (!!) mean? and how is it different from (!)?
19006
In /etc/shadow file there are encrypted password.  Encrypted password is no longer crypt(3) or md5 "type 1" format. () Now I have a   $6$somesalt$someveryverylongencryptedpasswd   as entry.  I can no longer use    openssl passwd -1 -salt salt hello-world  $1$salt$pJUW3ztI6C1N/anHwD6MB0   to generate encrypted passwd.  Any equivalent like (non existing) .. ?   openssl passwd -6 -salt salt hello-world
15039
I am trying to understand system administration on Ubuntu. So, as an example, I create a dummy user using   sudo useradd -d /home/linda linda   and passwd to create the password. I check that an entry has been made using cat /etc/passwd  linda:x:1004:1004::/home/linda:/bin/sh   However, when I su - linda, I get    No directory, logging in with HOME=/    and indeed, no home directory has been created. What am I missing?  Thanks.
109031
In /etc/profile I see this:  for i in /etc/profile.d/*.sh ; do if [ -r "$i" ]; then         if [ "${-#*i}" != "$-" ]; then             . "$i"         else             . "$i" &gt;/dev/null 2&gt;&amp;1         fi     fi done   What does ${-#*i} mean. I cannot find a definition of a parameter expansion starting ${-.
58458
I was working in my terminal, when I misspelled while cd to root (/). Accidentally, I typed // and I got in terminal:  root@weblocalhost://#   When i type pwd, i get response // but when I type ls -s i got same list as in / directory.  When you type more than 2, i.e. /// you get:  root@weblocalhost:/#   Always 1 / except for 2. Is there any difference and what is // for?
15346
I'm using postfix for my email. I know I can use /etc/aliases and newaliases command to redirect certain email, eg I can redirect root@example.com to user@example.com by putting root: user in my /etc/aliases and then running newaliases. However I'd like to do the equivilant of *: user, so that all email to example.com will get sent to user@example.com.  How do I do this?
64038
I have a user that has made no modifications to the $PATH in any dot-files: it is exactly the system default setting. From a login shell:  $ ssh example.com user@example.com:~$ cat /tmp/hello.hs #!/bin/bash  echo "$SHELL" echo "$PATH"  user@example.com:~$ /tmp/hello.hs /bin/bash /usr/local/bin:/usr/bin:/bin   Exactly as specified in /etc/profile. This I find rather unexpected:  $ ssh example.com '/tmp/hello.sh' /bin/bash        /usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games   Like I said, there's no modification of $PATH in ~/.bashrc, nor in /etc/bash.bashrc. No ~/.ssh/environment either. The ssh(1) declares that the environment variable PATH is     Set to the default PATH, as specified when compiling ssh.   but  from StackOverflow and this  article suggest that I should be able to influence the $PATH for a given command simply by modifying /etc/profile, one of the shell startup files, etc.   What's going on here?
66840
I saw the following snippet in this thread:   sleep 2 if (-x /usr/local/bin/bash) then   exec /bin/sh -c '. ~/.profile; exec /usr/local/bin/bash' endif   My understanding is that if you place this snippet in ~/.login it will invoke bash when you login.  I have a similar situation where I would like to use a similar snippet to invoke a  version of zsh that is different from the default one with which I log in. Part of the reason why I am going through this trouble is because I can't choose my desired version of zsh in the options allowed in chsh, and I don't have administrator privileges.  With this:   How would I change the snippet above to do this when switching between different versions of zsh?  Why are two exec commands needed in the snippet above? What do they do? Also, why does the snippet above use sh and bash (the user is supposed to login with csh)
113290
I have PATH=foo set in /etc/profile  According to /etc/password the root and myaccount users have /bin/bash as the login shell.  When I log in as myaccount, the PATH has been set correctly from /etc/profile. If I then sudo su, PATH does not include the value set in /etc/profile.  If I sudo su - instead then /etc/profile is sourced. I know it is good practice to do this anyway but I don't see why it's necessary in order to source /etc/profile.  Why does sudo su clobber PATH, disregarding /etc/profile and how to I make it not?
117812
I have set up an EC2 instance with ArchLinux for a client, and I am currently in the testing phase.   I am using PuTTY from Windows 8 to SSH into the machine. I have set up the connection profile correctly, and specified the correct key file.   When trying to login, I am presented with the option to choose which user I want to login as. I choose "root" and the connection proceeds with no problem, though I am not asked for the root password.  I want to forbid root logins, but when trying to login as any other user I get from the system:  Server refused our key   Also I get a popup window saying:  Disconnected: No supported authentication methods available (server sent: publickey)   Why is it that I cannot login as any other user? It is very important for me to forbid root logins.   On a side note, is it normal that I am not prompted for the root password?
83461
I have the following version on Ubuntu 12.04:  OpenLDAP: slapd  (Sep 19 2013 22:49:31) $ buildd@batsu:/build/buildd/openldap-2.4.28/debian/build/servers/slapd   OpenLDAP now offers SSHA as the default hash. I want to use a different hash. Yet, old tutorials are based on editing /etc/ldap/slapd.conf which is gone in newer version of OpenLDAP. Which file should I change?
77628
I think on previous versions of OS X, password were stored in the /etc/shadow file.  Nevertheless, this file doesn't appear to exist in the later versions of the operating system - specifically OS X 10.9 which is the first of the non-cat named OS releases.  Does anyone know where the password hashes are stored on OS X Mavericks?
108285
Background info: I am planning on making a filehost with which one can encrypt and upload files. To protect the data against any form of hacking, I'd like not to know the encryption key ($K$) used for a file, so the user will have to asymmetrically encrypt $K$ and send it as well. The reason for this double encryption is that you can still share (individual!) files with other accounts by encrypting $K$ with the public keys of those users, too.  My problem is: How can a user can get a public and private key without the server saving/knowing the private key and without the user having to remember a passphrase of 250 hex characters?  Question: Is there a way to derive a key pair from a password, like PBKDF-2 does for symmetric encryption? Suggestions on rearranging the cryptographic steps in an easier way are welcome, too.  Alternatively: It is also possible to encrypt the private key with a PBKDF-applied password and store it on the server, but I'd like to keep things 'simple'. ;)  Note: At this point I don't care if it requires RSA, ECC or an obscure cryptography scheme.
98124
If the second field of the /etc/shadow file is set to !!, does it mean that the account is disabled? Or does it mean that the account is active with no password assigned?
80225
Evidently hash keys are compared in a case-sensitive manner.  $ perl -e '%hash = ( FOO =&gt; 1 ); printf "%s\n", ( exists $hash{foo} ) ? "Yes" : "No";' No  $ perl -e '%hash = ( FOO =&gt; 1 ); printf "%s\n", ( exists $hash{FOO} ) ? "Yes" : "No";' Yes   Is there a setting to change that for the current script?
58415
EDIT: Just wondering why was this question closed as a duplicate of a question asked almost 2 years after this one... I've seen an example of how to sign using RSA. Besides the signing itself (s = m^d mod n) it also hashes and adds an IV. Why is that needed?
48925
It's hard to search for special characters on google, which is why I'm posting this here.  I recently ran (as root) a mv /tmp/folder/* /* when I meant to run mv /tmp/folder/* ./ Big mistake!  Things broke! A lot of files got mixed up and placed into strange places, none of the normal unix commands worked (ls, dir, cat, etc) and once you logged off, you couldn't ssh back in -- it would give you a prompt, but not accept the old passwords.  Running ls /* shows me that it performs ls on every directory in /. If I tried to draw a parallel, then mv should have simply moved (or copied?) the files to every directory in /. Instead, really weird things happened, and I was just curious what exactly was going on.  More info: The files in /tmp/folder had been transferred from a windows machine, and had been named file (#).txt, where (#) is a number up to two digits, with a space between file and the parenthesis. There were ~40 of these text files.