PDA

Bekijk Volledige Versie : VPS Directadmin en IP tables



TiaID
31/10/12, 11:36
Hey Hallo,

Ik heb een VPS waar ik CEntOS en directadmin op heb draaien.

Nu heb ik mijn poort aangepast van directadmin en nu moet ik verkeer via de nieuwe poort in de iptables toe staan.
Alleen de vraag is hoe doe ik dat?

TiaID
31/10/12, 12:13
is al opgelost

TiaID
31/10/12, 15:35
Nee helaas niet alles goed opgelost ;-)


Ik heb ook de SSH port aangepast en het ook in de iptables ingevoerd , alleen nu kan ik bijvoorbeeld met Putty niet inloggen.

Ik kan wel via de admin etc van hosting bedrijf inloggen op de console , maar niet als ik het met putty probeer .... wat doe ik fout?

vDong
31/10/12, 16:13
Wat is de inhoud van /etc/sysconfig/iptables ?

TiaID
31/10/12, 17:12
10482

10483

Yourwebhoster
31/10/12, 17:45
6720 is je nieuwe poort?

TiaID
31/10/12, 18:01
ja inderdaad

Netbulae
31/10/12, 19:35
Je moet waarschijnlijk de ssh daemon dan ook op de nieuwe poort laten luisteren. Welke poort heb je in /etc/ssh/sshd_config geconfigureerd staan?

dreamhost_nl
31/10/12, 19:46
Je moet waarschijnlijk de ssh daemon dan ook op de nieuwe poort laten luisteren. Welke poort heb je in /etc/ssh/sshd_config geconfigureerd staan?

En daarna (uiteraard) SSHd weer herstarten.

TiaID
31/10/12, 20:00
daar staat ook port 6720 en heb ook sshd herstart

Tevens als ik putty gebruik en 22 als port gebruik kan ik wel gewoon inloggen

golden
31/10/12, 20:37
daar staat ook port 6720 en heb ook sshd herstart

Tevens als ik putty gebruik en 22 als port gebruik kan ik wel gewoon inloggen

Dan is de enige optie dat je port 22 nog niet vervangen hebt in de config. Of dat ssh toch niet goed gerestart is. Wel echt restart? Reloaden wilt soms niet voldoende zijn.

TiaID
31/10/12, 20:48
wat is volgens jou dan de command om ssh te restarten dan ?

BReady
31/10/12, 20:56
wat is volgens jou dan de command om ssh te restarten dan ?

Op debian based OS's is het: /etc/init.d/ssh restart in ieder geval.

edit: niet gelezen dat het besturingssysteem centOS was excuze

CentOS:

'/etc/init.d/sshd restart'

of 'service sshd restart'

TiaID
31/10/12, 20:59
Ik heb het nu op 2 manieren gedaan :

/etc/init.d/sshd restart

en

service sshd restart

En nog doet ie het niet, alleen port 22 via putty

vDong
31/10/12, 21:26
Ik heb het nu op 2 manieren gedaan :

Dan is de volgende stap je sshd_config hier delen.

TiaID
31/10/12, 21:39
oke even copypasten

TiaID
31/10/12, 21:44
# $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm 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 6720
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

# Disable legacy (protocol version 1) support in the server for new
# installations. In future the default will change to require explicit
# activation of protocol 1
Protocol 2

# 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 1024

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

# Authentication:

#LoginGraceTime 2m
PermitRootLogin no
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys
#AuthorizedKeysCommand none
#AuthorizedKeysCommandRunAs nobody

# 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
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange 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 and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to '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 LANGUAGE
AcceptEnv XMODIFIERS


#AllowAgentForwarding yes
#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
#ChrootDirectory none

# no default banner path
#Banner none

# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# ForceCommand cvs server
AllowUsers *********
AllowUsers *********
AllowUsers *********

vDong
31/10/12, 22:40
#Port 6720

Haal het hekje eens weg en restart nog eens.

BReady
31/10/12, 23:11
Haal het hekje eens weg en restart nog eens.

Inderdaad, dat hekje, dat ook wel een comment wordt genoemd, geeft aan dat het betreffende argument niet door de applicatie wordt ingelezen. Comments worden gebruikt om, zoals de naam het al zegt, informatie in een configuratiebestand te zetten zodat je weet waarvoor een bepaald argument dient.

TiaID
01/11/12, 00:02
OMG heb ik daar serieus zo overheen zitten kijken ? pfffff

Maar idd nu werkt het wel DAMN

Ik ben jullie dankbaar.

Flaxe_eu
01/11/12, 09:02
Om terug te keren naar start druk #

:-)

denk dat dit ons allemaal wel al eens gebeurt is om het klote # vergeten weg te halen.

vDong
01/11/12, 19:30
OMG heb ik daar serieus zo overheen zitten kijken ? pfffff

Maar idd nu werkt het wel DAMN

Ik ben jullie dankbaar.
En des te langer je was gaan staren des de kleiner de kans dat je het gezien had.