Su which password




















With sudo, you still have the option of opening a permanent interactive superuser shell with the command:. And similarly, instead of su - for a login shell you can use sudo su - or its shortcut sudo -i. However when doing so you just need to be aware that you are acting as a superuser for every command. It's a good security principle not to stay as a superuser for longer than necessary, just to lessen the possibility of accidentally causing some damage to the system without it, you can only damage files your user owns.

Just to clarify, you can , if you choose, give the root user a password allowing logins as root as described in Oli's answer, if you specifically want to do things this way instead.

I just wanted to let you know about the Ubuntu convention of preferring sudo instead and let you know that there is an alternative. Your question also has a second part to it: your issues with the command sudo chmod -R foobs.

Unfortunately, by doing this you've probably pretty much broken all file permissions throughout your system. It's unlikely that this will be the only important system file whose permissions have been changed to be world-writable. Essentially you have an easily hackable system now, and the only easy way to get it back would be to re-install.

All the files you create in your home directory should be modifiable by you anyway and if not, something funny is going on. Also, you need to be fully aware of the consequences of changing file permissions en masse, such as doing it recursively or on a huge number of files. In this case, you're changing carefully set up file permissions to be world-writable.

Any other user, or any buggy server software on the machine, may have easy access to overwrite all of these files and directories. If you're just messing with your own files in your home directory, desktop etc, you should never need to use sudo or superuser rights. If you do, it's a warning sign that you're doing something wrong. You should never manually modify system files owned by packages. This applies also to changing file permissions. By default, the superuser root account is disabled and doesn't have any password.

You can create one by running:. Ubuntu Community Ask! Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Learn more. Why don't I have a password for "su"? Problems with "sudo" Ask Question. Asked 7 years, 7 months ago. Active 2 years, 2 months ago.

Viewed k times. Improve this question. Starkers Starkers 2, 12 12 gold badges 27 27 silver badges 39 39 bronze badges. You should almost never do chmod -R whatever , unless you want to cause a huge security risk.

BroSlow Thanks for the top. Outside this question, but how would one set read write privileges to a directory safely? Definitely better, but depends on what you're trying to do. Otherwise, the normal authentication steps are executed. Next, add the user for example aaronk that you want to su to the account postgres without a password to the group postgres using usermod command. Now try to su to the postgres account as the user aaronk , you should not be prompted for a password as shown in the following screenshot:.

You can also su to another user without requiring a password by making some changes in the sudoers file. In this case, the user for example aaronk who will switch to another user account for example postgres should be in the sudoers file or in the sudo group to be able to invoke the sudo command. Now try to su to the account postgres as the user aaronk , the shell should not prompt you to enter a password:.

For more information, see the PAM manual entry page man pam. TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! If you like what you are reading, please consider buying us a coffee or 2 as a token of appreciation.

We are thankful for your never ending support. While passwordless login creates convenience, it also creates a security hole. I've got two answers for you. Improve this answer. Shachar Shemesh Shachar Shemesh 7, 4 4 gold badges 21 21 silver badges 51 51 bronze badges.

Using this answer, my system still asks for the password for the currently logged in user — Dave Nottage. Using sshpass 1. This is the most current version on github. What version does this work with? You can use expect. Lam Nguyen Lam Nguyen 1 3 3 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Does ES6 make JavaScript frameworks obsolete?



0コメント

  • 1000 / 1000