3

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.

2
  • 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. Commented May 27, 2011 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
    Commented May 28, 2011 at 1:36

4 Answers 4

4

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.

8
  • 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
    Commented May 28, 2011 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
    – Matt
    Commented May 28, 2011 at 1:38
  • Where destination is where you want the remote filesystem mounted at
    – Matt
    Commented May 28, 2011 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.
    – Matt
    Commented May 28, 2011 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
    Commented May 28, 2011 at 1:48
2

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

1
  • 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
    Commented May 27, 2011 at 20:31
1

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

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .