Connecting to server from Terminal in Lion

Joined
Nov 2, 2011
Messages
233
Reaction score
1
Points
18
Location
Pennsylvania
Your Mac's Specs
Mid-2012 15" MBP 2.6GHz i7, Late-2011 13" MBP 2.4 GHz i5, Early-2008 Mac Pro 2.8Ghz Xeon
Hello everyone, I was wondering what I need to type into terminal to connect to my server. I was only able to find one command and it doesn't seem to work. I have two Linux Ubuntu 11.10 (latestest version) servers and can connect to neither. Thanks in advance.

Here is the command I have been using. ssh username@server name.***.***.***.***
^^IP address^^
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
This all depends how you're trying to connect - what protocol are you connecting over? From the looks of it, you're trying to connect over SSH which is only going to work if the ssh daemon is started and configured on the Ubuntu box.

Second, you don't need the server name and the IP - stick with just the IP:
Code:
ssh username@<IP>
 
OP
1
Joined
Nov 2, 2011
Messages
233
Reaction score
1
Points
18
Location
Pennsylvania
Your Mac's Specs
Mid-2012 15" MBP 2.6GHz i7, Late-2011 13" MBP 2.4 GHz i5, Early-2008 Mac Pro 2.8Ghz Xeon
This all depends how you're trying to connect - what protocol are you connecting over? From the looks of it, you're trying to connect over SSH which is only going to work if the ssh daemon is started and configured on the Ubuntu box.

Second, you don't need the server name and the IP - stick with just the IP:
Code:
ssh username@<IP>

Well, If I'm not mistaken my network is dhcp, but I tried that in place of ssh and got a command not found so i switched back to the ssh thing at the beginning. I would I start/congifure the ssh on the ubuntu box? or is that not what I need to do with the dhcp network setting?
 
Joined
Feb 26, 2010
Messages
2,116
Reaction score
123
Points
63
Location
Rocky Mountain High, Colorado
Your Mac's Specs
1.8 GHz i7 MBA 11" OSX 10.8.2
Where did you get the command not found?

How did you install Ubuntu? Usually when you do an install from a disc it installs the desktop version of Ubuntu - which doesn't provide most of the server stuff like ssh.
Enable Secure Shell (SSH) in Ubuntu 11.04 Natty Narwhal | Liberian Geek

Note that if you expose ssh to the internet (i.e. open it in your firewall - you will be brute-forced attacked but scripts constantly) If you are just trying to access your computer internally behind your firewall - it should be fine to use passwords.

ssh username@ip should work fine. The first one you tried I wouldn't expect to work.
 
OP
1
Joined
Nov 2, 2011
Messages
233
Reaction score
1
Points
18
Location
Pennsylvania
Your Mac's Specs
Mid-2012 15" MBP 2.6GHz i7, Late-2011 13" MBP 2.4 GHz i5, Early-2008 Mac Pro 2.8Ghz Xeon
Where did you get the command not found?

How did you install Ubuntu? Usually when you do an install from a disc it installs the desktop version of Ubuntu - which doesn't provide most of the server stuff like ssh.
Enable Secure Shell (SSH) in Ubuntu 11.04 Natty Narwhal | Liberian Geek

Note that if you expose ssh to the internet (i.e. open it in your firewall - you will be brute-forced attacked but scripts constantly) If you are just trying to access your computer internally behind your firewall - it should be fine to use passwords.

ssh username@ip should work fine. The first one you tried I wouldn't expect to work.

I installed it via USB, but it is the server version that doens't include the desktop environment. Essentially it's just the command line though a desktop mode can be enabled I believe . I tried ssh username@ip but it just adnvances the cursor to the next line. I'll try logging off the server and then see if that helps.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Well, If I'm not mistaken my network is dhcp, but I tried that in place of ssh and got a command not found so i switched back to the ssh thing at the beginning. I would I start/congifure the ssh on the ubuntu box? or is that not what I need to do with the dhcp network setting?
DHCP is not a connection protocol but a method of allocating IPs to clients. It has nothing to do with shares beyond giving machines on the network an IP address.

