Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have some Windows PCs on my network. I have Mac OS X. I try to access some Windows PCs in the network to read and write files. In OS X Finder, I see the computer_name and I can connect as Guest. But in the terminal, how can I do that?

I tried ssh computer_name, but it says "connection refused". I tried ssh asdfasdf (a computer_name that does not exist) and it gives me the same "connection refused". The leads me to suspect ssh computer_name is not the right command to access a computer, which I found on the SU answer and google.

share|improve this question
1  
Not an answer, but some information: ssh is a way to connect to computers that are running an ssh server. Most (if not all) UNIX-y systems (including OS X and Linux) can run ssh servers, and these can be easily turned on with built-in software. Desktop Windows does not (to my knowledge) come with an ssh server to turn on, though you (presumably) could get one and install it. (This is not an answer as I can neither point you to a Windows ssh server package nor do I know any alternative solutions.) –  CajunLuke Jan 6 '12 at 1:22
    
Just as FYI. Syntax of ssh is 'ssh username@10.10.10.10'. –  Paperlantern Jan 6 '12 at 2:29
    
but i only know the computer name, not IP information... –  KMC Jan 6 '12 at 2:34
    
For ssh, you can use computer name as well, but again i was just building on his info, this doesn't answer your question, this is for ssh to other *nix machines, see below for my direct answer. –  Paperlantern Jan 6 '12 at 3:00

3 Answers 3

up vote 1 down vote accepted

(Side note: If “ssh asdfasdf” says “Connection refused” rather than some variant of “unknown hostname”, then your ISP is doing the mildly nasty thing of “DNS redirection” which is intended to serve you a search page (to their profit) when you mistype a URL. This means they are running non-standards-compliant nameservers and software you run (that isn't a web browser) may be confused by it.)


For mounting network filesystems from the command line, the first thing you need to do is get the full URL. To do that, once you've got it up in the Finder, Get Info and look at the “Server:” field.

Then, to reproduce that in the Terminal, run open with that URL:

open smb://computer_name/share_name

You will get a dialog box requesting your credentials. Or, you can include your username and then you won't be prompted, provided that your password is in your Keychain:

open smb://your_username_on_that_computer@computer_name/share_name

(Apple file sharing is just the same, but with afp: instead of smb:.)

If you really need to do it with no GUI, you'll have to (as far as I know) do the mount directly (which requires you to manually specify its location in the filesystem by creating an empty directory). Here's an already-written answer: How can I easily mount a Windows share from my Mac?

share|improve this answer
    
Ah, this works but just opens it in the gui, the way i read it, he wanted to be able to browse the contents once connected while still in terminal. This does get you to the share as well though. –  Paperlantern Jan 6 '12 at 2:55
1  
Just cd /Volumes/share_name if it's already mounted. –  Kevin Reid Jan 6 '12 at 2:58

Windows does not support SSH natively. You can install a program like Cygwin or MinGW to get SSH functionality. Alternatively you can just enable Telnet which is native to Windows, but much less secure than SSH.

share|improve this answer

As for the answer to the question, if my memory serves me the syntax is

mount_smbfs //whoami@SERVER/share/ /SERVER/share

SERVER can just be a computer as well, it would be any computer share, not necessarily a SERVER.

whoami is the username of the user you want to connect to the server with, you can't just connect to any old folder share on a windows box without the computer knowing its okay for you to do so.

If you are using this format, you'll have to create the folder /SERVER/share on your hard drive, it represents the full path, so the mount point has a place to go. Once the command is executed, that folder then becomes pointed at the share for that session and can be browsed through gui or terminal.

share|improve this answer
    
i do not understand your writing. What is "memory serves"? Is it related to the memory information of the computer? What is "mount_smbfs" is it a unix command? –  KMC Jan 6 '12 at 2:36
    
I tried in terminal 'mount_smbfs // whoami @computer_name', it gives error "could not find". What is whoami and @SERVER? is it an IP? I do not have any IP. Only computer name. Between windows machine, I only need to type on run: \\computer_name. –  KMC Jan 6 '12 at 2:38
    
Yeah windows is friendlier to it's "kin" heh, windows speaks windows. OSX doesn't speak windows unless you tell it too, smbfs is the command to tell it to use the samba communication so to speak. Also, the second path, is where you want to mount it to, such as the folder SERVER and the folder SHARE in your home folder on your mac. –  Paperlantern Jan 6 '12 at 2:45
    
Correction, it has been a while since I've done this through terminal, i usually just use the "Go" menu. the final /SERVER/Share bit represents the FULL path of the mount point, so if you created it in your home folder it would be /Users/yourusername/SERVER/Share –  Paperlantern Jan 6 '12 at 2:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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