Posted in Uncategorized

ssh access passwordless

You need to ssh from “client” to “server” without a password.

On the “client”:

  1. generage ssh key pair

    ssh-keygen

  2. copy public key to “server”

    cat ~/.ssh/id_rsa.pub | ssh username@server "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"

Advertisements
Posted in Uncategorized

macos set hostname

Perform the following tasks to change the workstation hostname using the scutil command.
Open a terminal.
Type the following command to change the primary hostname of your Mac:
This is your fully qualified hostname, for example myMac.domain.com
sudo scutil --set HostName
Type the following command to change the Bonjour hostname of your Mac:
This is the name usable on the local network, for example myMac.local.
sudo scutil --set LocalHostName

Optional: If you also want to change the computer name, type the following command:
This is the user-friendly computer name you see in Finder, for example myMac.
sudo scutil --set ComputerName

Flush the DNS cache by typing:
dscacheutil -flushcache

Restart your Mac.