ssh in max?

Luke Woodbury's icon

I've been trying to ssh on to a server from within max without success. The most promising method seems to be with [shell] where I get prompted for a password, but can't seem to get it to register though I've tried lots of different ways.

Has anyone had success with ssh from Max?

Jan M's icon

Haven't tried ssh in Max yet, but if you set up an SSH key login you won't be asked for a password + it's more secure. As you already have ssh access that should be no problem. But it will limit the access to registered machines only ....

Luke Woodbury's icon

Thanks Jan, I did look at this, but wasn't sure if it would suit my needs. The app needs to be portable, but will only be used on a few machines and I'm not sure if I'll be able to set them up? Could I just copy the key file across or is it linked to the machine? Not that familiar with shell stuff!

Jan M's icon

Hi Luke,
ssh keys are bound to the machines, but it's not hard to set this up. It's a two part key (private and public). you need to copy the public key (usually a file called ~/.ssh/id_rsa.pub)to the (inside the home directory of the user as which you want to log in) and then add it to a file called ~/.ssh/authorized_keys using the cat command. Afterward you can delete the id_rsa.pub from the server.

In case you are generating a new key, leave the passphrase empty, otherwise you will have the same problem as with passwords again...

cat path/to/id_rsa.pub >> ~/.ssh/authorized_keys

that's it. The only thing to have an eye on in case you have to create the .ssh folder and authorized_keys file are the permission.
.ssh needs to be 700 (command: chmod 700 ~/.ssh) and authorized_keys 600 (chmod chmod 600 ~/.ssh/authorized_keys).

+ there are also really a lot of tutorials around, so that part should not be stopping you... ;)

Luke Woodbury's icon

What I mean is that I possibly won't be there to set up the other machines and it might be a bit much to ask them to do. I'll have another look at keys though, thanks Jan.

Luke Woodbury's icon

Sorted this out with [shell]

ssh servername
penter password

Then penter for commands too:
penter cd
penter ls
etc etc

mmd's icon

Dear Luke, I'm also trying to ssh into my Raspberry Pi with the shell object, but the whole 'ssh' command isnt responsive.

All other types of commands like ifconfig, date etc. do work and output their feedback through the print stdout, but ssh does not seem to respond :( Just a done bang.

Do you have any clue why this is, and what I can do about it?

Thanks so much.

Mischa

Luke Woodbury's icon

All I can say is that the above worked for me. Did you successfully ssh onto it directly from the terminal?

mmd's icon

yep sshing to the raspberry all the time from terminal.
that wasnt a problem at all. btw I use max 5 on osx

the weird thing is that the whole ssh command doesnt do anything. its not that I cannot get through because of the password prompt.

which max version do you use?

Luke Woodbury's icon

So no error or anything? Sorry, not sure why that would be.

I was on Max 6, OS X at the time I did this.

mmd's icon

now that i have registered the ssh keys it works fine!

Thomas's icon

Hi MMD,
where did you registered the ssh key ?
Thanks
Thomas

Nodanoma's icon

Has anyone had any success parallel ssh to control different hosts from MaxMSP?
The [shell] object is great, albeit, it does come with caveats and doesn't support everything a terminal would.

@macos 10.12

Would love to do it from Max and not the Terminal. Thank you everyone.


Nodanoma's icon

actually, just managed this myself. simply address two [shell] objs with different IPs and send all subsequent commands to both. works like a charm.

however, I installed pssh and csshX on my system and cannot guarantee that this works without these installations.