Aller au contenu

Messages recommandés

Posté(e)

Bonjour à tous,

J'essaye depuis quelque temps de mettre en place un SSH pour des users normaux, avec authentification par clé publique sur mon NAS DS211 avec le dernier firmware et ikpg "installé".

Le but pour moi sera de faire de l'administration à distance, et de gérer un serveur git.

Pour info, je suis sous Ubuntu.

Pour l'instant, mes premiers tests de SSH ont super bien fonctionnés. J'ai réussi à donné accès au root par clé publique, et à moi-même par password.

J'ai essayé de donner l'accès par clé publique à "poukill" avec /var/services/homes/poukill/.ssh/authorized_keys qui va bien, mais rien à faire...

Du coup, j'ai commencé à chercher sur le Web. En suivant ce tutoriel ici, je crois que j'ai tout cassé ! :huh:

Depuis, j'ai perdu l'accès root, impossible de me logger... ni par password, ni par clé ! C'est affreux !

Alors qu'avec le user "poukill", aucun soucis (toujours avec le mot de passe et pas de clé publique, mais bon au moins j'ai pas régressé..)

Le /etc/ssh/sshd_config:

 

#This is the sshd server system-wide configuration file.  See                                                                                                                	

# sshd_config(5) for more information.                                                                                                                                        	


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


# 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                                                                                                                                                                      	

#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                                                                                                                                                          	

#LogLevel INFO                                                                                                                                                                	


# Authentication:                                                                                                                                                         		


#LoginGraceTime 2m                                                                                                                                                            	

PermitRootLogin yes                                                                                                                                                       		

#StrictModes yes                                                                                                                                                              	

#MaxAuthTries 6                                                                                                                                                           		

#MaxSessions 10                                                                                                                                                           		


#RSAAuthentication yes                                                                                                                                                        	

PubkeyAuthentication yes                                                                                                                                                      	

AuthorizedKeysFile  	.ssh/authorized_keys    	


#now ssh is only used by rsync ==> auth by passwd file of rsync server                                                                                                        	

#AuthPassFile /etc/rsyncd.secrets                                                                                                                       		


# 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                                                                                                                                                      	


# 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                                                                                                                                                      	

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

#UsePAM no                                                                                                                                                                    	


#AllowAgentForwarding yes                                                                                                                                                 		

#AllowTcpForwarding yes                                                                                                                                                   		

#GatewayPorts no                                                                                                                                                              	

#X11Forwarding no                                                                                                                                                         		

#X11DisplayOffset 10                                                                                                                                                          	

#X11UseLocalhost yes                                                                                                                                                          	

#PrintMotd yes                                                                                                                                                                	

#PrintLastLog yes                                                                                                                                                         		

#TCPKeepAlive yes                                                                                                                                                         		

#UseLogin no                                                                                                                                                                  	

#UsePrivilegeSeparation yes                                                                                                                                               		

#PermitUserEnvironment no                                                                                                                                                 		

#Compression delayed                                                                                                                                                          	

#ClientAliveInterval 0                                                                                                                                                        	

#ClientAliveCountMax 3                                                                                                                                                        	

#UseDNS yes                                                                                                                                                               		

#PidFile /var/run/sshd.pid                                                                                                                                                    	

#MaxStartups 10                                                                                                                                                           		

#PermitTunnel no                                                                                                                                                              	

#ChrootDirectory none                                                                                                                                                     		


#DenyUsers admin                                                                                                                                                              	


# no default banner path                                                                                                                                                      	

#Banner none                                                                                                                                                                  	


# override default of no subsystems                                                                                                                                       		

#Subsystem  	sftp	/usr/libexec/sftp-server                                                                                                                              	

#Subsystem   	sftp	internal-sftp                                                                                                                                        	


# Example of overriding settings on a per-user basis                                                                                                                          	

#Match User anoncvs                                                                                                                                                       		

#   	X11Forwarding no                                                                                                                                                      	

#   	AllowTcpForwarding no                                                                                                                                             		

#   	ForceCommand cvs server

Allowusers poukill

J'avoue, je suis un peu paumé là. J'ai bien pensé à "reformater", mais je n'estime pas ça comme une solution valable ! :)

Si vous avez des idées, merci d'avance !

Poukill.

Rejoindre la conversation

Vous pouvez publier maintenant et vous inscrire plus tard. Si vous avez un compte, connectez-vous maintenant pour publier avec votre compte.

Invité
Répondre à ce sujet…

×   Collé en tant que texte enrichi.   Coller en tant que texte brut à la place

  Seulement 75 émoticônes maximum sont autorisées.

×   Votre lien a été automatiquement intégré.   Afficher plutôt comme un lien

×   Votre contenu précédent a été rétabli.   Vider l’éditeur

×   Vous ne pouvez pas directement coller des images. Envoyez-les depuis votre ordinateur ou insérez-les depuis une URL.

×
×
  • Créer...

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.