setup Static IP address for centOS and access to ssh
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
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?
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
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)
# 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
# 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
# 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
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 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 ~]#
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.