New answers tagged password
instead of echo password you have to use expect command: su and expect command
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 ...
The order of operations that causes the expired password prompt is as follows: SSH runs the PAM account stage, which verifies that the account exists and is valid. The account stage notices that the password has expired, and lets SSH know. SSH performs key-based authentication. It doesn't need PAM for this, so it doesn't run the auth stage. It then sets ...
Here's a one-off script for generating XKCD-style passphrases. /usr/share/dict/words isn't a great dictionary for this since most of the words are long, but it is easily available. For nicer passphrases you could use a dictionary of short words such as the S/Key One-Time Password word list. dict="/usr/share/dict/words" max="`wc -l <"$dict"`" \ perl ...
Sometimes if your PC goes off to sleep, it takes time to resume. Check your power options.
I think you need rescue mode of your linux dist you didn't say what dist you're on but here's an example for Fedora/RH/CentOS: http://fedoraproject.org/wiki/How_to_reset_a_root_password
It's not only acceptable, but also preferable to have them have /bin/false as a login shell, else someone could actually long onto the system and get shell access. Remember to pass -s /bin/false to useradd to set the login shell to /bin/false
While it is not safe, please remember that Linux these days is in its early twenties - like with other things in IT the security implications were either not that clear back then or addressed later on. Hence, as mentioned in the other answers, do not use password on the command line. You can (and probably shold) also restrict the information provided by ...
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, ...
No, it's not safe to pass passwords to programs on the commandline. It's better to use: mohsen@debian:~$ mysql -uuser -p Enter password:
As DopeGhoti mentions, sudo asks for your user password, not the root password. If you have neither the root password nor the password of an account that has sudo rights, your next best bet is to reboot the server into maintenance mode, or if that doesn't work right, boot with init=/bin/sh as part of the kernel command line to change the root password.
Maybe you have not set your root password. Try running: $ sudo passed
It is usually your personal login password. For example: derek$ sudo ls /var/log/secret [sudo] password for derek: <type derek's login password> audit.log audit.log.1 audit.log.2 This can be altered by policy files such as /etc/sudoers. See for example Set sudo password differently from login one
Python: python -c 'import crypt; print crypt.crypt("password", "$6$saltsalt$")' (for python 3 and greater it will be print(crypt.crypt(..., ...))) Perl: perl -e 'print crypt("password","\$6\$saltsalt\$") . "\n"' HTH
To set a password, just use passwd <username>.
Have you copied .bashrc file from the old home directory to the new one?. If you don't that is the problem, you don't have the environment variables set. Check that HOME is set there though, if it wasn't set there then it is being taken from /etc/bash.bashrc, so you should set the new one in the .bashrc that you are going to place in your new home.
Top 50 recent answers are included