Comments (5)
Looked into the source code for hostname
and came up with something that could work (based on this answer in SO:
sudo sh -c 'scutil --get ComputerName | awk '\''{print "ComputerName: ", $1}'\''
scutil --get HostName | awk '\''{print "HostName: ", $1}'\''
scutil --get LocalHostName | awk '\''{print "LocalHostName: ", $1}'\''
defaults read /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName | awk '\''{print "NetBIOSName: " $1}'\'''
I imagine there might be a more elegant way of doing this, but I'm still learning bash 😃
Thoughts?
from m-cli.
Hello @clarkio , this is related to sudo and it can be configured in your sudo config file, you should add a line like this one
YOURUSER ALL=(ALL) NOPASSWD: ALL
And unfortunately most of commands requires permissions
from m-cli.
@rgcr thanks for the quick response.
Sorry for the potentially noob question, but can you elaborate more on what that will do? Does it essentially turn off any need for a password for my user account when root level commands are executed? If so, what if someone prefers a password to still be required for such commands due to security concerns?
from m-cli.
@clarkio, You can use PASSWD and NOPASSWD to specify whether the user has to enter a password or not.
And you are right, it will be annoying put the password multiple times, I have to improve that 👍
from m-cli.
As a quick workaround I've removed sudo in the commands that show the hostname
from m-cli.
Related Issues (20)
- m bluetooth command doesn't work HOT 2
- iTunes commands not working on macOS 10.15.6 HOT 4
- Firewall State 2 HOT 6
- Automated test suite
- Airdrop status outputs an error first use HOT 1
- `m trash status` return incorrect content info
- wallpaper command only sets wallpaper for current desktop HOT 2
- set wallpaper to hex color instead of image file HOT 4
- localhost operator uses wrong sed parameter HOT 2
- Fix hard coded default wi-fi interface HOT 2
- We can add more features to DNS plugin HOT 1
- Bash 5.1 errors, unary operator expected HOT 2
- Usage information not following POSIX standard HOT 2
- Headless HOT 1
- Combined itunes play/pause
- AirDrop off disables airdrop even after uninstall
- Roadmap HOT 1
- m bluetooth is not working in apple m1 pro
- m bluetooth is not working in apple m1 pro HOT 2
- Looking for maintainers HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from m-cli.