LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-19-2014, 10:12 PM   #16
Ryanms3030
Member
 
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Original Poster
Rep: Reputation: Disabled

Quote:
Originally Posted by SAbhi View Post
Well with the above saying it looks like you are struggling to much to setup things and didnt followed a good tutorial or followed a bunch of inappropriate one.

Server is not something you install every day for any small or big issue.

Here is what you can do to make ssh work:

1 remove and reinstall ssh
2 setup sshd_config to listen to teh default port
3 give your machine and network ip info in config file.
4 configure iptables to allow in and out connection to port 22
5 set selinux to permissive
6 start sshd service and if require reboot
Thanks. I just ran through all of these and still not connecting.
 
Old 01-19-2014, 10:15 PM   #17
andy78
Member
 
Registered: Oct 2005
Location: Stockholm, Sweden
Distribution: Ubuntu
Posts: 78

Rep: Reputation: 18
Do you connect with.
ssh -l "username" "ip address of server"
or is your user account you attempting to connect with configured on the server?
 
Old 01-19-2014, 10:25 PM   #18
Ryanms3030
Member
 
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by andy78 View Post
Do you connect with.
ssh -l "username" "ip address of server"
or is your user account you attempting to connect with configured on the server?
The user account is configured on my server and my client machine. I've tried ssh hostname, ssh ip , ssh user@hostname, ssh user@ip, and I just tried ssh -l

I still get a time out error on port 22.
 
Old 01-19-2014, 10:30 PM   #19
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,404

Rep: Reputation: Disabled
Quote:
Originally Posted by Ryanms3030 View Post
$ ssh -v 198.100.252.23
OpenSSH_6.4, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 51: Applying options for *
debug1: Connecting to 198.100.252.23 [198.100.252.23] port 22.
If that's all you get, then nothing's listening on port 22 at 198.200.252.23.

That's a public IP address (Schaumburg, Illinois?) you're attempting to connect to. Is that address directly assigned to a NIC on one of your systems? Or is it assigned to the broadband router? Earlier you tried connecting to 196.100.2.2, but that address is assigned to AfriNIC (Mauritius). Where does that address come from?

I think we should take this from the start. What's the IP address of the server you're trying to connect to? The address that appears when you type ifconfig on the server?

Is the client on the same physical network?

Last edited by Ser Olmy; 01-19-2014 at 11:00 PM.
 
Old 01-19-2014, 10:42 PM   #20
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 664

Rep: Reputation: 80
Addition to Ser_Olmy's comment:

is the port even opened to listen (### i doubt that it should listen) ?
 
Old 01-19-2014, 10:55 PM   #21
tranphat
Member
 
Registered: Dec 2013
Posts: 57

Rep: Reputation: Disabled
Addtion to Ser_Olmy and SAbhi's comments,

- You should try ssh localhost first, to make sure that ssh is running and is listening on port 22 before connecting from a remote client(may be the same or different subnet with server).
- Could you post your following debugging log lines rather than just only at "debug1: Connecting to 198.100.252.23 [198.100.252.23] port 22.". We need more lines than that.

$ ssh -v 198.100.252.23
OpenSSH_6.4, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 51: Applying options for *
debug1: Connecting to 198.100.252.23 [198.100.252.23] port 22.
 
Old 01-20-2014, 03:21 PM   #22
Ryanms3030
Member
 
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Original Poster
Rep: Reputation: Disabled
Finally got it. Thank you to everyone that helped, all of your advice led me to final conclusion.

In the end, I did a fresh install of Scientific Linux server. Again ,a long story having different issues with different distros and finally found one that installed without any problems on my hardware.

Followed this tutorial step by step on my fresh install:

http://www.cyberciti.biz/faq/centos-ssh/


Now it works. For the record, I was also confused about the ip of my server so that was the biggest issue but then it was compounded by adding incorrect info to a bunch of config files, many of which were unnecessary as I have now learned and I'm sure they caused more problems. Ugghhh!

My last question is should I set up static ip? It seems that my ip is reserved on my router because all of my devices get the same ip every time I reboot them. I'm sure static ip may be helpful but unecessay?
 
Old 01-20-2014, 03:50 PM   #23
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,404

Rep: Reputation: Disabled
Quote:
Originally Posted by Ryanms3030 View Post
My last question is should I set up static ip? It seems that my ip is reserved on my router because all of my devices get the same ip every time I reboot them. I'm sure static ip may be helpful but unecessay?
It may seem to get the same IP every time, but that's just because IP addresses handed out by a DHCP has a lease time. Once the lease expires, it has to be renewed. Reboot your server (or your router!) at the wrong time and you end up with a different IP address.

You should absolutely configure your server with a static IP address.
 
1 members found this post helpful.
Old 01-20-2014, 04:46 PM   #24
Ryanms3030
Member
 
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Original Poster
Rep: Reputation: Disabled
ok, one last question on this topic

I went back and changed the port to a non standard port. I changed 22 in the iptables and sshd_config files. Now I have to use the -p argument for the new port number when I ssh. What do I have to change in the configs so it just looks to the new port without having to -p every time?
 
Old 01-20-2014, 05:19 PM   #25
andy78
Member
 
Registered: Oct 2005
Location: Stockholm, Sweden
Distribution: Ubuntu
Posts: 78

Rep: Reputation: 18
Quote:
Originally Posted by Ser Olmy View Post
It may seem to get the same IP every time, but that's just because IP addresses handed out by a DHCP has a lease time. Once the lease expires, it has to be renewed. Reboot your server (or your router!) at the wrong time and you end up with a different IP address.

You should absolutely configure your server with a static IP address.
This statement is not wrong, its a option but not the only solution.

You can configure in you router that your host macadress should receive the same ip all the time.
It called static ip reciec by dhcp, so the above is correct.
 
Old 01-20-2014, 05:31 PM   #26
Ryanms3030
Member
 
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Original Poster
Rep: Reputation: Disabled
Thanks everyone. I used this tutorial and configured static ip on my server

http://www.putorius.net/2012/10/how-...ddress-in.html


Server still gets to the internet and I can still ssh to server so I'm guessing it ok. I can even ssh from my phone (i feel like a pro now!)

still have to type -p when I ssh but I'll figure that part out and then move onto some more complicated stuff
 
Old 01-20-2014, 05:38 PM   #27
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,404

Rep: Reputation: Disabled
You'll have to use the -p parameter as long as you use a non-standard port number. How else would the ssh client know which port number to use? It can't very well try all 65535 ports and see if one of them happens to host an SSH service.
 
1 members found this post helpful.
Old 01-20-2014, 05:58 PM   #28
Ryanms3030
Member
 
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Ser Olmy View Post
You'll have to use the -p parameter as long as you use a non-standard port number. How else would the ssh client know which port number to use? It can't very well try all 65535 ports and see if one of them happens to host an SSH service.
Ha, OK. I thought I could specificy the port in a config file but I guess not. I'm learning every day
 
Old 01-20-2014, 06:16 PM   #29
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,404

Rep: Reputation: Disabled
Quote:
Originally Posted by Ryanms3030 View Post
Ha, OK. I thought I could specificy the port in a config file but I guess not.
I stand corrected: It seems you can do exactly that by combining the "Host" and "Port" parameters.
 
Old 01-20-2014, 07:30 PM   #30
Ryanms3030
Member
 
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Ser Olmy View Post
I stand corrected: It seems you can do exactly that by combining the "Host" and "Port" parameters.
thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: SSH an ill-managed mess says SSH author Tatu Ylonen LXer Syndicated Linux News 0 04-12-2013 04:30 PM
ssh-agent, ssh-add and ssh-keygen AND CVS raylpc Linux - General 2 11-19-2008 03:50 AM
setting up an ssh soxy or local ssh tunnel from within an ssh soxy Mangenius Linux - Networking 0 03-05-2007 04:15 PM
Passwordless SSH with SSH commercial server and open ssh cereal83 Linux - General 7 04-18-2006 01:34 PM


All times are GMT -5. The time now is 06:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration