354

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 ...


48

I haven't found a way to choose a photo from that popup dialog, but you can add one by dragging an image file onto the picture itself (that dialog may have to be closed for this to work).


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 ...


36

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

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 ...


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 . ...


32

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 ...


29

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.


25

Something in memory got corrupted, and the mapping between your userID (502) and your username (ipd) was lost. I've seen it happen (usually when I've manually killed hung system processes), although I'm not sure exactly what causes it. launchd maybe? Because that mapping is lost, whoami can't convert your ID into a username so returns the ID, and your ...


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 ...


20

No, it's only recommended when unplugging the cable. The reason why you eject is so that any processes reading and writing from the disk will cause OS X to notify you of the disk being in use and prevent data corruption that can occur by just unplugging the disk while it's in use. Additionally the OS might queue different write operations to a cache before ...


20

$ 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" <---- ...


17

This can be accomplished using a feature of the unix based login system that assigns a program to run on successfully login. Normally users in OSX have their shell defined as /bin/bash. The OS login window will actually make sure people have a usable shell before showing them on the login screen. You can disable a user — revoking both their ability to login ...


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>.


17

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!


17

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.


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, ...


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

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 (/...


14

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 ...


13

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 ...


12

I see it's an old thread, but here is the solution to this problem (without restarting the whole computer). The problem is in the opendirectoryd daemon and the earliest reports date from the beginning of 2011. Restarting the daemon (switching users with an admin one via Fast User Switching) fixes the problem. While writing this answer, I've found a similar ...


12

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 ...


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 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 ...


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