Skip to main content
Solved

Staging a script so that standard user can run


Forum|alt.badge.img+5

Am I able to stage a .sh file on my user's computers?

This script contains a sudo command but I want to be able to run from the user's account. This will be a break glass script to fix the stupid Sonoma Time/Date bug. 

What file permissions would I need to assign as well?

Best answer by jamf-42

healthcareaa wrote:

Jamf is unusable and disconnected while the time is so far off. Same goes for Self Service. 


Good point! Cache the policy (set to ongoing and offline ) and set it to run at startup or login, 

View original
Did this topic help you find an answer to your question?

18 replies

Forum|alt.badge.img+19
  • Honored Contributor
  • 582 replies
  • February 12, 2024

You best bet would be to upload the script to Jamf and create a Self Service policy to run the script instead of trying to install it and have the users run the script locally. 

If there are commands that need to be run as the logged in user, please see this article:

https://scriptingosx.com/2020/08/running-a-command-as-another-user/


jamf-42
Forum|alt.badge.img+17
  • Esteemed Contributor
  • 744 replies
  • February 12, 2024

What’s the sonoma time / date bug?  

can you post the script


Forum|alt.badge.img+5
  • Author
  • Contributor
  • 26 replies
  • February 12, 2024
Tribruin wrote:

You best bet would be to upload the script to Jamf and create a Self Service policy to run the script instead of trying to install it and have the users run the script locally. 

If there are commands that need to be run as the logged in user, please see this article:

https://scriptingosx.com/2020/08/running-a-command-as-another-user/


Sorry, didn't expand enough on the issue.

The Apple Time bug reverts the date/time to 5-6 months ago on the computer. The browsers, all apps (including Self Service) are pretty much unusable. Sometimes I am able to remote in with Teamviewer, sometimes not. Jamf connection is no longer valid due to SSL cert issues with the date/time. 


Forum|alt.badge.img+5
  • Author
  • Contributor
  • 26 replies
  • February 12, 2024
jamf-42 wrote:

What’s the sonoma time / date bug?  

can you post the script


The Apple Time bug reverts the date/time to 5-6 months ago on the computer. The browsers, all apps (including Self Service) are pretty much unusable. Sometimes I am able to remote in with Teamviewer, sometimes not. Jamf connection is no longer valid due to SSL cert issues with the date/time. 

The script file is just one command:  sudo sntp -sS time.apple.com

This command fixes the issue temporarily so I can remote in and assist. However, when I can't remote in or there is a needed Admin account missing, I am screwed. I need to be able to have the user run this script. 


jamf-42
Forum|alt.badge.img+17
  • Esteemed Contributor
  • 744 replies
  • February 12, 2024
healthcareaa wrote:

The Apple Time bug reverts the date/time to 5-6 months ago on the computer. The browsers, all apps (including Self Service) are pretty much unusable. Sometimes I am able to remote in with Teamviewer, sometimes not. Jamf connection is no longer valid due to SSL cert issues with the date/time. 

The script file is just one command:  sudo sntp -sS time.apple.com

This command fixes the issue temporarily so I can remote in and assist. However, when I can't remote in or there is a needed Admin account missing, I am screwed. I need to be able to have the user run this script. 


As mentioned, use self servic 

add the command to files and processes without the sudo and test!

I’ve not seen that issue reported on any of our macOS 14 fleet.. oddness.. 


Forum|alt.badge.img+5
  • Author
  • Contributor
  • 26 replies
  • February 12, 2024
jamf-42 wrote:

As mentioned, use self servic 

add the command to files and processes without the sudo and test!

I’ve not seen that issue reported on any of our macOS 14 fleet.. oddness.. 


Jamf is unusable and disconnected while the time is so far off. Same goes for Self Service. 


jamf-42
Forum|alt.badge.img+17
  • Esteemed Contributor
  • 744 replies
  • Answer
  • February 12, 2024
healthcareaa wrote:

Jamf is unusable and disconnected while the time is so far off. Same goes for Self Service. 


Good point! Cache the policy (set to ongoing and offline ) and set it to run at startup or login, 


sdagley
Forum|alt.badge.img+25
  • Jamf Heroes
  • 3546 replies
  • February 13, 2024
healthcareaa wrote:

The Apple Time bug reverts the date/time to 5-6 months ago on the computer. The browsers, all apps (including Self Service) are pretty much unusable. Sometimes I am able to remote in with Teamviewer, sometimes not. Jamf connection is no longer valid due to SSL cert issues with the date/time. 

The script file is just one command:  sudo sntp -sS time.apple.com

