- How to See What Users Are Connected & Logged In To a Mac
- See Users with Activity Monitor in Mac OS X
- List Connected Users & Log Ins to the Mac with “last”
- See Logged In SSH / Telnet Users with ‘who’
- Change your computer’s name or local hostname on Mac
- Change your computer’s name
- Change your computer’s local hostname
- Find your computer’s name and network address on Mac
- Find your computer’s name
- Find your computer’s local hostname
- Find your computer’s network address
- Change your computer’s name or local hostname on Mac
- Change your computer’s name
- Change your computer’s local hostname
- Find your IP Address on a Mac
- How to Find the IP Address on a Mac
- Find your IP Address via the Mac OS X Terminal
- Find your External Public IP Address in Mac OS X
How to See What Users Are Connected & Logged In To a Mac
If you share your Mac on a network you may be interested to know who is connected to the Mac at any given time. This may include listing currently logged in users through a variety of network protocols, even locally, or perhaps just a history of users logins over a period of time. While Mac OS X Client doesn’t offer the same level of information as Mac OS X Server, you can still find user connection details by using a variety of tools built into all versions of Mac OS X.
We’ll cover finding active user accounts through Activity Monitor, the ‘last’ command, and the ‘who’ command. This is fairly comprehensive, meaning it will include all users who are currently connected and/or actively logged onto a Mac, whether by another user account in the background, a Guest user account, general sharing from public folder access, a user connected through a local network share for the purpose of sharing files with another Mac, network users connected from Windows PC’s or linux machines through SMB, remote logins through SSH and SFTP, just about everything.
See Users with Activity Monitor in Mac OS X
The simplest way to get basic user details is to use Activity Monitor from an Administrator user account. This will be inclusive, but the data is a bit limited for some uses as you’ll see:
- Launch “Activity Monitor” in Mac OS X, found within /Applications/Utilities/
- Click on “Users” to sort and group the list by users logged in
If you’re looking for a specific user account, you can easily find that user as well as all the processes they are running, be it apps, services, or nothing, and what kind of resources they are using. Choosing the “Network” tab within Activity Monitor will offer details about user network usage as well, helping to indicate if they are copying or receiving files from the Mac to their own.
To properly make use of this information, you’ll want some basic understanding of what user accounts exist on the Mac (i.e. who is found in the /Users/ folder), but also understand the root / superuser account, in addition to services and daemon agents running in the background on all Macs, which may show up in the Users list with names like spotlight, netbios, usbmuxd, locationd, coreaudiod, window server, mdnsresponder, networkd, appleevents, amongst many others.
Ultimately, the ‘last’ command may prove more useful for those comfortable with the command line.
List Connected Users & Log Ins to the Mac with “last”
The command line tool ‘last’ offers a simple way to see a history of what users have logged into a given Mac, both locally and also through a network connection like AFP, the default sharing protocol for Macs. Using ‘last’ is simple enough, but you should have some familiarity with the command line to get the most use out of the utility and to comprehend the output.
Launch Terminal app, found with in /Applications/Utilities/ and enter the following command string to see a full list of user logins
To search for a specific user login, send the output of last through grep like so:
last |grep USERNAME
For example, to search last output for the user “OSXDaily” you would use the following command:
last |grep OSXDaily
This is case sensitive, so the user ‘osxdaily’ would be unidentified while “OSXDaily” will return positive results, thus be sure to use proper casing.
This will produce output looking something like the following, including all login dates, and when possible, the IP source of the connecting machine if the user was logged in through a network connection (in this screenshot example, the origin IP was identified as 192.168.1.4):
If no IP or network origin is shown, this indicates the user is logged in directly on the Mac, either through the standard Mac OS X login process, Fast User Switching, su / sudo, or something similar.
To see who is currently logged in through AFP, you can also use the following last command syntax:
last |grep «logged in»
Users who are actively logged in, whether through a remote connection or the local machine, will show “still logged in” as their status.
A potential hiccup for the ‘last’ command appears when you have users logged in through the SMB / Windows protocol, which is optionally enabled within Mac OS X to allow file sharing between a Windows PC and Macs, and users logged in to the Mac through SMB will not show always how up through the ‘last’ command output. This leaves a few other options, like using ‘netstat’ or, perhaps easier for most users, browsing in Network Activity from the Activity Monitor as was outlined at the beginning of this article.
See Logged In SSH / Telnet Users with ‘who’
Finally, you can see who is currently connected to a Mac through an active SSH connection or the antiquated Telnet protocol by using the classic ‘who’ command from the terminal:
This shows all instances of your own user account, as well as logged in users through a connection exterior to the Mac.
Know of another way to see what users are currently logged into a Mac? Share it with us in the comments!
Источник
Change your computer’s name or local hostname on Mac
Your computer’s name and local hostname are used to identify your computer on your local network.
Change your computer’s name
Your computer’s name is displayed at the top of the Sharing preferences pane.
On your Mac, choose Apple menu
> System Preferences, then click Sharing.
If the lock at the bottom left is locked , click it to unlock the preference pane.
Type a new name in the Computer Name field.
Change your computer’s local hostname
The local hostname, or local network name, is displayed beneath the computer’s name at the top of the Sharing preferences pane. It identifies your Mac to Bonjour-compatible services.
The local hostname is your computer’s name with .local added, and any spaces are replaced with hyphens. For example, if your computer’s name is My Computer, your local hostname is My-Computer.local. Local hostnames aren’t case sensitive, so my-computer.local is the same as My-Computer.local.
On your Mac, choose Apple menu
> System Preferences, then click Sharing.
If the lock at the bottom left is locked , click it to unlock the preference pane.
Click Edit, then enter a new local hostname.
If your Mac has the exact name of another Mac on your local network, a number is added to the local network name.
Источник
Find your computer’s name and network address on Mac
If other people want to locate your Mac on the network, they need to know your computer’s name or network address. Your Mac has several identifiers that people may look for on the network: computer name, local hostname (or local network name) and network address.
Find your computer’s name
If you’re sharing your computer’s screen or files, other users on your network can find your Mac by looking for its computer name.
On your Mac, choose Apple menu
> System Preferences, then click Sharing.
The computer name for your Mac appears at the top of Sharing preferences.
Find your computer’s local hostname
Your computer’s local hostname, or local network name, is displayed on your local network so others on the network can connect to your Mac. It also identifies your Mac to Bonjour-compatible services.
On your Mac, choose Apple menu
> System Preferences, then click Sharing.
Your computer’s local hostname is displayed beneath the computer’s name at the top of Sharing preferences.
The local network name is your computer’s name with .local added, and any spaces are replaced with hyphens (-). For example, if your computer’s name is My Computer, your local network name is My-Computer.local. Local network names aren’t case sensitive, so my-computer.local is the same as My-Computer.local.
Find your computer’s network address
If you’re sharing your computer’s screen, allowing remote logins or management, or sharing files, other users may need to know your computer’s network address instead of its name to access these services.
On your Mac, choose Apple menu
> System Preferences, then click Sharing.
In the list on the left, select a service that is On.
The network address for the service is displayed on the right. For example:
If you select Screen Sharing, the network address looks similar to vnc://10.212.167.33 or vnc://name.example.com.
if you select File Sharing, the network address looks similar to smb://10.212.167.33 or smb://name.example.com.
If you select Remote Login, the network address looks similar to username@10.212.167.33 or username@name.example.com.
If you select Remote Management, the network address looks similar to 10.212.167.33 or name.example.com.
Your computer’s network address is provided by the Domain Name System (DNS) server your computer uses. If you don’t use a DNS service, the network address is derived from your computer name.
Источник
Change your computer’s name or local hostname on Mac
Your computer’s name and local hostname are used to identify your computer on your local network.
Change your computer’s name
Your computer’s name is displayed at the top of the Sharing preferences pane.
On your Mac, choose Apple menu
> System Preferences, then click Sharing.
If the lock at the bottom left is locked , click it to unlock the preference pane.
Type a new name in the Computer Name field.
Change your computer’s local hostname
The local hostname or local network name, is displayed beneath the computer’s name at the top of the Sharing preferences pane. It identifies your Mac to Bonjour-compatible services.
The local hostname is your computer’s name with .local added, and any spaces are replaced with hyphens. For example, if your computer’s name is My Computer, your local hostname is My-Computer.local. Local hostnames aren’t case sensitive, so my-computer.local is the same as My-Computer.local.
On your Mac, choose Apple menu
> System Preferences, then click Sharing.
If the lock at the bottom left is locked , click it to unlock the preference pane.
Click Edit, then enter a new local hostname.
If your Mac has the exact name of another Mac on your local network, a number is added to the local network name.
Источник
Find your IP Address on a Mac
Knowing your Mac’s IP address is important for setting up a network or sharing files, here’s two different ways to find your IP address in Mac OS X; an easy way through the GUI and a more technical approach with the command line. These methods will be the same whether you are connected via ethernet or wireless.
This works the same in all versions of Mac OS X on all Macs.
How to Find the IP Address on a Mac
You can find any Macs IP, or your IP address from the Mac System Preferences Network configuration screen:
- From the Apple menu pull down “System Preferences”
- Click on the “Network” preference pane
- Your IP address will be visible to the right, as indicated in the screenshot below
Your IP address is the number listed, in the above case it is 192.168.0.100
Now we’ll cover the more technical approaches to getting your IP address using the Mac OS X command line:
Find your IP Address via the Mac OS X Terminal
This is how to find the IP address of your Mac through the Terminal, this is often the quickest way for those that are more technically inclined.
- Launch the Terminal located in /Applications/Utilities/
- Type the following command:
ifconfig |grep inet
- You will see something that looks like this:
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet 127.0.0.1 netmask 0xff000000
inet6 fe80::fa1e:dfff:feea:d544%en1 prefixlen 64 scopeid 0x5
inet 192.168.0.100 netmask 0xffffff00 broadcast 192.168.0.255
- Your IP address is usually next to the last entry of ‘inet’ and in this case is 192.168.0.100, an IP address is always in the format of x.x.x.x but it will never be 127.0.0.1 because that is your machines loopback address. Because you can always ignore 127.0.0.1, this guarantees that your IP address will be the other IP between ‘inet’ and ‘netmask’
The other command line option is to use: ipconfig getifaddr en1 which reports back only your en1 (usually wireless) IP address. You can change this to en0 for wired/ethernet too. I have heard ipconfig is not supported in all versions of Mac OS X so I did not recommend this as the first choice. However, using ipconfig you can also set your IP address from the command line.
Find your External Public IP Address in Mac OS X
Your external IP address is what is broadcast to the world rather than your local network (behind a wireless router, for instance).
You can find your external IP address easily by going to a website like Google and typing “what is my IP address” or by going to websites like “whatismyipaddress.com” and checking there.
This is easiest to find through a Terminal command a well:
curl ipecho.net/plain ; echo
This will instantly report back your external IP address. We covered this command when finding your external IP address in the past.
Источник