LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 06-30-2007, 10:14 PM   #1
theoneandonly19
LQ Newbie
 
Registered: Jun 2007
Location: AZ
Distribution: I use centos 4.3
Posts: 11

Rep: Reputation: 0
SSH issues


I am have a very hard time being able to ssh into this server which is my main goal. i have tried so many things already. I have tried using a hostname from dyndns... now i have setup port fording on my wireless router. i had setup an ip on the server that they told me i should use. I have tried connecting to ssh using the ip for the router the static ip they told me to use on the server and the hostname and the ip address that my isp has me on at this time. I keep getting a cennection timeout error. I am running out of ideas please help thank you.
 
Old 06-30-2007, 10:44 PM   #2
pcardout
Member
 
Registered: Jun 2003
Location: Socorro, New Mexico
Distribution: Debian ("lenny", "squeeze"), Ubuntu ("karmic", "oneiric")
Posts: 214

Rep: Reputation: 24
Welcome to LQ.

The word "they" appears frequently in your post, so I assume you are a user trying to log into a server that you do not administer.
I further assume that this server allows ssh.

In order to get help, you should share some basic information about your setup.
Let us start by seeing
some basic information about your system. Why don't you try

Code:
/sbin/ifconfig > temp.txt
Then post the contents of temp.txt to this thread.
Also post the command as you are typing it for ssh.

Finally. Can you ping the server you are trying to reach?

The command is (for example)

Code:
ping login.nmt.edu
If you can't reach a server by name, then your DNS is not working, try it by number

Code:
ping 129.138.4.79
Linux Networking is a fundamental thing to understand. Try reading the Linux Networking How-to
to get oriented.
For example: http://www.yolinux.com/TUTORIALS/Lin...etworking.html
 
Old 06-30-2007, 10:44 PM   #3
IBall
Senior Member
 
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 61
1) First thing - when you are logged into the server, can you ssh to itself:
Code:
ssh localhost
2) Make sure that the ssh server is installed and running, and port 22 is forwarded to your computer from your modem / router. Also, make sure that connections on port 22 are allowed through your firewall.

3) What distro are you using? Please add this information to your profile, it allows us to help you with more specific answers.

--Ian
 
Old 06-30-2007, 11:10 PM   #4
pcardout
Member
 
Registered: Jun 2003
Location: Socorro, New Mexico
Distribution: Debian ("lenny", "squeeze"), Ubuntu ("karmic", "oneiric")
Posts: 214

Rep: Reputation: 24
It is not entirely clear to us what you are trying to do.

My guess is you are a home user with a new wireless router that connects to an ISP via DSL.

If this is correct, please confirm. Otherwise please explain your configuration. New setups can be tricky because you have the uncertainty about whether
your router is setup correctly as well as what your isp wants.

Most routers allow you to reach them via a configuration web-page. You should do that first and
make sure you know how to talk to your router. You could also debug your setup by taking your
computer to work where you have a hard ethernet connection and seeing if you can reach your ISP from there.

The key to solving these problems is solving them one link at a time. The tool
"traceroute" can also be helpful.

Last edited by pcardout; 07-01-2007 at 12:23 AM.
 
Old 07-01-2007, 12:57 AM   #5
theoneandonly19
LQ Newbie
 
Registered: Jun 2007
Location: AZ
Distribution: I use centos 4.3
Posts: 11

Original Poster
Rep: Reputation: 0
thank you for your help i think i got most of the information you asked for. first i am running centos 4.3. i typed in "/sbin/ifconfig > temp.txt" but nothing happened. then i tried to ping the hostname when i do that it was able to reach the ip set by my isp for me but when trying to get to the ip of the server it said host is unreachable. Please let me know what you think. If you need any further information please let me know.

PS. this is a server at home. When i was saying they i was referring to my isp and my router support.
 
Old 07-01-2007, 01:05 AM   #6
pcardout
Member
 
Registered: Jun 2003
Location: Socorro, New Mexico
Distribution: Debian ("lenny", "squeeze"), Ubuntu ("karmic", "oneiric")
Posts: 214

Rep: Reputation: 24
Debugging network connection

Code:
 /sbin/ifconfig > temp.txt
The above takes the output of the command /sbin/ifconfig and sticks it in the file temp.txt.

You didn't see it because you didn't type the file. The command to see a file is "cat".

It is hard to know just how noob a noob is. Do you know how to use a command line at all?
(This is not a criticism -- I can point you at some tutorials if you don't know
command lines -- they are an important part of the power of linux, you can't do it all
with GUIs).

So anyway -- cat the file temp.txt and stick it up here.

What you are saying so far is that you have TCP/IP running and you can talk to yourself, but
there is no evidence at all you can talk to ANYTHING outside your own computer. You need
to get basic networking running. After that ssh is a no-brainer.

