All Questions
Tagged with user-account command-line
35 questions
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 ...
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 ...
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 /...
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:
...
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 ...
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-...
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 ...
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 ...
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 ...
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....
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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/...
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 ...
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 ...
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 ...
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/...
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 ...
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'.
...
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 ...
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....
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 ...
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 /...
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, ...
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# ...
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 ...
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 ...
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 ...
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?
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 ...
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, ...