Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > SSH and Mac OS X?

SSH and Mac OS X?
Thread Tools
Mac Enthusiast
Join Date: Feb 2001
Location: Work: NYC Live: NJ
Status: Offline
Reply With Quote
Jun 3, 2003, 10:45 AM
 
Disclaimer: If the below doesn't make total sense it is only because I only *think* I know what I'm talking about, that's why I'm taking the course

I'm taking a course this summer that requires me to use SSH to connect to a UNIX box running Oracle. We have PCs in the lab (yuck) and are using an app called Putty to connect via SSH to the box.

My questions are as follows:
  • Is it possible to connect to the UNIX box using SSH in OS X?
  • If it is possible, what would be the best app to use to connect via SSH?
  • If it is possible, can I connect via SSH using the terminal?
Any help would be appreciated.
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jun 3, 2003, 11:13 AM
 
Originally posted by shadybirdstan:
Is it possible to connect to the UNIX box using SSH in OS X?
Yes.
If it is possible, what would be the best app to use to connect via SSH?
OpenSSH via the terminal ("ssh").
     
Mac Enthusiast
Join Date: Feb 2001
Location: Work: NYC Live: NJ
Status: Offline
Reply With Quote
Jun 3, 2003, 11:28 AM
 
Originally posted by Angus_D:
Yes.OpenSSH via the terminal ("ssh").
Thanks so to connect to the ip 111.11.1.11 (censored ) on port 22 what would I enter?

I would also have to enter in my username and password somehow. The screen that pops up after typing ssh isn't much of a help .

Thanks.
     
Senior User
Join Date: Nov 2000
Status: Offline
Reply With Quote
Jun 3, 2003, 11:32 AM
 
Originally posted by shadybirdstan:
Thanks so to connect to the ip 111.11.1.11 (censored ) on port 22 what would I enter?

I would also have to enter in my username and password somehow. The screen that pops up after typing ssh isn't much of a help .
ssh username@host

Enter password when prompted.

Be amazed at OpenSSH.

- proton
     
Senior User
Join Date: Feb 2003
Location: USA
Status: Offline
Reply With Quote
Jun 3, 2003, 11:34 AM
 
I connect to my Linux box on the network using ssh -X -l username. The -X lets me run X apps, the -l lets me specify the user. After being prompted for the password I'm in and can run basically everything that's on the Linux box. Very cool!

Steve W
MacBook 2.0 160/2GB/SuperDrive
Lots of older Macs
     
Mac Enthusiast
Join Date: Feb 2001
Location: Work: NYC Live: NJ
Status: Offline
Reply With Quote
Jun 3, 2003, 11:50 AM
 
Originally posted by proton:
ssh username@host

Enter password when prompted.

Be amazed at OpenSSH.

- proton
Awesome I got it working .

Maybe now I'll just run my laptop in the lab instead of that nasty PC .

Any of you ever use JellyfiSSH? Looks like a handy app.
     
Dedicated MacNNer
Join Date: Nov 2002
Location: Chapel Hill, NC
Status: Offline
Reply With Quote
Jun 3, 2003, 08:35 PM
 
You'll have to check to see if it connects, but I use Fugu as a ssh ftp client as well as teminal. You may want to check it out from versionTracker.

Uisce
     
Mac Enthusiast
Join Date: Feb 2003
Location: Portland, Oregon
Status: Offline
Reply With Quote
Jun 3, 2003, 09:05 PM
 
You can also create a handy alias for that connection if you're going to be logging into it often. I'm a CS major, and I have to login to my University's Sun box constantly, so to help automate the process, I created an alias:

odin ssh -X -l username address

So that in terminal all I have to do is type in the command

username% odin

and my laptop will connect. Nothing mind boggling here, but you sound as though you're a bit new to this sort of thing, so I figured it might help.
jesse ;-)
     
Baninated
Join Date: Jun 2000
Location: Cambridge, Chicago, Jerusalem (school/home/heart)
Status: Offline
Reply With Quote
Jun 3, 2003, 09:31 PM
 
Yup, just need to go to terminal and type in:
ssh username@host

you can type in man ssh for more switches
     
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status: Offline
Reply With Quote
Jun 3, 2003, 11:25 PM
 
Originally posted by jessejlt:
You can also create a handy alias for that connection if you're going to be logging into it often. I'm a CS major, and I have to login to my University's Sun box constantly, so to help automate the process, I created an alias:

odin ssh -X -l username address

So that in terminal all I have to do is type in the command

username% odin

and my laptop will connect. Nothing mind boggling here, but you sound as though you're a bit new to this sort of thing, so I figured it might help.
jesse ;-)
Or you could make it double-clickable in the Finder, by saving it as a shell script with a file name ending in ".command" and make sure it is executable (chmod 755).