Ubuntu Server doesn't install SSH by default unless you explicitly select it during install (actually, I'm not even sure if it's an option - it's been a while since I installed it on my server). If you don't have it installed and configured, take a look at the Ubuntu server docs here. That's for version 11.10 - replace the version number in the URL with your version if you're using an older one.
 
OP
1
Joined
Nov 2, 2011
Messages
233
Reaction score
1
Points
18
Location
Pennsylvania
Your Mac's Specs
Mid-2012 15" MBP 2.6GHz i7, Late-2011 13" MBP 2.4 GHz i5, Early-2008 Mac Pro 2.8Ghz Xeon
I'm now running into the permission denied issue when transfering files from the mac to server. How can I fix this?
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Have you successfully installed and configured SSH? Can you SSH in? If so, how are you trying to transfer the files (scp, sftp, smb, etc.)?
 
OP
1
Joined
Nov 2, 2011
Messages
233
Reaction score
1
Points
18
Location
Pennsylvania
Your Mac's Specs
Mid-2012 15" MBP 2.6GHz i7, Late-2011 13" MBP 2.4 GHz i5, Early-2008 Mac Pro 2.8Ghz Xeon
Have you successfully installed and configured SSH? Can you SSH in? If so, how are you trying to transfer the files (scp, sftp, smb, etc.)?

I got the SSH installed and connected to the mac via the mac's terminal (logged into the server) and executed the get filename command once in the files folder.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Can you be a little more specific? What command are you executing and on what machine are you executing it on?
 
OP
1
Joined
Nov 2, 2011
Messages
233
Reaction score
1
Points
18
Location
Pennsylvania
Your Mac's Specs
Mid-2012 15" MBP 2.6GHz i7, Late-2011 13" MBP 2.4 GHz i5, Early-2008 Mac Pro 2.8Ghz Xeon
Can you be a little more specific? What command are you executing and on what machine are you executing it on?

Logged into the server I executed the get filename command. Here is an example

get document1.docx

I execute this when I am on the server remotely logged into the Mac & in one of its directories e.g. Documents.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Are you using FTP? I only ask because get is an FTP command. This is only going to work if you have FTP setup.

If you want simple file transfer, look into scp. Take a look at this.

Here's a simple example. Let's say I want to copy "test_document" from my Mac to my Linux server. I can execute the following to do this:
Code:
scp test_document [email protected]:/home/vansmith
That will copy test_document over to /home/vansmith on my Linux server over SSH.
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
yea, scp isn't as 'user friendly' as ftp. Although you can always pipe a tarball through ssh ;)
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
True but it doesn't require any setup beyond an SSH account (which is already setup). The syntax is manageable as well if you think of it like cp.
 
OP
1
Joined
Nov 2, 2011
Messages
233
Reaction score
1
Points
18
Location
Pennsylvania
Your Mac's Specs
Mid-2012 15" MBP 2.6GHz i7, Late-2011 13" MBP 2.4 GHz i5, Early-2008 Mac Pro 2.8Ghz Xeon
I am using FTP which I setup. I'll try the SCP solution you mentioned as Vansmith.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Good point. Cyberduck is a nice way to transfer files over SSH without having to know the commands.

As I understand it though, he's logged into the Mac from another machine:
I execute this when I am on the server remotely logged into the Mac & in one of its directories e.g. Documents.
If this is the case, we'll need to find another client (unless of course he's running this without X up).
 
Joined
Feb 26, 2010
Messages
2,116
Reaction score
123
Points
63
Location
Rocky Mountain High, Colorado
Your Mac's Specs
1.8 GHz i7 MBA 11" OSX 10.8.2
Yeah the OP is a litte confusing. The original post said ubuntu servers - then as you quoted he is logged into the Mac through the servers. Anyway most file browsers in Ubuntu directly support sftp.
ubuntu-users - Is there a graphic SFTP for Ubuntu
Konqueror for the KDE folks.
Konqueror - Wikipedia, the free encyclopedia

Try to cover the bases:
Here are the sftp man pages
sftp(1): secure file transfer program - Linux man page
Loading&#133;

Here are the scp mans
scp(1): secure copy - Linux man page
Loading&#133;
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top