Issues while logging local users on MAC OS X

Joined
Jul 21, 2016
Messages
2
Reaction score
0
Hi,

I am observing the below issue on MAC OS X.

When we create a local user (say: user1) and login in to this local user from an admin user, it asks for the password.

But when I login in to the local user (user1) from a root user it doesn't ask for a password.


Please let me know why the behaviour is different for a admin/root user to login to local user on MAC OS X.


Am writing a automation script for MAC OS X where I want to login to local user from root/admin user and execute some commands.


I can see the error message inconsistently which is given below when I login into a created local user from the available local user or root user.


Error:shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied


Kindly share your ideas on this.


Thanks,

Thamem
 
Hello and welcome.

What do you mean by: "When we create a local user (say: user1) and login in to this local user from an admin user, it asks for the password. But when I login in to the local user (user1) from a root user it doesn't ask for a password." Aren't you simply logging in at the login screen?

C
 
Hello Cory,

Good day to you.

Please see my comments inline.

>>What do you mean by: "When we create a local user (say: user1) and login in to this local user from an admin user, it asks for the password. But when I login in to the local user (user1) from a root user it doesn't ask for a password

I opened my MAC OS X terminal and login to admin user.

After that I logged in to local user from admin user its ask for a password.

If I logged in as root for admin user and try to login in to local user it wont ask for a password.

Example:

As I logging as local user using MAC OS X cli commands as given below

sqamp1s-Mac-Pro:~ sqamp1$ su t1
Password:
bash-3.2$

You can see that t1 as local user which login from a admin user(sqamp1) and it ask for a password.

Now Please see the below which didn't ask for password when login as local user(t1) from a root user.

sh-3.2# pwd
/Users/sqamp1
sh-3.2# su t1
bash-3.2$

Hope its clear now. Please let me know why the behaviour is different for a admin/root user to login to local user on MAC OS X.

Thanks,
Thamem
 
OK, I think I am beginning to understand.

I don't normally recommend logging into the root user, let alone having it enabled, as it is the most powerful "superuser" on your Mac. That would be why you don't need to enter the password when logging into another user in Terminal. The su or sudo command in Terminal allows you to basically authenticate as root. sudo stands for superuser do.

What kind of automation script are you attempting to write and what commands are you trying to execute?

C
 
Back
Top