LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-22-2009, 11:08 AM   #1
careykwong
LQ Newbie
 
Registered: Sep 2009
Posts: 17

Rep: Reputation: 0
setup Static IP address for centOS and access to ssh


I got a Dell R200 and installed CentOS latest version. I did not use the installation disk come with dell but install OS directly.

I would like to connect internet with static IP

ISP provide this information:
Public fixed IP: 116.48.154.182
Private IP gateway: 192.168.1.1
Private IP subnet: 255.255.255.0
DHCP range: 192.168.1.100-150
DMZ: 192.168.1.254

I can online with DHCP, but what I need to config my static ip config from the above information?

Broadcast??
ipaddr??
netmask??
network??
gateway??

What I need to enter in DNS?

I also got the domain name from godaddy. How can I make this server for the domain name?

I also cannot get the ssh work. hope I can access ssh when the config is done.

But is that I can use DHCP and online then I can access ssh?

please help!!!!!!!
 
Old 09-22-2009, 11:16 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
Public fixed IP: 116.48.154.182
Seems to me the private ip is assgned to the WAN side of the router.
The router gives DHCP to your internal network.
So:
you need to forward port 80 and 22 on the router to your server
which should have ip 192.168.1.254 (DMZ)
The netmask is 255.255.255.0
Broadcast 192.168.1.255
Default GW 192.168.1.1
DNS => the DNS server from your provider, or you can use open DNS (208.67.220.220 and 208.67.222.222)

For your domainname, ask godaddy to point DNS to 116.48.154.182

Last edited by repo; 09-22-2009 at 11:39 AM.
 
Old 09-22-2009, 06:37 PM   #3
careykwong
LQ Newbie
 
Registered: Sep 2009
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks for your help!!!!!

I enter those information and check every step I can access the internet using static IP

That is a good step for me.

But I still cannot access ssh. I did open the port 22.

I check the port in vi /etc/ssh/sshd_config that got port 22 open

I also restart that using /etc/init.d/sshd restart

I still cannot access ssh, How can I check that outside can access that?

What I am checking is that I use a macbook connect from same router.

and open terminal to type: ssh root@116.48.154.182
 
Old 09-23-2009, 01:56 AM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Please give the command you use and the output
You need to use ssh as user, then use su to become root
Ssh as root is disabled by default

To see if ssh works.
Login at the machine where ssh is running.
type
Code:
ssh 127.0.0.1
post the output
Make sure ssh is allowed in the firewall, and if needed ssh is forwarded at the router to the server.
Make sure your provider doesn't block ssh (port 22)

To verify if ports are open on your IP
use one of the several portscanners on the internet
http://www.google.be/search?q=online...ient=firefox-a
 
Old 09-23-2009, 06:51 AM   #5
careykwong
LQ Newbie
 
Registered: Sep 2009
Posts: 17

Original Poster
Rep: Reputation: 0
At my server, I access ssh 127.0.0.1

I can login as root or user that is no problem.

I scanned the port using the link above, I got the result is:

Scanning ports on 116.48.154.182
116.48.154.182 is responding on port 22 (ssh)

but I still cannot access ssh. (I did edit the config file and allow root login)

really dont know what else I miss and check
 
Old 09-23-2009, 07:31 AM   #6
careykwong
LQ Newbie
 
Registered: Sep 2009
Posts: 17

Original Poster
Rep: Reputation: 0
What the problem is that did not show any result when I try to log in to ssh

I type: ssh root@myIP

it did ask me something ....... then I type yes

and require me to enter password, after typing the password and press enter

there is no reaction even not show to me the time out message.
 
Old 09-23-2009, 07:42 AM   #7
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
Ok just comment your DNS entries in /etc/resolv.conf and then try to ssh the server and let us know the result
 
Old 09-23-2009, 07:57 AM   #8
careykwong
LQ Newbie
 
Registered: Sep 2009
Posts: 17

Original Poster
Rep: Reputation: 0
in the file

nameserver 208.67.220.220
nameserver 208.67.222.222

? you want me to comment out these entries?

