Using SSHFS on a Mac with a password-protected private key - macos

Hey guys, I have a remote fileserver that I use to host my music/movies. I have a laptop and desktop, and wanted to share my files between the two, without the files actually being on either machine, so I employed an old dying laptop to host an SSH server, plugged into my external drive.
I have sshd configured on the server to accept connections using my password-protected private key, and it works great using applications like Cyberduck. The problem is, I want to be able to open iTunes and point it to my remote library. (Obviously iTunes would only work while the share is mounted.) Similarly, if I want to watch a movie, I don't want to have to copy it to my desktop, wait for the transfer to finish, then start watching. I want to double-click the file, and have it stream to my laptop as if it were a local file.
The problem is, I tried installing sshfs from this site:
sshfs for Mac OS X
But I can't figure out how to provide a private key, let alone a password-protected one. I'm new to SSH server configuration, so if I'm leaving out any crucial information, let me know.
Thanks!

You might first want to use the standard sshfs for OS X which is included with MacFuse here. Using that, it supports reading the $HOME/.ssh/config and ssh keys just like the standard command line ssh client. Try getting a connection working with ssh client and then use the same username and host name for the sshfs mount. I use exactly this setup with iTunes for accessing my music library remotely. However, if the machines involved are both OS X systems and on the same network (so that Bonjour discovery works), current versions of iTunes allow automatic sharing of music libraries, as long as you are willing to keep iTunes running on both. See iTunes -> Preferences -> Sharing.

Related

How can I use SSH to rsync an attached external volume on a Mac server?

I've got several servers (mac, linux, etc).. The Mac has an external HDD attached to it (yeah, Mac - you can no longer add internal drives, because only pro's would want that, and we can't allow pros to use Mac, because we're special!)...
Anyway. so the attached volume - let's call it "Bob"
it's on /dev/disk5s1/
or it's on /Volumes/Bob/
Now my linux servers need to access Bob.
I've already shared public keys from the linux box, so my linux server can ssh into the Mac, and can access its internal drives without passwords, etc.. the linux can fully access internal drives on the Mac..
so I have chrons doing standard backups - like rsync -a macsucks#10.1.12.122:/Library/Datastuff/Backups/....
These auto chrons are wonderful and they prevent me from having to touch a mouse on the mac.
However, I'm unsure of how to get to Bob, and pull/push data to Bob. Because Bob is special.
So, if, say: ls -lh macksucks#10.1.12.122/..... I can get to the internal HDD, but can't get to the external drive, becuase it's mounted on /, not mounted on the macsucks user.
so if i'm ssh'd into the linux box, and tell it to do that (ls -lh ....), no matter how I try, i get a response of: "No such file or directory"...
HOW can I touch this external drive using ssh for doing remote data access?
thanks!
I don't know how to mount or call Bob, to get it to show up externally..
kinda lost..

OS X 10.10.5 and Windows 7 file sharing

So what I want to do is share files between windows 7 pc and Macbook Pro Yosemite 10.10.5 using ethernet.
I managed to make it work really easily in the past but now it doesn't.
I have looked a bunch of tutorial online,I changed sharing settings,I have changed the settings of the ethernet adapters infinite times(manual ip,same subnet mask).I have restarted both computer a dozens times each, I have modified the register LmCompatibilityLevel with the values 1-4 with no luck.
After my fresh install of Windows 7 I managed to connect to windows PC from the macbook with the Go to Server tool over WiFi on the other hand the windows pc still can't see my macbook and on the network settings the LAN connection is displayed as "Unidentified".
I have no clue what I should do.At this point I just look at forums,tutorials and follow them blindly.
Maybe there is a third party program that could help me?
[ Windows 7 32 & 64bit(I tried both) , MacBook Pro (13-inch, Mid 2009) ]
I run Yosemite 10.10.5 on a 2013 Macbook. I got here researching a floating-point calculation issues I seem to be having with the Mac, running some machine-learning software.
I have to share files among various Windows machines, the Macbook (running 10.10.5), and a bunch of different Linux boxes. To make it seemless and simple, I've put ssh and scp on all of them, and just use "scp" to copy files between any pair if machines or devices. "scp" stands for "secure copy". You can also use "ssh" (secure shell) to log into one machine from another.
The syntax for scp looks like this:
scp myfile_here.txt MyUserID#SYSTEMname:/home/MyUser/filedir/.
The above command, which you enter in "cli" (command line interface) mode (basically just a terminal window or a Windows CMD shell), will securely copy "myfile_here.txt" over to the machine called "SYSTEMname", and put it into directory "/home/Myuser/filedir/". The little dot just means give it the same name. Instead of SYSTEMname, you can also use the numeric address of the machine (in either IPv4 or IPv6). On a windows machine, you can go to CMD shell, and type: "ipconfig /all" to get the machine's IP address. On the Macbook, you can click the little wifi indicator, then select "Open Network Preferences", click "Advanced", click "TCP/IP", and get the IPv4 address of you Macbook. OR, start up a "Terminal" window, and enter "ifconfig", and look at what is says for "en1". So then, the 'scp' command becomes:
scp myfile_here.txt MyUserID#nnn.nnn.nnn.nnn:/home/MyUser/filedir/.
where nnn.nnn.nnn.nnn might be something like 192.168.112.170
or whatever number you need to use (this example is an IPv4 style number)
I think scp and ssh might be included on the Macbook. If not, then maybe you have to download the "command line utilities" from Apple, which you can do, if you install the "Xcode7.2.1" C language compiler from them (it is free.) Google around and you can find a link.
To get ssh and scp on a Windows-7 machine, you need to install the Cygwin stuff. (See link below). You will also need to have the OpenSSH package, which may be installed as part of Cygwin. I put a link to a site that explains this. Check lots of sites. Don't just blindly install stuff without understanding exactly what it is doing. There is a real learning curve here, but it is worth spending the time to climb it.
If you get a Raspberry PI or jailbreak an old iPad, you can put the same ssh and scp programs on them, and then share files (including big video and music files) using these same programs. You will need to spend some time learning Linux stuff (the programs and the various utilities), but it will be time well spent, if you plan to do any work with computers and modern devices. Just google-search "ssh and scp" and read.
If you are using an older windows box (maybe you need to get some files off it), you can try "putty", which is just a graphic interface for the scp and ssh utility programs. Here are some URLS:
Putty: http://www.math.utah.edu/~beebe/software/ieee/
SSH: https://support.suso.com/supki/SSH_Tutorial_for_Windows
Linux ssh and scp: https://linuxacademy.com/blog/linux/ssh-and-scp-howto-tips-tricks/
SSH and SCP on Windows-7: https://www.question-defense.com/2010/01/07/how-to-install-scp-and-ssh-on-windows-7-using-cygwin
Just read this below. I think you have to enable ssh and scp on Mac OSX to get it to work. Apple has it turned off by default, but you can turn it on. Here is a site that explains this:
http://osxdaily.com/2011/09/30/remote-login-ssh-server-mac-os-x/
Hope this is helpful.

Debugging Playbook using SSH

I am using one of the cross platform sdk (marmalade if you need more details) to develop a game for blackberry playbook. The SDK do not provide any mechanism to debug apps on playbook device, so I've to use command line to do this. I've searched about this and I've got to know that I need to connect to playbook to my mac over SSH connection and get the log files stored in appdata.
I am successful in connection my playbook to my mac using SSH, now nowhere the next step is mentioned. I've never used SSH before and don't know how it can be used to transfer files. SO my question is how can I debug or get logs from playbook using SSH, once the SSH connection is done.
PS: Please tell the answer considering I've a Mac, not windows PC.
FInally got it. Actually I thought there'd be some command line utility to find the log files. I just downloaded FileZilla(Any sftp client will do), copied the added private key and connected to the already ssh connected playbook. I can now download the logs from the appdata.

Is it possible to have a makefile step in a host OS execute a shell command inside a guest OS running in a VM?

I'm currently developing apps for the inPulse watch (if you're a geek, check out www.GetInPulse.com) and am compiling for the watch while on a Mac. But deploying the app to the device takes several minutes. They do however offer a simulator, but that only runs under Linux so I installed Ubuntu in a VM, which works great.
What I'm hoping is to stay completely on the Mac side, except be able to execute a build step or shell script that can 'call into' the VM and launch a shell script there which kicks up the simulator. That way I can just add 'sim' as a step in my makefile back on the 'mac' side.
Currently, I'm mousing back and forth too damn much and I have terminals open all over the place in both the host and the guest OSes. Just trying to clean that up and cross-machine scripting seems like it would work in theory. Just don't know if the boundaries of cross-machines are even a valid thing.
The host OS doesn't know what a “shell” is inside the guest. A shell is an OS-dependent concept, and while the host OS technically knows everything that's going on in the guest, its only contact is by observing the guest memory and the instructions it runs, altogether the wrong level of abstraction here.
The most natural way to run shell commands from one OS to another is to use a remote shell facility over a network link; in practice, that means SSH. You need a network link between the two machines, and once you have that, it doesn't matter that one is a VM running inside the other. There probably is a network link already between the two machines; in case there isn't, make sure you activate a bridged network or a host-only network or whatever your VM technology offers.
Install an SSH client on the host (there's probably one already) and an SSH server on the guest (openssh-server Install openssh-server http://bit.ly/software-small). Then set up public-key authentication between the two machines so you don't need to type a password all the time.
You'll get shell access on the guest. If you need to manipulate GUI applications, you'll need to work a little more than that. ssh DISPLAY variable may help, or perhaps How can I run Firefox on Linux headlessly (i.e. without requiring libgtk-x11-2.0.so.0)?.

What tools do you use to upload files to amazon ec2 Linux instances?

I am using the standard fedora AMI with the LAMP stack bundled and I want to upload files onto the server from my Windows desktop.
What is the "normal" approach for this? I am not a UNIX admin by any stretch, although I am more than comfortable with FTP and the basics of a BASH shell.
As far as I can see there is no FTP server installed by default on the remote virtual machine, and I am unable to open one up at my end because of firewall restrictions. I looked at WinSCP, but before I go to the lengths of installing and configuring that I wondered what the expected means of doing this might be. In any case I don't see how WinSCP or any other FTP based tool can work without the target machine listening, which implies something like and FTP server.
Is there anything like a Windows remote desktop connection?
I could mount an S3 elastic storage volume from within EC2, but it is a bit of a sledgehammer to crack my little nut of just wanting 100k of files copied up to the server.
This is a different question to getting my web application running on the virtual server to save files locally, which is what the other SO questions in a similar vein seem to be asking.
Any ideas welcome.
I use putty's psftp, which uses ssh. If you can ssh into the box, then psftp should work.
http://www.chiark.greenend.org.uk/~sgtatham/putty/
You will first need to convert your pem private key to a ppk using puttygen for psftp to use the keyfile for authentication because it only uses ppk format and not pem format, as far as I know.
You've made the right choice with WinSCP. SCP is based on SSH, not FTP, and SSH and SCP are standard on Linux servers. So, WinSCP takes a bit of configuration bit its the simplest. Your alternative would be to install and maintain and FTP server - a lot more work there! There are equivalents to Remote Desktop but they're way more complicated to setup.
If you're having trouble with configuring your SCP program with your key but you have the ability to "shell" in, you could create a new linux user on the server with a password, then you can use that password instead of the key in WinSCP which is easier.
"In any case I don't see how WinSCP or any other FTP based tool..."
SCP (and SFTP, for that matter) is an entirely different protocol from FTP. Data is transferred over an SSH channel. If you have SSH access to your virtual machine, SCP/SFTP should work.
If you prefer a graphical tool, have a look at the S3Fox Firefox plugin (my choice), or peruse this list of standalone graphical S3 browsers.
For S3 I use Cyberduck (on Mac) and S3Fox. For mass uploads (in scripts) I use s3sync. I manage EC2 Instances with ElasticFox and original ec2 Tools from Amazon.

Resources