+ Responder ao Tópico



  1. #1
    PedroNasc
    Visitante

    Padrão SSH - somente um user

    Amigos..
    Existe como eu proibir o acesse de determinado usuario por ssh no meu servidor??? Eu so queria que um usuario apenas tivesse acesoo... tem como??

  2. #2
    Aquini
    Visitante

    Padrão SSH - somente um user

    Utilize a diretiva
    AllowUsers <user1 user2 userX>
    no arquivo /etc/ssh/sshd_config para setar uma lista de usuários que serão permitidos fazer login no sistema

  3. #3
    PedroNasc
    Visitante

    Padrão SSH - somente um user

    meu servidor é RedHat 8 e nao acho o arquivo sshd_config na pasta /etc/ssh e nem em lugar algum...
    ja deu um find / -name sshd e nda...

  4. #4
    PedroNasc
    Visitante

    Padrão SSH - somente um user

    Amigos... eu nao encontro o arquivo...sshd_config para fazer as alteracoes
    ........

  5. #5
    Aquini
    Visitante

    Padrão SSH - somente um user

    Vc atualizou ou intalou o ssh recentemente direto do source?

  6. #6
    Aquini
    Visitante

    Padrão SSH - somente um user

    Se você tem o pacote ssh-server distribuído com o RH8 instalado (original), tente rodar o seguinte:
    # ps -auxwww | grep -i ssh

    verifique se o daemon SSHD (/usr/sbin/sshd) está rodando com a diretiva "-f <path to config file>"
    se estiver setado irá te denunciar onde está o arquivo que procuras, caso contrário, obrigatoriamente tem que estar no "/etc/ssh"

    T+

  7. #7
    slice
    Visitante

    Padrão SSH - somente um user

    uma opção interessante de vc habilitar no teu sshd_config é "PermitRootLogin no" pois assim vc acessa como user normal e depois disso usa su ou su - para virar root...

    isso aumenta e muito a segurança do teu server...

  8. #8

    Padrão Ta bom ...

    Meu sshd_config ta assim:

    Código :
    #       $OpenBSD: sshd_config,v 1.59 2002/09/25 11:17:16 markus 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
    #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 3600
    #ServerKeyBits 768
     
    # Logging
    #obsoletes QuietMode and FascistLogging
    #SyslogFacility AUTH
    SyslogFacility AUTHPRIV
    #LogLevel INFO
     
    # Authentication:
     
    #LoginGraceTime 120
    #PermitRootLogin yes
    #StrictModes yes
     
    #RSAAuthentication yes
    #PubkeyAuthentication yes
    #AuthorizedKeysFile     .ssh/authorized_keys
     
    # rhosts authentication should not be used
    #RhostsAuthentication no
    # Don't read the user's ~/.rhosts and ~/.shosts files
    #IgnoreRhosts yes
    # 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
     
    # To disable tunneled clear text passwords, change to no here!
    #PasswordAuthentication yes
    #PermitEmptyPasswords no
     
    # Change to no to disable s/key passwords
    #ChallengeResponseAuthentication yes
     
    # Kerberos options
    #KerberosAuthentication no
    #KerberosOrLocalPasswd yes
    #KerberosTicketCleanup yes
     
    #AFSTokenPassing no
     
    # Kerberos TGT Passing only works with the AFS kaserver
    #KerberosTgtPassing no
     
    # Set this to 'yes' to enable PAM keyboard-interactive authentication
    # Warning: enabling this may bypass the setting of 'PasswordAuthentication'
    #PAMAuthenticationViaKbdInt no
     
    #X11Forwarding no
    X11Forwarding yes
    #X11DisplayOffset 10
    #X11UseLocalhost yes
    #PrintMotd yes
    #PrintLastLog yes
    #KeepAlive yes
    #UseLogin no
    #UsePrivilegeSeparation yes
    #PermitUserEnvironment no
    #Compression yes
     
    #MaxStartups 10
    # no default banner path
    #Banner /some/path
    #VerifyReverseMapping no
     
    # override default of no subsystems
    Subsystem       sftp    /usr/libexec/openssh/sftp-server

    O que posso fazer para aumentar a segurança e tbm habilitar um usuário apenas.... com priviléos restritos????


    Citação Postado originalmente por slice
    uma opção interessante de vc habilitar no teu sshd_config é "PermitRootLogin no" pois assim vc acessa como user normal e depois disso usa su ou su - para virar root...

    isso aumenta e muito a segurança do teu server...

  9. #9
    slice
    Visitante

    Padrão SSH - somente um user

    bloquear pelo iptables os acessos ao servidor ssh, liberando somente para os ip´s que realmente precisam acessar ele...

    iptables -A INPUT -p tcp -s ip_que_pode -i eth0 --dport 22 -j ACCEPT
    iptables -A INPUT -p tcp -i eth0 --dport 22 -j REJECT

    flw!

    Slice

  10. #10

    Padrão Valeu

    Valeu ... eu ja tenho as regras do ip_tables rodando .... mas diga uma coisa como faço para colocar apenas um usuário que pode logar nesse conf ai de cima?

    Citação Postado originalmente por slice
    bloquear pelo iptables os acessos ao servidor ssh, liberando somente para os ip´s que realmente precisam acessar ele...

    iptables -A INPUT -p tcp -s ip_que_pode -i eth0 --dport 22 -j ACCEPT
    iptables -A INPUT -p tcp -i eth0 --dport 22 -j REJECT

    flw!

    Slice

  11. #11
    slice
    Visitante

    Padrão SSH - somente um user

    Como disse o nosso colega aí em baixo:

    Citação Postado originalmente por Aquini
    Utilize a diretiva
    AllowUsers <user1 user2 userX>
    no arquivo /etc/ssh/sshd_config para setar uma lista de usuários que serão permitidos fazer login no sistema
    AllowUsers <slice aquini spectrum>

    e use também

    PermitRootLogin no

    []´s

    Slice

  12. #12

    Padrão SSH - somente um user

    hhehhe, naums e se as diretiva se anulam...

    mas tem a diretiva DenyUsers <ze joao mane>

    q nega usuarios....

    []'s