Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Distribution: Debian ("jessie", "squeeze"), Linux Mint (Serena), XUbuntu
Posts: 221
Rep:
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
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088
Rep:
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.
Distribution: Debian ("jessie", "squeeze"), Linux Mint (Serena), XUbuntu
Posts: 221
Rep:
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.
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.
Distribution: Debian ("jessie", "squeeze"), Linux Mint (Serena), XUbuntu
Posts: 221
Rep:
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.
Distribution: Debian ("jessie", "squeeze"), Linux Mint (Serena), XUbuntu
Posts: 221
Rep:
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?
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?
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.
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.
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.
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.
Distribution: Debian ("jessie", "squeeze"), Linux Mint (Serena), XUbuntu
Posts: 221
Rep:
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.
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!
Distribution: Debian ("jessie", "squeeze"), Linux Mint (Serena), XUbuntu
Posts: 221
Rep:
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.