Installing C++ compiler at terminal on Linux [closed] - c++

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I wanted to install a C++ compiler on my computer in Linux and I used fallowing code in terminal:
sudo apt-get install build-essential
After that, the terminal wanted password from me, but when I typed the password I saw this error:
Sorry, Try again!
My password wasn't wrong!

I'll assume you have rootpw off, so it wants your user password. To reset a user password, follow these steps. In summary:
Reboot
When GRUB comes up, choose an entry that includes "(recovery mode)"
Choose "Drop to root shell prompt"
Run passwd yourUsername, and follow the prompts.
Run exit.
Choose "resume normal boot".
If it were the root password, you could run passwd root instead.

Edit: If you're typing a password in the command line, no characters will appear; this way, if people are standing behind you, they will not see your password. That seems to have been the misunderstanding here. Just type the full password and hit enter, it should work.
Are you typing the password for root, or the password for your user account?
Try hitting ctrl+alt+F1, logging in as root, and typing
passwd <your_user_name>
then changing the password.
You are typing in the wrong password for the account you're trying to use, so either you need to change that account's password, or you need to figure out which account it is and use the correct one.
P.S.: check capslock. Silly as it is, there's a reason people say it.

Related

CentOS7.8 not raise privileges to root but a strange user [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 days ago.
Improve this question
touch a test.sh and write following in it:
source ~/.bash_profile
chmod a+x ./test.sh
./test.sh, it prompts me to enter password, after I enter correct password, still authenticate fail.
as I write 'before' and 'after' around . ~/.bashrc, it seems that . ~/.bashrc need to be authenticated.
But why is it authenticated as daemon instead of root ? daemon is a special user(I don't know what it is used for):
PS: OS is Centos7.8

Can't uninstall programm [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 11 months ago.
Improve this question
First: In case this is the wrong forum please let me know and I'll try to ask somewhere else for advice :-) .
Now to my question: I installed an App / Program and I'm unable to uninstall it. It is a very annoying program which always asks me to update it but I don't use it and just want to get rid of it. When I go to the Control Panel it only offers me the option to change the program but not to uninstall it. When I click change it opens an installation Window which gives me the option to repair, modify or remove files from my PC but when I click any option it just tells me that there are no files on my PC.
Moreover, I've also tried to enter this line in Command prompt and it says that the program was uninstalled successfully but it still continues to be on my pc.
wmic:root\cli>product where name="Autochartist MetaTrader Expert Advisor" call uninstall
Please, can somebody tell me what to do in order to get rid of the program and everything related to it? Thank you! (The program is called Autochartist MetaTrader Expert Advisor)
Well, my best bet is that you install Microsoft Uninstalling (or something of the sort) here. You'll just have to grab the Autochartist MetaTrader Expert Advisor in the list it will give (if it is present. If it isn't, then it will not work) and it should uninstall.

C++ Passwd, Root Priviledges [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have written a c++ script that disables or enables users within a Solaris environment. This is done by calling the passwd through
sprintf(cmd, "/usr/bin/passwd -l %s", argv[1]);
However the script is not executed by root, but by another user.
While the script executes the passwd changes are not done. Seems this is an issue with the user permission on passwd.
However it seems that only root can modify passwd. Is this true? Can something else be done? In the sense that passwd can be modified by other users?
You need root permission in order to do that.
However, you can configure sudo to allow the execution of your binary as root for a specified user.
An other solution would be to setuid the binary. However, care must be taken when doing that.
The process should have CAP_SETUID capability and user id is to be set to 0.

user credential validation after user rename [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
Using KB180548 in a native c++ application, the user can log in in this application with his Windows credentials.
However, a strange bug appears: if the user is renamed, the old(original) name still work with this authentication method, but the new name does not!
What is the problem? Why does Windows not acknowledge the name change in all instances?
On a side note, a long time ago, when interfacing with another software, which also used Windows accounts for log in, I found something similar in their software:
first, they had a limitation in that a username containing spaces did not work. To remedy that, I renamed the user. But this renamed user still did not work. Creating a new user with the same name worked...
I believe Windows caches credential information until the next time you log in. This is how you can log into your corporate laptop, even when that laptop isn't currently connected to your company's domain controller.
Solved it. The Control Panel based user renaming is a farce. To really change the username, as opposed as just the full name, type netplwiz in a command prompt.

Can I password protect an application? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I have an application which I don't want people to access unless given explicit permission (via a password). More specifically, this application needs to be "locked" during certain hours of the day unless the user enters a password.
The ability to check the time is simple. The ability to lock the application is what I don't know how to do. The reason that this needs to be done is that the company doesn't trust the user to log out and doesn't want any unauthorized access to the application. This is meant as a sort of last measure just in case.
I didn't write the application though, so I cant embed a password into it. The machine has only one user and I don't want to create others. My user is an admin as well, therefore most options appealing to use of the os to provide security wont work.
Any ideas on how to accomplish this?
I'm dealing with Mac OS X but would prefer an OS independent solution. Any solution involving C or C++ is welcome.
Thanks!
How about you embed the app in an encrypted disk image bundle? As long as the only user that uses it never copies it from there and properly unmounts the bundle afterwards, i think it would accomplish what you want:
Create a new encrypted disk image (DMG) using Disk Utility (this allows you to enter a password), store it anywhere within the user's home directory.
Mount the DMG and place the app you're trying to protect inside it
Create an alias to the app within the mounted DMG and place it on the desktop
Unmount the DMG
After that, when the user double-clicks the alias on the desktop, the user is prompted for the DMG's password. If it's correct, the DMG is mounted and the app is started automatically and directly.
To auto-unmount afterwards perhaps you could script something that uses the diskutil shell command, like this: > diskutil unmount /Volumes/DMG_NAME
All you have to do then is:
remove any unencrypted copies of the app from the system
explicitly inform your user to unmount the DMG when he's done using the app (or script this to do it automatically)
explain to your fellow StackOverflowers what the actual issue is that you're solving. Msw has a point and I hope you can elaborate a bit.
Obviously with this set-up nothing's going to be 100% secure, but for casual users you can encrypt the application with the password, then write a launching application that decrypts and launches the application when the password is entered, and deletes the application when it quits.
#include <stdio.h>
#include <string.h>
char buf[BUFSIZ]
puts('what is the secret password? ');
fgets(buf, BUFSIZ, stdin);
if (strcmp('secret', buf)) exit(1);
Should work as well as anything else you might code, and has the advantage of simplicity and portability.