Skip to main content

All Questions

Filter by
Sorted by
Tagged with
2 votes
1 answer
43 views

Add a two-word user name to sudoer

Running a MacBook Pro 2016, MacOS Monterey v 12.7.6. I need to add a username with admin privileges to allow that user to run a specific program, VeraCrypt, as explained here. In summary, one adds ...
TakeFive24's user avatar
1 vote
2 answers
52 views

Trying to merge multiple folders - I messed up

I wanted to merge multiple folders into one, so I used this command in terminal: cd containing_folder mv */* . Well that didn't really go as planned and resulted in lots of folders being moved to my ...
mixyy's user avatar
  • 11
1 vote
1 answer
82 views

running app as a different user

I want to start app N as user U2 while logged in as user U1. The idea is U2 is less privilidged than U1, thus it would be safer to run suspicious apps. Is it possible? I tried su U2; cd /...
Earnest Frankly's user avatar
0 votes
0 answers
643 views

Create a user and switch to it from the command line in macOS

Following Can user accounts be managed via the command line?, I did: sudo dscl localhost -create /Local/Default/Users/myuid Then following How to login as a different bash user in terminal?, I did: ...
xpt's user avatar
  • 425
2 votes
2 answers
366 views

Create script that run command as admin ,but allow non sudo/admin user to execute it

I want to run below command networksetup -setMTU en0 1280 but this requires admin credentials networksetup -setMTU en0 1280 ** Error: Command requires admin privileges. I want to create a ...
gladiator's user avatar
  • 123
0 votes
0 answers
356 views

How to create a system user/group that will appear in /etc/passwd and /etc/groups?

I want to programmatically create a system user (and group) for a new system service I'm working on. I've followed the hints to use dscl here: https://serverfault.com/questions/20702/how-do-i-create-...
CubicleSoft's user avatar
3 votes
3 answers
745 views

Terminal Help - Reverting a Standard Mac user account back to an admin account?

I've been doing a Jamf now roll out, but have mucked up the user account by using this terminal command: sudo dseditgroup -o edit -d UserName -t user admin Which basically made the admin account ...
Ginger B's user avatar
2 votes
1 answer
50 views

How to fix incorrect command line mail user name on macOS?

On OSX 12.2.1 I am seeing a message that I have mail. But if I type mail I see the following: mail: /var/mail/Chris: Permission denied If I list the contents of /var/mail/ I see chris i.e. all lower ...
Obromios's user avatar
  • 540
1 vote
0 answers
132 views

Is not possible create directories and files at /Volumes with permissions granted

In Linux Ubuntu for example within the /mnt directory I created two directories - for example: alpha and beta - it to be used to mount some remote directories later. For the same machine exists two ...
Manuel Jordan's user avatar
2 votes
1 answer
1k views

"su - non-root" arises "su sorry"

In Ubuntu I am able to switch of user (to non-root) through the terminal executing: su - username Password: And done. I am able to do anything according the own permissions/roles of the non-root user....
Manuel Jordan's user avatar
0 votes
0 answers
56 views

dscl . -list /Users Unusually Long All Legitimate Or Hacked? [duplicate]

Can someone look over my file system list? (Getting very late here + can't find decent answer...) I'm a bit worried the list is quite long... THANK YOU! I've disabled my filesharing on a clean install ...
kore24's user avatar
  • 1
0 votes
0 answers
33 views

Cannot log in to local admin

I copied this script and made the changes on it, but for some reason when I try to log in with the account it doesn't log in at all. Has anyone experienced this issue? I am wondering what could be the ...
Ranhyer Guzman's user avatar
2 votes
3 answers
2k views

How do I force my Mac to log in to an account remotely?

It’s possible to restart a Mac from the command line (sudo shutdown -r now). It’s possible to log out from a Mac from the command line (sudo pkill loginwindow). But is it possible to force a Mac to ...
Calion's user avatar
  • 572
1 vote
0 answers
27 views

What is the 'subharmonic' account on macOS Catalina (10.15.3)?

My MacBook Pro running Catalina (10.15.3) has been behaving a bit weird lately. So, I wanted to list the users that exist: $ dscl . -list /Users PrimaryGroupID | grep ' 20$' clint ...
Clint Laskowski's user avatar
3 votes
1 answer
5k views

Can I suppress the Setup Assistant When Creating New Users on macOS?

I wanted to create a new user using Terminal and managed to do so by finding answers on StackExchange, but I was not able to figure out how to skip the setup assistant that comes up when you login to ...
Nick's user avatar
  • 81
10 votes
4 answers
8k views

Is it normal to have same user logged in twice but from another TTY?

I don't know if this is something that is in macOS, but in Linux I normally see only one user if I run the who and w command. Is it normal to have same user logged in twice but from another TTY? I ...
jennifer ruurs's user avatar
3 votes
1 answer
6k views

cannot create a user account on mac using command line

I followed the instructions here to create the user jira: sudo dscl . create /Users/jira sudo dscl . passwd /Users/jira sudo dscl . create /Users/jira RealName "jira user" sudo dscl . create /Users/...
abbood's user avatar
  • 2,783
0 votes
1 answer
105 views

How best should I delete this user

I'm new to OSX and tried to create a user from the terminal which I no longer need and which I named incorrectly. I see I can delete the user in System Preferences > Users & Groups but do I need ...
Holly's user avatar
  • 111
3 votes
1 answer
11k views

Error while trying to create an account in single user mode on OS X Mavericks

On OS X Mavericks, I am trying to create an account using single user mode, using the following script. #! /bin/bash # create user dscl . -create /Users/hiddenuser dscl . -create /Users/hiddenuser ...
Maxwell Zhao's user avatar
0 votes
0 answers
1k views

Set default user in terminal

I just formatted my Mac and upgrade it to El Capitan, When I open Terminal I see that I am always logged in as root: How can I get my usual user name every time I open a new Terminal window, I ...
iShaalan's user avatar
  • 255
1 vote
2 answers
296 views

How do I remove multiple owners from a file/folder?

While trying to set up MAMP/PHPStorm, I CHOWNed the OWNER of my Sites folder to _www from myUser. Since this did not resolve the problem I was experiencing, I attempted to CHOWN myUser /Users/myUser/...
Parradoxx's user avatar
  • 154
3 votes
2 answers
2k views

Adding a username alias using the command line

How do I add a username alias using the command line? I can do it fine using the preferences dialog through the "Advanced Options", but I need to do it during an installation script. Can someone ...
Jérôme Tremblay's user avatar
40 votes
3 answers
81k views

Understanding the 'staff' user group

It's known that all users are members of the 'staff' group. If you setup a standard user and create any file, a list of that file in the terminal with 'ls -la' shows the user group to be 'staff'. ...
TheDarkKnight's user avatar
0 votes
2 answers
776 views

"newgrp: too many groups" - why is it complaining?

In my earlier question, I got a response recommending the "newgrp" command. It diligently did the job of putting my desired group at the "top of the list" for the "id" command, but, why does it also ...
starlocke's user avatar
  • 182
0 votes
1 answer
415 views

Command Line - How do I change the order of a user's group memberships?

I have a troublesome Mac OS X server to deal with. When I ask for my current group membership using this: $ groups | perl -p -e 's/ /\n/g' I get a list of 20+ groups! cactuar com.apple.sharepoint....
starlocke's user avatar
  • 182
1 vote
1 answer
223 views

How to script a logout while screen is locked?

I want to log out a user via a shell script, after a delay. However, there's a few other issues: User does not have admin and/or root. Logout must complete even if screen is locked. Currently, I'm ...
uint128_t's user avatar
  • 146
2 votes
1 answer
1k views

Fixing two user groups with the same ID

Suddenly, my home directory is in the group messagebus instead of the usual staff.(I blame texlive for this, but have no evidence.) The problem is that both groups have the same ID: $ dscl . -read /...
Ruben Verborgh's user avatar
30 votes
4 answers
48k views

What steps are needed to create a new user from the command line?

What commands (or script) can create a fully functional user account on Mountain Lion, running only from the command line via terminal or ssh. It looks like an existing pair of answers might work, ...
bmike's user avatar
  • 241k
0 votes
2 answers
721 views

adding a secondary group for user via CLI in Lion is not working

I need to assign a secondary group membership to a user on a client machine running 10.7.4. In CLI edit3:~ admin$ sudo su - edit3:etc root# dseditgroup -o edit -a userA -t user QC edit3:etc root# ...
Tom S's user avatar
  • 37
10 votes
2 answers
10k views

How can I temporarily suspend some users, hiding them from the login screen?

I have to manage a shared OSX workstation that is used by a rotating cast of characters throughout the year. The login screen quickly becomes cumbersome when users that aren't even around for a while ...
Caleb's user avatar
  • 7,253
1 vote
1 answer
9k views

How to remove group membership from user using the Lion Terminal?

How to remove a self created daemon user named '_denyhosts' from group 1025(workgroup), 403(com.apple.sharepoint.group.2), 404(com.apple.sharepoint.group.3) and 405(com.apple.sharepoint.group.4) using ...
Pro Backup's user avatar
  • 4,006
4 votes
3 answers
14k views

Change Account Password to Blank

I recently changed an account password by accident, and was wondering how to set it back to a blank password via the shell. I have root privileges. Please help :) passwd USER doesn't accept blank ...
Jake's user avatar
  • 41
18 votes
3 answers
54k views

How to add user to a group on command line?

With Linux/Unix, I can use useradd -G developers vivek to add vivek to the developer group. How can I do the same thing with Mac OS X? Then, how do I check if vivek is in developers group?
prosseek's user avatar
  • 5,714
2 votes
5 answers
938 views

opening an app in a shell script with sudo

I'm trying to open an app that listens to port 25 within a shell script. In order to listen to port 25, I need to run the app with sudo. So I tried the following: sudo open appThatNeedsPort25 It ...
at01's user avatar
  • 5,685
18 votes
2 answers
14k views

Can user accounts be managed via the command line?

Is there any way to add, remove, or modify user accounts via the command line? I'm not talking about an account for a system process or daemon, I mean is there any way to add a user account, change, ...
Josh's user avatar
  • 8,724