I have some Bash scripts that copies files from one mac to another trough the LAN, but I need to be logged on to the other mac for the scripts to work. It's a bit cumbersome to go trough Finder to do it, althoug the other mac shows easily enough in the "shared" pane. I want to do it trough the Terminal, just using regular !#/bin/bash.

I notice it is still possible to access another mac trough Finder even though SSH is turned off in the system panel, thus I wonder if there is some other way to do this trough the Terminal, without using SSH.

Edit: Thanks to envalid, I now know that what I want is to mount another MacBook trough the terminal, but I'd really like to know how, as my attempts until now have failed.

link|improve this question
By "access another Mac through Finder" do you mean browse the folders and files? View and control the screen? Check System Preferences > Sharing on the Mac you are accessing and tell us what is activated. – William Jackson May 27 '11 at 21:12
Browse files and folders on the other MacBook trough the terminal. File sharing is activated. SSH will not be activated. Thanks to envalid, I now know not that I'd really like to know how to mount another MacBook trough the terminal. – Kebman May 28 '11 at 1:36
feedback

migrated from stackoverflow.com May 27 '11 at 20:10

This question came from our site for professional and enthusiast programmers.

4 Answers

up vote 4 down vote accepted

When you mount a computer/partition/image with finder it shows up in /Volumes/.

For instance I just mounted a .dmg:

ninth:Volumes sakkaku$ ls -l
total 8
lrwxr-xr-x  1 root     admin    1 May 19 17:21 Ninth -> /
drwxr-xr-x  9 sakkaku  staff  340 May  4 14:11 ExampleMountedDMG

Bonus: You can automate the mounting of volumes by going to System Preferences -> Accounts then click the "login items" tab. Click the + and select the mounted volume.

link|improve this answer
Cool! This might be what I'm looking for. Can't get it to work, though... How do you mount another MacBook trough Terminal? – Kebman May 28 '11 at 1:16
2  
Use finder to mount to location then save it to the login items. Or you could use mount_afp afp://[username:password]@rhost[:port]/volume destination – sakkaku May 28 '11 at 1:38
Where destination is where you want the remote filesystem mounted at – sakkaku May 28 '11 at 1:38
Honestly if you are going to connect like that you are better off using ssh+sftp, scp, rsync or another protocol as it will be easier IMO. – sakkaku May 28 '11 at 1:39
Thanks a lot! This is very helpful. Will regular cp-commands still work trough ssh? And will it be as quick as mount_afp? – Kebman May 28 '11 at 1:48
show 3 more comments
feedback

How about using ssh to log in to the other machine? Google "ssh tutorial mac" and go "I feel lucky"

link|improve this answer
I notice it is still possible to access another mac trough Finder even though SSH is turned off in the system panel, thus I wonder if there is some other way to do this trough the Terminal, without using SSH. – Kebman May 27 '11 at 20:31
feedback

You can remotely login to the system by using ssh <username>@<remote Mac's IP address or hostname>.

link|improve this answer
feedback

My guess is that your finder works due to some RPC or OS management built into OSX -- that is not related to terminal. SSH is a secure shell (terminal) and is the way to remotely manage a machine via command line.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.