Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
The community reviewed whether to reopen this question 8 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I want to create "my own" sudo command (for my file manager/commander written in C++/OpenGL). Please help provide necessary steps and things to consider. I know it has something to do with suid bit, but that's all I know so far.
It's all about filesystem flags, and you only to ensure that:
The executable file does belongs to root
It has the suid flag in the file system (you can set it with chattr u+s).
After you'll do that, it will be executed with root permissions even when running from a regular user.
Please also note that you can get an UID which had actually ran the program by calling getuid(), while geteuid() will always evaluate to 0.
I suggest to you to download sudo command code and modify it based on your requirement
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'm new to Linux and I'm wondering if I can create custom Linux commands:
For Example
LearningPhase1 cpu getinfo
To show similar output as we get from lscpu command
LearningPhase1 memory getinfo
to get memory information of my Computer
Also, I want to know if I can create new user using my own custom command
LearningPhase1 user create <username>
To create new user
LearningPhase1 user list
To get all the users of my computer
LearningPhase1 user list --sudo-only
To get the users with sudo permissions
This is my question on stackoverflow.
Any Link, Material, or Help regarding this will be much appreciated.
Please Help me in Learning more about these things.
Linux shells looking for programs which are stored in Specific Locations and if there is a program named LearningPhase1, they execute it as command.
you have to write your program and put its binaries or its code (if its interpreted) in those specific location.
you can view those specific locations with this:
echo $PATH
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have made a exe file with auto py to exe. But when I opened it I have some problems. So I decided to delete it. But when I am selecting the file and pressing SHIFT+DEL, then it would say it is open in another exe program. Can someone say a solution?Click here please
Try opening task manager, and closing all the task except the task manager itself. Then attempt the deletion.
There are some background process of the python interpreter which keep running even after the app finishes executing.
I've observed this happening with some of the IDEs (like thonny) and editors as well who sometimes won't close out the connections to the files.
That's one of the reasons we have try-finally blocks in python.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I'm running GoLand by the ./goland.sh command in the terminal
How do I make a button to start Gogland by pressing?
I use linux ubuntu
I'm not sure I understand the question 100% but I believe the answer is here: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles
I would recommend you to use the free JetBrains Toolbox:
https://www.jetbrains.com/toolbox/app/
Not only will create launchers but will keep everything up-to-date.
I really like it and I am sure you will.
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've found it's really difficult to setup path variable. I've tried a lot of combinations but nothing works at all. My over 1h work results are but as you see on screenshot (http://puu.sh/33n0X.png )
echo $PATH
give strange directory and
rm -rf k.txt
doesn't work at all. Does anyone has idea what is wrong there? I'm totally confused about it
If you want something a little more "normal", you can suppress the current PATH being appended, and just build your own.
In your ~/.bash_profile, put something to this effect
PATH=/bin
and if you want System32 you can add it as well
PATH=/bin:${TMP%U*}windows/system32
Example
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 11 years ago.
Improve this question
when passwd command is executed (I know, with root privilage), cant it be exploited? If not, why?
Thanking you in advance!
For the most part, setuid root utilities (like passwd) are small programs that do one thing, which makes them easier (nor easy, mind you) to audit for security issues.
If you can get a setuid root utility to fork a shell (say) then, yes: that is a huge security problem.
passwd cannot be exploited because it is not Turing-complete. It can perform only a very limited subset of the computer's operations (read: change a password).