I tried both this command also cannot login

ssh root@116.48.154.182 and ssh root@ecshoppingcart.com

actually can I test from my macbook using terminal within the same network
 
Old 09-23-2009, 08:06 AM   #9
careykwong
LQ Newbie
 
Registered: Sep 2009
Posts: 17

Original Poster
Rep: Reputation: 0
here is the config file:

# $OpenBSD: sshd_config,v 1.73 2005/12/06 22:38:28 reyk Exp $

# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.

Port 22
#Protocol 2,1
Protocol 1,2
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 768

# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
PasswordAuthentication yes

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
ChallengeResponseAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
GSSAPIAuthentication yes
#GSSAPICleanupCredentials yes
GSSAPICleanupCredentials yes

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication mechanism.
# Depending on your PAM configuration, this may bypass the setting of
# PasswordAuthentication, PermitEmptyPasswords, and
# "PermitRootLogin without-password". If you just want the PAM account and
# session checks to run without PAM authentication, then enable this but set
# ChallengeResponseAuthentication=no
#UsePAM no
UsePAM yes

# Accept locale-related environment variables
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#ShowPatchLevel no
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no

# no default banner path
#Banner /some/path

# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server
 
Old 09-23-2009, 09:37 AM   #10
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
I would suggest to try ssh from an external IP.
Some routers have problems going from inside, outside, and back in.
To test from your mac, in the same network, use the internal ip from the server (162.168.xxx.xxx)

Last edited by repo; 09-23-2009 at 09:38 AM.
 
Old 09-23-2009, 09:47 AM   #11
careykwong
LQ Newbie
 
Registered: Sep 2009
Posts: 17

Original Poster
Rep: Reputation: 0
I did try it at outside

server at office and did try it at home using window putty.

Also not work
 
Old 09-23-2009, 09:51 AM   #12
careykwong
LQ Newbie
 
Registered: Sep 2009
Posts: 17

Original Poster
Rep: Reputation: 0
can login at same network using private IP

Last login: Wed Sep 23 22:20:12 on ttys000
careykwongs-macbook:~ careykwong$ ssh root@192.168.1.254
The authenticity of host '192.168.1.254 (192.168.1.254)' can't be established.
RSA key fingerprint is 3d:9b:3a:fe:e4:d2:ec:e4:95:c4:df:75:bf:0b:77:cb.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.254' (RSA) to the list of known hosts.
root@192.168.1.254's password:
Last login: Thu Sep 24 06:49:00 2009
[root@careymusic ~]#

but not from ssh root@ecshoppingcart.com
 
Old 09-23-2009, 01:10 PM   #13
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
1.Why do you plan to use name instead of ip address for ssh?
2.Can you ssh to the server within the same network either using ip address or name?
3.Can you ssh to the server from outside network via ip address?
If no
4.Do you have global ip?
5.Did you NAT global ip with your server ip?

Quote:
root@ecshoppingcart.com
6.Is this registered qualified domain name?
If yes
try like this
#ssh root@servername.domain.com
 
Old 09-23-2009, 01:16 PM   #14
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Could you please post the output from the command ?
Code:
ssh root@ecshoppingcart.com
 
Old 09-23-2009, 10:02 PM   #15
careykwong
LQ Newbie
 
Registered: Sep 2009
Posts: 17

Original Poster
Rep: Reputation: 0
OMG, it need t o fixed by ISP..... my config is no problem at all......
 
  


Reply



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
How To setup remote access server on centOS 5 bagra Linux - Newbie 2 08-25-2009 06:07 AM
Setup static ip-address in kubuntu? Silver565 Linux - Newbie 4 08-16-2009 12:08 AM
SSH Access Problem on CentOS 4.3 sfarber53 Linux - Networking 7 11-16-2006 11:27 AM
setup the static ip address hansi umayangan SUSE / openSUSE 1 04-04-2005 02:54 AM
Verizon aDSL setup with static IP address RH9 server costasm Linux - Networking 1 10-16-2003 02:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:24 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
Open Source Consulting | Domain Registration