You can check ssh via ssh localhost as was previously suggested. Try that. I think you'll
find you can ssh to yourself. (Don't forget to log out after you've ssh'd to yourself!).

If ssh works, we'll work on networking. You probably have to post the instructions your
ISP sent you.
 
Old 07-01-2007, 01:08 AM   #7
pcardout
Member
 
Registered: Jun 2003
Location: Socorro, New Mexico
Distribution: Debian ("lenny", "squeeze"), Ubuntu ("karmic", "oneiric")
Posts: 214

Rep: Reputation: 24
Oh yes -- if we're going to debug networking, post your

/etc/resolv.conf and your /etc/networks/interfaces file.

Also -- modify your user profile to show us what distribution you are using.

Finally -- you seem to be using two machines -- clearly networking is running or you wouldn't be posting.

Is it a good guess that you have a Windows machine running on your network and you have a separate Linux
machine and don't know how to make that work? It will be useful to look at your Windows settings. That
will help us set up your linux box. Or am I guessing wrong?
 
Old 07-01-2007, 01:10 AM   #8
IBall
Senior Member
 
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 61
Now can you answer my questions in My Post

Can you also post the commands you are using, so that we can see exactly what you are doing.

Don't worry about hostnames for now - get SSH working on your local network first.

1) Is the SSH server running. "ps -ef | grep ssh" to find out.
2) From the server can you SSH into itself? "ssh localhost"
3) Are connections on port 22 allowed through your firewall? Have you forwarded port 22 from your modem to your computer?

--Ian
 
Old 07-01-2007, 01:12 AM   #9
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Is this your server or someone else's. If you are inside your lan, then use the local IP address and not the internet address. If you are on the internet at a remote connection, then use your routers IP address.

Test ssh access locally on the lan if possible. You may need to open up port 22 on the firewall.

Remotely, on the internet, first ping your router to see if you can reach it. Then try to access your server using ssh.

You can also use a telnet client to check for connectivity:
telnet delllap 22
Trying 192.168.1.102...
Connected to delllap.
Escape character is '^]'.
SSH-2.0-OpenSSH_4.3

You won't get further than that, but if you see the SSH message, you can connect to the server and you may have an sshd configuration problem.
 
Old 07-01-2007, 02:27 AM   #10
theoneandonly19
LQ Newbie
 
Registered: Jun 2007
Location: AZ
Distribution: I use centos 4.3
Posts: 11

Original Poster
Rep: Reputation: 0
First let me say yes I am a complete noob at this. I do apologize for my ignorance and am grateful and appreciative of your assistance. If you could provide me with tutorials that would be very helpful as i have looked for some but have not found any that have helpes i do also have a book that i am using but have found these forums to be very helpful.

Ok yes I am able to ssh to localhost (sorry i forgot to mention it last time)

As you had guessed I am running multiple machines and am using a Windows machine to access the net and use the forums however I have been able to access the internet from the server. this may be helpful information or not. but as i am running back and forth I dont see how i would post the information from those files.

Unfortunately I am still unable to use the command provided with the cat command to view the file (still a noob sorry) if you could please provide me with the specific text for the full command that would be helpful.

To answer your questions:
1) SSH is running on the server
2) Yes, I can ssh on the server using ssh localhost
3) Yes ssh should be allowed through the firewall as i have told it to do so and have checked and shown that connections are to be allowed. As far as anyother firewalls I do not know If i need to i will as my ISP if there should be any issues as for as the internet connection goes. I have setup port forwarding on my router properly.

I will contact my ISP for information and any instructions they might be able to provide.

Thank you
 
Old 07-01-2007, 02:48 AM   #11
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
It sounds like you need to do some work configuring the network setup on the server.

On the server enter "/sbin/ifconfig" to check the ip addresses of the NIC interface.

The output will look like this. Check that the NIC's IP address is one that your LAN network uses. ( I'm assuming that it has just one interface and that your router to the internet is a NAT router.)
If you have static address on your LAN, make sure you haven't assigned the same IP address for two different computers.

Code:
/sbin/ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0F:B0:0C:EF:AB
          inet addr:192.168.1.105  Bcast:192.168.1.127  Mask:255.255.255.128
          inet6 addr: fe80::20f:b0ff:fe0c:efab/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1018348 errors:0 dropped:0 overruns:0 frame:0
          TX packets:845150 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1367105008 (1303.7 Mb)  TX bytes:205869709 (196.3 Mb)
          Interrupt:185 Base address:0xe800

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:3114358 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3114358 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:484527773 (462.0 Mb)  TX bytes:484527773 (462.0 Mb)
Check the /etc/resolve.conf file. It should contain your ISP's Domain Name Server Addresses.
If you use DHCP, they will be filled in automatically after you boot. If not, look on one of your other computers. The information will be the same. From the windows computer, you can enter in "ipconfig /all" in the dos shell to get that information as well.


Check the output of the /sbin/route command:
Code:
jschiwal@hpamd64:~/work/cwork> /sbin/route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
jesnet          *               255.255.255.128 U     0      0        0 eth0
loopback        *               255.0.0.0       U     0      0        0 lo
default         linksys         0.0.0.0         UG    0      0        0 eth0
Note the default line. This shows the address of the default gateway (your router's ip address) for your network.
This is where internet address are sent.

I entered my linksys routers IP address in /etc/hosts. That is why it shows a name instead of an IP address.
I also entered my subnets name in /etc/networks. You don't need to do this. I just find it easier using names than remembering IP address.
 
Old 07-01-2007, 03:01 AM   #12
pcardout
Member
 
Registered: Jun 2003
Location: Socorro, New Mexico
Distribution: Debian ("lenny", "squeeze"), Ubuntu ("karmic", "oneiric")
Posts: 214

Rep: Reputation: 24
I agree with jschiwal. You aren't really up to "ssh problems", you are still at
"network configuration problems".

Here is a decent tutorial. http://www.ee.surrey.ac.uk/Teaching/Unix/. If you go through this, you will
better understand the advice your are getting in these forums.

The tutorial also recommends a number of books. I have liked the Unix Administration Guide (because that's what you're into, is administering your own system).
I have also liked "How Linux Works". "Running Linux" is another classic.

More directly relevant to your network problems are:
http://www.yolinux.com/TUTORIALS/Lin...etworking.html

I want to commend you for digging into this. If your install went OK,
then at least you have Linux running. Setting up a network with a router is not really a job for absolute
beginners -- It would be good if whoever talked you into CentOS with this ISP holds your hand. I personally
don't know your distro. I have no idea if it's noob friendly. Most noobs are doing Ubuntu these days, and
it mostly "Just works". The configuration files I've been asking you about apply to Debian and Ubuntu.
All Linux distros are similar, but they tend to move around or rename the configuration files. Again, this
is not something a noobie should have to deal with, and whoever talked you into CentOS ought to give you
a lesson in that Distro. (Note that LQ has distro specific fora -- though CentOS is not among them -- it
sounds obscure).

So -- it might take you weeks to get your problem fixed. It's not that it's really that tough, but it's that it will take you that long to learn enough to be able to fix it. If you're up for that, you'll learn a lot, but
don't get discouraged. Linux knowledge will last a lifetime (unlike Windows knowledge, which lasts about 3 years!).

If you want to persist here, you simply are going to have to find a way to post your configuration files. We can't guess what you are doing wrong from your vague statements, and since you are a noob you are likely not to know what the important facts are to tell us. So -- get out your thumbdrive and copy your files or error messages from your linux machine to your windows machine. If you can't do that -- learn how. You need to!

I wish you well. Hang in there -- you'll get it!

Last edited by pcardout; 07-01-2007 at 03:12 AM.
 
Old 07-01-2007, 03:12 AM   #13
pcardout
Member
 
Registered: Jun 2003
Location: Socorro, New Mexico
Distribution: Debian ("lenny", "squeeze"), Ubuntu ("karmic", "oneiric")
Posts: 214

Rep: Reputation: 24
Quote:
however I have been able to access the internet from the server
I missed this the last time around. Do you mean you can run a web-browser (and go somewhere like Google) on
the ISP's server, or do you mean you can run a web-browser on the home machine you are posting about?

If you can run a web-browser on your home-machine, then all this stuff I've been saying about your network being setup wrong does not apply. Then you really do have an "SSH problem", which is different. If you mean that you
are able to log on with an account at a different site and surf, that really doesn't help you too much --
it only means you have an account. It does not mean your home machine is talking to the net.
So please clarify.
 
Old 07-01-2007, 04:36 AM   #14
theoneandonly19
LQ Newbie
 
Registered: Jun 2007
Location: AZ
Distribution: I use centos 4.3
Posts: 11

Original Poster
Rep: Reputation: 0
On the server I am working on I have been and am able to open a webbrowser and surf the internet. I just ran the browser again and am unable to connect. the difference between then and now is that then I was using dhcp and now I had setup the static ip as recommended by my router company so i could do port forwarding.
 
Old 07-01-2007, 04:44 AM   #15
IBall
Senior Member
 
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 61
Is it possible to set a static IP in your router, to map to the MAC address of the network card in your computer?

Most routers allow this - all you need to do is get the MAC address from ifconfig, and then add it in your router to map to a specific IP address.

This way, your server would continue to use DHCP.

--Ian
 
  


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
ssh and vnc forking issues phantompgr Linux - Software 2 04-16-2005 08:29 AM
ssh display issues dsheppa4 Linux - Networking 1 11-24-2004 12:55 PM
SSH Tunnel and FTP Issues ayrton Linux - Networking 2 02-16-2004 05:03 AM
SSH connectivity issues wvrhlu Linux - Software 11 04-01-2003 08:59 PM
ssh issues cuss Linux - Security 9 12-19-2002 11:52 AM


All times are GMT -5. The time now is 09:11 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration