• Serveurs
  • [Résolu] Passer une dedibox en root

Bonjour, ou plutôt bonsoir


Je viens d'installer ma dedibox, et quand j'essaye de me log en root via putty en ssh, avec le mot de passe administrateur, l’accès m'est refusé :


login as: root
root@xxxxxxxxxx's password:
Access denied

Par contre si je me log avec mon identifiant et mot de passe normal ça roule...comment dois je proceder pour passer en root?

Merci de votre aide
Bonjour,
Une fois sur ta machine avec ton user, la commande pour passer en root est :
su root
edit:
la commande "su" fonctionne sans rien derrière pour passer en root mais si un jour tu dois changer de 'user', la commande est "su tonuser"
Pour revenir de root a ton user précédant c'est
exit
nano /etc/ssh/sshd_config;## La variable a recherché : PermitRootLogin
service ssh restart;
Bonsoir,

depuis la publication de Jessie, le SSH est configuré afin de bloquer l'accès en tant que root.
Ainsi, en effet c'est normal et ci-dessus, j'ai mis des indices afin de le permettre (de nouveau).
Wagner wrote:
nano /etc/ssh/sshd_config;## La variable a recherché : PermitRootLogin
service ssh restart;
Bonsoir,

depuis la publication de Jessie, le SSH est configuré afin de bloquer l'accès en tant que root.
Ainsi, en effet c'est normal et ci-dessus, j'ai mis des indices afin de le permettre (de nouveau).

bonjour , j'ai essayé de modifier mon fichier

.
# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin without-password
StrictModes yes

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

# 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_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes

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

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

# 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.
j'ai modifié mon fichier par ca ;
# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes

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

# 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_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes

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

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

# 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
mais lorsque je veux appliquer les modification j'ai un acces impossible avec winscp et je ne peux redemarer ssh acces refusé
Faut l'éditer en root et ensuite relancer SSH
service ssh restart
Aerya wrote:Faut l'éditer en root et ensuite relancer SSH
service ssh restart
c' bien ça le hic !! j'arrive pas avoir l'acces root sur ma dedibox
arckosfr wrote:
sudo -i
ou
su
en fait chez online on ne peut se connecter en root directement sur nos serveur et je sais pas pourquoi !!,donc quand j'essaie de me connecter avec putty seul le nom d'utilisateur que l'on me demande chez online pour installer mon OS sur mon serveur fonctionne et quand j'essaye d'installer le script d'Ex j'optiens ceci :
login as: roccat
roccat@62-210-139-75.rev.poneytelecom.eu.'s password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Aug 12 11:45:17 2016 from lfbn-1-1549-190.w90-65.abo.wanadoo.fr
roccat@sd-60031:~$ apt-get update && apt-get upgrade -y
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
roccat@sd-60031:~$ apt-get install git-core -y
Normal j'arrive pas à passer ce foutu serveur en root ,j'ai envoyé un ticket au support technique à part faire suivre mon ticket des un au autres..silence radio
Oui c'est bien ce que je dit, tu te connectes avec l'utilisateur que online te donnes,
et tu fait soit
sudo -i
et tu rentres ton mot de passes
soit
su root
et la tu pourras modifier la connexion en root
C'est pas "Online", c'est Debian 8 et c'est une sécurité, trop de serveurs se font piratés du fait d'un mot de passe SSH root trop faible (et hélas c'est le cas avec les pwd qu'on peut entrer sur l'interface d'Online notamment).

Donc tu te connectes avec ton User et le pwd User créés sur le panel Online et ensuite tu passes root avec la commande su et le pwd Root créé sur Online.
Aerya wrote:C'est pas "Online", c'est Debian 8 et c'est une sécurité, trop de serveurs se font piratés du fait d'un mot de passe SSH root trop faible (et hélas c'est le cas avec les pwd qu'on peut entrer sur l'interface d'Online notamment).

Donc tu te connectes avec ton User et le pwd User créés sur le panel Online et ensuite tu passes root avec la commande su et le pwd Root créé sur Online.
Cela vient bien de chez eux j'ai un kimsufi sous debian 8 j'ai bien l'acces root !! j'ai essayé avec mdp et pwd du panel online avec su mdp admin toujours pareil pas acces root
Non cela viens de Debian, pas de Online.
Si chez Kimsufi tu as accès au root, c'est qu'il modifie eux même Debian pour activer l'option de base (ce qui est mauvais je trouve)
Si tu me donnes les infos par MP je peux regarder. Après on n'est jamais à l'abri d'un bug lors de la création des comptes à l'installation, ça peut arriver.
arckosfr wrote:Non cela viens de Debian, pas de Online.
Si chez Kimsufi tu as accès au root, c'est qu'il modifie eux même Debian pour activer l'option de base (ce qui est mauvais je trouve)
alors c'est la cata pour moi j'edite tout mes fichier sous winscp si j'ai pas l'acces root j'ai plus qu'a rendre ce serveur

quand je pense que le service technique d'online ne pas toujours pas repondu pour ce problème
Aerya wrote:Si tu me donnes les infos par MP je peux regarder. Après on n'est jamais à l'abri d'un bug lors de la création des comptes à l'installation, ça peut arriver.

ok je t'envoie ça
Ben tu as l'accès root, comme sur tout autre serveur. Faut juste trouver ce qui cloche, je réitère ma proposition.
Aerya wrote:Ben tu as l'accès root, comme sur tout autre serveur. Faut juste trouver ce qui cloche, je réitère ma proposition.

je t'ai tout envoyé en mp
Arckos t'a donné la solution, je vois pas du tout ce que tu ne comprends pas dans l'histoire

Tu te connectes avec PUTTY avec TON user.

Une fois rentré dans le serveur tu entre
su
Il va te demander TON mot de passe de ton user

Et tadaaaaa tu es en root !
aktarus69 wrote:Il va te demander TON mot de passe de ton user
Non, mot de passe root...

BTW c'est bon, j'ai répondu à ton email. Dis-moi si tu veux que je modifie (bon app', je go manger)
Bonjour voici une solution tu passe ton serveur en MODE SECOURS et tu te connecte en ssh avec les identifiant du mode secours.

et tu suis ces commandes :
mount /dev/sda2 /mnt/

mount /dev/sda2 /mnt/home

chroot /mnt/

nano /etc/ssh/sshd_config

et la dans le fichier sshd_config ==> Tu remplace => PermitRootLogin without-password PAR PermitRootLogin yes

tu enregistre et tu repasse ton serveur en mode normal et tout est ok