Then you can have a file for each server you want to ssh into, and just double lick on the server you want to ssh to, and the Finder will cause that shell script to run in the Terminal.
     
Mac Elite
Join Date: Jul 2002
Status: Offline
Reply With Quote
Jun 3, 2003, 11:36 PM
 
Sweet. I didn't know I could do that. Thanks!
     
Fresh-Faced Recruit
Join Date: Jun 2003
Status: Offline
Reply With Quote
Jun 4, 2003, 12:57 AM
 
Yeah, thats really cool. I may have to try it out myself.
     
Xeo
Moderator Emeritus
Join Date: Mar 2001
Location: Austin, MN, USA
Status: Offline
Reply With Quote
Jun 4, 2003, 01:44 AM
 
Originally posted by jessejlt:
so to help automate the process, I created an alias:

odin ssh -X -l username address
You forgot "alias" in front of that.
     
Professional Poster
Join Date: Dec 2000
Location: Staffs, UK
Status: Offline
Reply With Quote
Jun 4, 2003, 02:21 AM
 
Originally posted by Brass:

Then you can have a file for each server you want to ssh into, and just double lick on the server you want to ssh to, and the Finder will cause that shell script to run in the Terminal.
Mmmmm. Tasty !
     
Clinically Insane
Join Date: Apr 2000
Status: Offline
Reply With Quote
Jun 4, 2003, 03:58 AM
 
Originally posted by Xeo:
You forgot "alias" in front of that.
He was only saying what task the alias completed.

Why not use PuTTY on the PC's? It's a great ssh client.

Make it full screen, and you don't even have to look at anything Windows (except the taskbar, I guess).

But hey, whatever blows your whistle.
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jun 4, 2003, 10:36 AM
 
Originally posted by Cipher13:
Why not use PuTTY on the PC's? It's a great ssh client.
Well:
We have PCs in the lab (yuck) and are using an app called Putty to connect via SSH to the box.
     
Posting Junkie
Join Date: Sep 2001
Status: Offline
Reply With Quote
Jun 4, 2003, 11:26 AM
 
Ahh, SSH. I discovered the joys of Unix months back. SSH is awesome. Even cooler talking on the phone with your grandma while she's in your room and making your computer talk from miles away to scare the crap out of her.
     
Forum Regular
Join Date: Feb 2003
Location: Alpharetta, GA
Status: Offline
Reply With Quote
Jun 4, 2003, 07:32 PM
 
I tried the ssh username@host and it returned this error:

ssh_exchange_identification: Connection closed by remote host

I haven't talked to my sysadmin yet, but I thought someone here may have an answer too. Thoughts?
     
Banned
Join Date: Apr 2002
Location: -
Status: Offline
Reply With Quote
Jun 4, 2003, 07:37 PM
 
Originally posted by shadybirdstan:
Thanks so to connect to the ip 111.11.1.11 (censored ) on port 22 what would I enter?

I would also have to enter in my username and password somehow. The screen that pops up after typing ssh isn't much of a help .

Thanks.
You would enter 'man ssh' and RTFM

joke

On Windows I use PenguinSSH or whatever it's called. Just search for SSH @ download.com.
     
Mac Enthusiast
Join Date: Feb 2001
Location: Work: NYC Live: NJ
Status: Offline
Reply With Quote
Jun 5, 2003, 08:17 AM
 
Thanks for all the help guys. I was able to connect in from the terminal but downloaded JellyfiSSH and decided to use that. It makes it very easy to connect (only fill in the relevant fields), gives me bookmarks and lets me customive the terminal appearance for each bookmark (cool!).

Thanks for all the help some great stuff here. Now if I can only find out how to do what MindFad is doing I can scare people too!
Ahh, SSH. I discovered the joys of Unix months back. SSH is awesome. Even cooler talking on the phone with your grandma while she's in your room and making your computer talk from miles away to scare the crap out of her.
     
Mac Elite
Join Date: Aug 2001
Location: Madison, WI
Status: Offline
Reply With Quote
Jun 5, 2003, 10:15 AM
 
Originally posted by shadybirdstan:

Thanks for all the help some great stuff here. Now if I can only find out how to do what MindFad is doing I can scare people too!
sudo osascript -e 'say "Hello grandma. That is a lovely sweater you have on today." using "Victoria"'
OS X: Where software installation doesn't require wizards with shields.
     
Mac Elite
Join Date: Nov 2001
Location: Trafalmadore
Status: Offline
Reply With Quote
Jun 5, 2003, 01:01 PM
 