This command fixes the issue temporarily so I can remote in and assist. However, when I can't remote in or there is a needed Admin account missing, I am screwed. I need to be able to have the user run this script. 


The time bug should have been fixed in the past few versions of macOS Sonoma (14.3.1 as I write this).


Forum|alt.badge.img+5
  • Author
  • Contributor
  • 26 replies
  • February 13, 2024
sdagley wrote:

The time bug should have been fixed in the past few versions of macOS Sonoma (14.3.1 as I write this).


Yes it should have. I have a few users that are still on 14.1, 14.1.2 that are having the issue. Hopefully the latest OS version fixes this bug. It leaves the user dead in the water until we can resolve. 


Forum|alt.badge.img+5
  • Author
  • Contributor
  • 26 replies
  • February 13, 2024
jamf-42 wrote:

Good point! Cache the policy (set to ongoing and offline ) and set it to run at startup or login, 


I setup a policy with just Files and Processes, input the Execute Command for my one-liner command. I set the frequency to Ongoing (available offline) and triggers to Startup and Login. Hopefully this will work as expected.


Forum|alt.badge.img+5
  • Author
  • Contributor
  • 26 replies
  • February 13, 2024
jamf-42 wrote:

Good point! Cache the policy (set to ongoing and offline ) and set it to run at startup or login, 


Just to confirm, If I have the policy set to Ongoing (available offline) but the triggers are only Startup/Login, then it will only trigger during every Startup/Login event, right? It will not run the policy every check in unless I select Recurring Check In? Just worried about network/device performance with running this command too often. 


jamf-42
Forum|alt.badge.img+17
  • Esteemed Contributor
  • 744 replies
  • February 13, 2024
healthcareaa wrote:

Just to confirm, If I have the policy set to Ongoing (available offline) but the triggers are only Startup/Login, then it will only trigger during every Startup/Login event, right? It will not run the policy every check in unless I select Recurring Check In? Just worried about network/device performance with running this command too often. 


correct.. but test with startup.. test with login... see what works best.. 


sdagley
Forum|alt.badge.img+25
  • Jamf Heroes
  • 3546 replies
  • February 13, 2024
healthcareaa wrote:

Yes it should have. I have a few users that are still on 14.1, 14.1.2 that are having the issue. Hopefully the latest OS version fixes this bug. It leaves the user dead in the water until we can resolve. 


Any reason you're not having those users update to 14.3.1? Unless you're running Jamf Pro on-prem and older than JSS 11.0 you can use the Declarative Device Management Scheduled Update capability added with macOS Sonoma to easily force a deadline for the upgrade.


Forum|alt.badge.img+5
  • Author
  • Contributor
  • 26 replies
  • February 13, 2024
sdagley wrote:

Any reason you're not having those users update to 14.3.1? Unless you're running Jamf Pro on-prem and older than JSS 11.0 you can use the Declarative Device Management Scheduled Update capability added with macOS Sonoma to easily force a deadline for the upgrade.


We have been manually prompting users to update. 

How do we schedule forced upgrades?


jamf-42
Forum|alt.badge.img+17
  • Esteemed Contributor
  • 744 replies
  • February 13, 2024
healthcareaa wrote:

We have been manually prompting users to update. 

How do we schedule forced upgrades?


create smart group with scope for macOS 14.x - then use the beta software update to send the update with a scheduled complete time. 

scope on a small group 1st to test and understand the workflow, then expand the scope of the smart group


Forum|alt.badge.img+5
  • Author
  • Contributor
  • 26 replies
  • February 13, 2024
jamf-42 wrote:

create smart group with scope for macOS 14.x - then use the beta software update to send the update with a scheduled complete time. 

scope on a small group 1st to test and understand the workflow, then expand the scope of the smart group


To be honest, it doesn't look promising with the reviews I have been reading. I may stay off it for a while until they have better reliability. 


jamf-42
Forum|alt.badge.img+17
  • Esteemed Contributor
  • 744 replies
  • February 13, 2024
healthcareaa wrote:

To be honest, it doesn't look promising with the reviews I have been reading. I may stay off it for a while until they have better reliability. 


what reviews.. ? citation required.. I have the whole fleet on 14.x  

Apples line is, the only secure version of macOS is the most up to date.. and if your in any business that does compliance.. its a requirement. 


Forum|alt.badge.img+5
  • Author
  • Contributor
  • 26 replies
  • February 13, 2024
jamf-42 wrote:

what reviews.. ? citation required.. I have the whole fleet on 14.x  

Apples line is, the only secure version of macOS is the most up to date.. and if your in any business that does compliance.. its a requirement. 


Reading through the MacAdmins Slack channels


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings