Primeiro, você precisa se certificar de que tem SSH ativado no seu Mac. Se não, você precisa ativá-lo.
systemsetup -setremotelogin on
Agora, você precisa criar um grupo que possa fazer login remoto.
dseditgroup -o create -q com.apple.access_ssh
Depois disso, você precisa adicionar usuários a esse grupo. Apenas usuários ou grupos de usuários vinculados a esse grupo terão acesso de login remoto.
dseditgroup -o edit -a admin -t group com.apple.access_ssh
Agora você tem o SSH no seu Mac, que pode aceitar conexões remotas.
Para se conectar ao seu Mac, no Ubuntu você precisa digitar o seguinte comando
ssh user@remote_host
remote_host is the IP address or domain name of your remote PC. The Mac in this case. To get IP of your Mac, type in
ifconfig. user is the username.
Para copiar arquivos, você precisa usar scp ou Secure Copy.
Comando básico para scp é:
scp user@remote_host:Doccuments/file.txt /some/local/directory
Note: SSH might not work straight away on Mac in single user mode. If it returns an error that says network is not up, try this:
launchctl load /System/Library/LaunchDaemons/com.apple.kextd.plist launchctl load /System/Library/LaunchDaemons/com.apple.notifyd.plist launchctl load /System/Library/LaunchDaemons/com.apple.configd.plist launchctl load /System/Library/LaunchDaemon/com.apple.DirectoryServices.plist launchctl load /System/Library/LaunchDaemon/ssh.plist