358

Using your computer logged in as root all the time is like always carrying around all your keys, your passport, $5,000 in cash, that piece of paper with all your passwords written on it and the only photo you have of Flopsy, the adorable rabbit whose death broke your seven-year-old heart. Oh, and a chainsaw. Which is to say, it's mighty convenient from time ...


44

Funny timing, just received this back from Dropbox support and it seems to have resolved my user's problem. Her issue similarly popped up when we migrated her to a new Mac and then changed her user account name. Thanks for writing in. If you're having trouble running Dropbox on your Mac then please try these steps and then restart Dropbox. 1. Stop Dropbox ...


43

sudo launchctl bootout gui/$(id -u <username>) or sudo launchctl bootout user/$(id -u <username>) Replace username with the target user's user name or replace the whole subshell with the user's uid. This tells launchctl to teardown the users login session (gui specifically refers to the user's temporary login session, user specifies the users ...


35

Firstly, the premise behind your question is false on two grounds: The UUID isn’t actually a UUID in the real sense. - What I mean is that it isn’t a universally unique identifier that, for anything more than practical purposes, is unique. See universally unique identifier for more info. So, while your user account UUID looks the same as a real UUID because ...


34

You will need to go to Store->Sign Out, then sign in with your own account. After that, delete the software that is asking for the old account password, and reinstall it under your account. If the software is not free, you will need to buy the software again. You do not have a license to use the software, unfortunately. In your case, there’s only keynote ...


33

Here is a shell script I wrote at work to handle this as part of the NetInstall process (creating a local administrator account automatically during imaging process). #!/bin/sh . /etc/rc.common dscl . create /Users/administrator dscl . create /Users/administrator RealName "Administrator Account" dscl . create /Users/administrator hint "Password Hint" dscl . ...


30

To log out purely from terminal (or a remote ssh session), just kill the loginwindow process: sudo pkill loginwindow You could get fancy and specify the user if multiple users have a loginwindow process, but this is an easy one shot, no prompt way to end a user's graphical session.


28

$ dscl . list /Users | grep -v '^_' daemon Guest macports <--------------------------------------------- remove? mixelpix nobody root $ /usr/bin/dscl . -search /Users name macports macports dsAttrTypeNative:name = ( macports <----------------------------------------- confirm... ) $ sudo /usr/bin/dscl . -delete "/Users/macports" <---- ...


27

I finally found a solution! After some more search I found this command: sudo defaults write /Library/Preferences/com.apple.loginwindow SHOWOTHERUSERS_MANAGED -bool FALSE ..and it did the trick!


23

You can, but it's a major security and stability risk. Doing so allows any application full access to your computer. You can't know what they're doing with that access. It's unnecessary, and just really unsafe. For a lot more background information on this, see Why is it bad to login as root Why not run always logged in as root Why it is not recommend to ...


21

A similar tool to useradd is /usr/sbin/sysadminctl on macOS . There isn't a manual but /usr/sbin/sysadminctl -h is explanatory. You should be aware that the command and options will be stored in your shell's history. Note the last line of the help output so that the user password is not stored in your shell's history.


21

Try the command given below. id -Gn [user] On my Mac, the output from id -Gn davidanderson is given below. staff everyone localaccounts _appserverusr admin _appserveradm _lpadmin _appstore _lpoperator _developer _analyticsusers com.apple.access_ftp com.apple.access_screensharing com.apple.access_ssh 2 1 The delimiter could be changed from a space to a ...


19

Those accounts are for systems processes and to restrict access to things like files and resources by group or user.


18

There are a lot of places in the OS where something has to be assigned to some user account. Each file and directory must be owned by some user account, every process (program) running must be running as some user account, etc. The "nobody" account serves mostly as a placeholder for files, processes, etc that don't really belong to any "real&...


17

Try launchctl unload -w ~/Library/LaunchAgents/com.nero.HSMMonitor.plist


17

You can disable a user account by setting their shell to /usr/bin/false. Either run chsh -s /usr/bin/false <username>, or change it in Users & Groups → Advanced Options. To change it back, run chsh -s /bin/bash <username>.


16

This has worked for me in the past: Log out (with confirmation) osascript -e 'tell app "System Events" to log out' Log out directly (no confirmation) osascript -e 'tell app "System Events" to «event aevtrlgo»' or osascript -e 'tell application "loginwindow" to «event aevtrlgo»' This way any running application will get noticed and can terminate in a ...


16

Ran into the exact same problem. Installed the Network Link Conditioner when my system had OSX Lion and XCode 4 or 5. Great tool but did not need it again until today. Found it no longer worked. My system now has OSX Yosemite and XCode 6.4 so I downloaded Hardware IO Tools for Xcode 6.3. Got the same message about not being able to replace it since it was ...


16

Honestly, I agree that there are a lot of risks associated with using the root user as default. But let me just run through them and criticize some of the arguments a bit Defending against applications: Practically the permission system of *nix is not strong enough (by far) to allow running arbitrary programs. A malicious program on *nix is able to do ...


15

Back around 1990 I was working on a project with a guy named Tom. We were using a SUN server running SunOS (a Unix derivative, predecessor to Solaris). This was back in the days before CD drives and flash drives, so if you messed up the OS on your hard drive there was no way to recover. Tom used to routinely log in as root. I told him that was a bad idea, ...


15

The following works for me on 10.9.5: System Preferences > Keyboard > Shortcuts > App Shortcuts. '+' to add a shortcut Application: All Applications Menu Title: Log Out [Your Name]… Here, copy the exact text shown in the Apple menu, replacing [Your Name], and note that the ellipsis … must be typed with alt-; Keyboard Shortcut: ctrl-shift-cmd-Q (or whatever ...


14

To further automate this, the following line can be used to get the next "available" user id if you are running on a mac which already has users set up. LastID=`dscl . -list /Users UniqueID | awk '{print $2}' | sort -n | tail -1` NextID=$((LastID + 1)) Then, the corresponding line in bispymusic's answer above could be changed: dscl . create /Users/...


14

There's only one reliable way to get all members of a group in OS X and the reply from 2DD8847 covers that. As for "why" I can't offer a logical explanation. All I can tell you is what differentiates the results. These approaches fail to include users that are only members of the group via PrimaryGroupID. One way to think of it is that these users not ...


14

If the actual user < user_name > has a standard account, you would have to enter sudo dscl . -append /Groups/admin GroupMembership <user_name> to make < user_name > an admin. Only a restricted number of users are sudoers (i.e. accounts which are allowed to run su or sudo with root privileges successfully) though. The standard sudoers file (/...


13

This command is simpler than the one suggested and it will have the desire result to kill all the user's processes (I had to run it twice) sudo pkill -9 -u user If you just want to kill the loginwindow process for that user you can do the following: sudo pkill -9 -u user loginwindow


13

The basic problem is that the applications are all marked as being in quarantine (they have the "com.apple.quarantine" extended attribute) because they were downloaded from the net. Running the app removes the quarantine attribute if the file permissions allow you to modify the file (e.g. if you're the file's owner -- in this case, the Admin user). If you ...


13

So, I was right that Skype has a problem, because it is prompting me to perform the auto-update, but supplying the credentials is not enough. I have to kind of "hand-hold" Skype through the update process, and open the correct window even though there is no indication from Skype that I need to do this. I was still having this problem after upgrading to ...


12

That's a bit of a Catch22… You need to already be an administrator to be on the sudoers list [with very few manually-changed exceptions] Essentially, you cannot promote yourself. That's the entire point of sudo & being an administrator, to be able to assign non-admins limited abilities.


12

The default Terminal app in macOS opens up a second login so when who or w command is executed the Terminal app, there's a second login. Depending on your environment and the Terminal app, some terminal emulation apps like iTerm2 will show only one login.


Only top voted, non community-wiki answers of a minimum length are eligible