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 8 years ago.
Improve this question
OK i googled a lot but something just doesn't add-up:
in terminal i use this code: sudo mkdir /Volumes/aNewFolder
but then the terminal asks me for my user password. why? and also - how can i pass the password so terminal wont stop and wait for user's input?
this is silly but i cant seem to fix it or to find it on the web; all i want is to mkdir without having to input my password directly...
i didnt really tried anything cause i cant seem to find any info about it.
im pretty sure that the solution is easy and im missing something. im new to unix and bash but mkdiris a very basic thing, right?
help, please?
edit: forgot to say that i thought expect could help but all i see is how to use it with ssh...
mac user
sudo = super user do.. You need to give your terminal session the password for the super user, to have "administrative" access.
Depending where you're trying to make a new directory, you don't always need to add "sudo" to your command.
If say you were trying to make a new directory in your home folder.. i.e.: mkdir ~/myNewDir
you won't need to add a sudo to it, because your home folder is owned by your user.
But let's say you were trying to make a new folder in /etc/ssh/, an area where your user does not have read/write access to, you would need to append the command with sudo, to inform the CLI that a or the, super user is going to perform the task.
Hope it helps.
If you really want to skip the password authentication every time, you could type:
sudo -su root give it root users password, and from that point on forward (and only for that terminal session) will the user root be used (see it as super user), and your commands will run without any authentication (Since root user has read/write access across the system). I wouldn't recommend doing this, if you're not sure about what you're doing.
Related
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 2 years ago.
Improve this question
For our IoT test devices I followed the following practice: I used to disable ssh login for user root, add another user and install everything I needed on that account with fine grained privileges where root permissions are a must.
Now, I'm porting everything to yocto and for the sake of simplicity I ran everything under user root during the development, planing to later switch to the same practice as above. However, I'm planing on deploying images with read only rootfs, ssh login via ssh certificate or maybe not even at all. Is it secure to run everything as user root when the rootfs is read only? Theoretically, malware could be somehow injected into RAM but not written to the rootfs. Is this a secure setup or is a second non-root user following the earlier practice a requirement?
Remark: I'm not sure which SO rule I violated but as this is a quite critical question (and I don't see a reason why this needs clarification, yet change) I'm going to leave it as is and hope the answer below (discussed with the community) will help others to avoid security flaws in their setups, as well.
As usual the fastest and most concise help was provided in the IRC channel.
To summarize the findings:
It is not save as operate the device software as user root as it is relatively easy to do a mount -o rw,remount and therefore circumventing also the read-only rootfs (unless elaborate security measures are in place). Also, the /tmp folder can be considered a vulnerability.
Thus, whenever possible a non-root user should be used to run the device software.
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 6 years ago.
Improve this question
Recently updated to Windows 10, installed Ubuntu Bash. Wanted to start configuring, But I have hit a wall already.
When installed, you are asked for a username and password for your account.
This creates a user level.
Is it possible to access to root user, SU?
Every time I try, it asks for a password, and none of the accounts on the PC work (i.e., Windows 10 admin account password does not work). Tried default passwords too etc., all fail.
The reason for it is when looking at the users home directory: When creating a file, it creates it under my Windows User Account (Permissions).
But when I view files created from Bash, they are created for Root user.
So this is the confusion, I modified bashrc and it's no longer owned by root, So it's not accessible.
But I cannot login to root to create or modify the files.
Am I being a complete noob or something?
When bashrc is not owned by Root, when loading Bash.exe, I get .bashrc Input/output error.
as far as i know you'll have to type "sudo su"
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 8 years ago.
Improve this question
The default Shared folder in MacOSX does not seem to live up to its name. Sure, all users on the local Mac can create folders and add files to the Shared folder, however other users cannot open the files or make any changes, unless it is files & folders they created/added.
Using the permissions GUI (ACLs and POSIX), I failed to find a solution to my needs which are essentially to make the Shared folder a place where all local Mac users (or a subset of users) have full permissions.
I am hoping that someone would have a suggestion.
Cheers
You can't do this with the GUI; it doesn't allow you to control (or even see) some of the necessary settings. So you need to use the Terminal, and run some chmod (change "mode", i.e. change permissions), and you need to use sudo to run them with root permissions (note that sudo will prompt for your admin password to allow this, but the password won't echo as you type). Also, be careful with these commands (or anything else involving sudo) -- the specific commands I'll give you should be safe, but if you change the wrong permission on the wrong file, you can completely break the OS.
You need to do two things: remove the "sticky" bit (which prevents users from deleting/moving/renaming other users' files):
sudo chmod -t /Users/Shared
Then add an inheritable ACL granting everyone full read+write access. The Finder's Get Info window will let you add ACLs, but not control inheritance, so again you use sudo chmod ... and include a long list of exactly what types of file access need to be allowed:
sudo chmod +a "group:everyone list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,file_inherit,directory_inherit" /Users/Shared
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
As far as i remember while installing ubuntu,the installer didn't ask me for the root password. It asked me to create an account just before preparing for the first time use.There i specified a username and a password.I use this password to log onto my ubuntu machine. I had to install something which gave the following error :
What could be the problem ? when i enter as root an mention the password,it says auth failure. How
Perhaps better suited on SuperUser...
Text taken from ubuntu-help
By default, the Root account password is locked in Ubuntu. This means that you cannot login as Root directly or use the su command to become the Root user. However, since the Root account physically exists it is still possible to run programs with root-level privileges. This is where sudo comes in - it allows authorized users (normally "Administrative" users; for further information please refer to AddUsersHowto) to run certain programs as Root without having to know the root password.
This means that in the terminal you should use sudo for commands that require root privileges
So, in your case, use sudo gem install instead
yes. This is a root problem.
What command did you try for going root?
Did you just type su <username>
Type in sudo su
Then use the username/password combo to get into root.
The gem will work then.
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
Is there any way to block access to some particular file or folder in MacOS X, so that it can be protected by password, system-wide?
I want to use it in Cocoa based program, but before that I just want to know at least general possible methods of accomplishing it.
As far as I know POSIX file access system doesn't allow to protect something with password.
I was thinking about creating additional user account with dedicated password and then setting this user as an owner of a file with chmod. In terminal it seemed to work, but that is quite bad way, I think, since that is a sort of permission problem. And you need to change user in terminal for that. I don't think that can be done if one wants to access it through regular application like Finder.
So does anybody know better ways?
To create a password protected "folder" you can use an encrypted disk image and mount it at the location you require the folder. The command hdiutil can be used to create, mount, unmount etc. such disk images. Use the the -plist option to easily drive the hdiutil command from Objective-C.