I am trying to scp into my box at home and I am having problems with copying from any folder which has a space in folder path. I put in the backslash, I have tried with quotes around it, but it fails such as shown below :
[scrossman:~/documents] mactech% scp mactech@24.52.xx.x:/Users/mactech/movies/space\ movies/001.mpg 01.mpg
mactech@24.52.xx.x's password:
scp: /Users/mactech/movies/space: No such file or directory

How do I fix this ?
     
Junior Member
Join Date: Apr 2002
Location: In spaaaaace
Status: Offline
Reply With Quote
Jun 5, 2003, 05:11 PM
 
You need both quotes and backslashes:
scp "mactech@24.52.xx.x:/Users/mactech/movies/space\ movies/001.mpg" 01.mpg
     
Mac Elite
Join Date: May 2001
Location: Vancouver
Status: Offline
Reply With Quote
Jun 5, 2003, 11:46 PM
 
Agreed and I use it all the time at work.

However, nothing beats Terminal.app with transparency...

Originally posted by Cipher13:
Why not use PuTTY on the PC's? It's a great ssh client.

Make it full screen, and you don't even have to look at anything Windows (except the taskbar, I guess).
Macbook (Black) C2D/250GB/3GB | G5/1.6 250GBx2/2.0GB
Free Mobile Ringtone & Games Uploader | Flickr | Twitter
     
Mac Elite
Join Date: Nov 2001
Location: Trafalmadore
Status: Offline
Reply With Quote
Jun 6, 2003, 07:47 AM
 
Originally posted by WombatPredator:
You need both quotes and backslashes:
scp "mactech@24.52.xx.x:/Users/mactech/movies/space\ movies/001.mpg" 01.mpg
Thanks, I will give that a try. Unfortunately, I put my tower to sleep when I came to work today.
     
Fresh-Faced Recruit
Join Date: May 2003
Location: New York
Status: Offline
Reply With Quote
Jun 7, 2003, 12:17 PM
 
you may run SSH as a server or a client.

As a client it is simple.
at the terminal run:

ssh -<protocol> username@machine

I always recommend using protocol 2 as it uses stricter integrity checking and encryption.

example: ssh -2 simon@10.0.4.20

To run the SSH server, there is some administrative work that needs to be done. The most important thing to do before starting is activate the root user in the netinfo manager app. I will give instructions that are more secure than just "getting it up and running". I apologize for some technical assumptions (use of vi, editing inetd.conf and using TCP wrappers), but as a sys admin for the govt., I really don't know how to do it the simple way...not allowed to do that.

Open a terminal session and su to root. As root:

cd /etc
vi sshd_config

In this file, remove the comments and edit the info as follows:

Port 22
Protocol 2,1
ListenAddress (insert your IP address)
HostKey /etc/ssh_host_key
HostKey /etc/ssh_host_rsa_key
HostKey /etc/ssh_host_dsa_key
PermitRootLogin no
StrictModes yes
DSAAuthentication yes
RSAAuthentication yes
(if you wish to allow display forwarding:
X11Forwarding yes)

now save the changes (:wq! or <shift>ZZ)

Once that is done the next step is to create the keys. Run the following 3 commands, waiting for each to complete as root:

ssh-keygen -t rsa1 -f /etc/ssh_host_key -N ""

ssh-keygen -t rsa -f /etc/ssh_host_rsa_key -N ""

ssh-keygen -t dsa -f /etc/ssh_host_dsa_key -N ""

if you reboot here, the server will run correctly, however, anyone will be able to log in to your machine if they know the username and password (or hack it until they get it). The remaining instructions are to secure it so that you can control access via IP with TCP wrappers.

In the terminal as root:
cd /etc
vi inetd.conf

Go to the end of the file and add the following line, with each entry tab delimited:

ssh stream tcp nowait root /usr/libexec/tcpd /usr/sbin/sshd -i

save the file

This allows tcp wrappers to control who has access to ssh requests. Now you have to tell tcp wrappers who can "play nice". As root:

cd /etc
vi hosts.allow

It will create the new file. Now add the following line to allow everyone to request a session:

sshd : ALL

I recommend restricting its access as follows. If all of you machines have Ip addresses in the range 192.168.0.x, then add this line to allow all machines on your network to ssh to the mac:

sshd : 192.168.0.

Add any other IP addresses you want to havve access, then save the file. The last step (hooray!) is to create the denial file:

cd /etc
vi hosts.deny

Add the following line:

ALL : ALL

Save the file. This basically says "if you aren't in the allow file....you can't do anything". Reboot the file....and whallah! Your mac is now an ssh server!
rm -rf /bin/laden
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:25 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2