Page 1 sur 1
Ajout utilisateur root sur un NAS
Publié : jeu. 9 sept. 2010 19:36
par kalistyan
Afin d'installer une application sur l'un de mes NAS, ai besoin d'ajouter l'utilisateur ROOT.
Par défaut, ai ceci dans cat /etc/passwd
Code : Tout sélectionner
admin:x:0:0:administrators:/root:/bin/sh
guest:x:65534:65534:guest:/tmp:/bin/sh
Ai testé ceci :
adduser -H -p admin root
L'utilisateur est bien créé mais l'accès SSH ne fonctionne pas... "fatal error" depuis Putty
Une idée ?
Ajout utilisateur root sur un NAS
Publié : jeu. 9 sept. 2010 22:02
par Zedoune
Salut
tu peux te logguer en root sur la machine ?
T'as autorisé la connexion à root par ssh ?
Ajout utilisateur root sur un NAS
Publié : jeu. 9 sept. 2010 22:23
par kalistyan
Il s'agit d'un NAS QNAP, seul moyen de s'y connecter > Putty. Cela fonctionne très bien avec le compte par défaut "admin". Une fois connecté, lors d'une tentative d'installation, le programme me répond qu'il faut être en root mais impossible de s'y connecter avec ce user. D'après mes recherches le compte n'existe pas...
Ajout utilisateur root sur un NAS
Publié : jeu. 9 sept. 2010 23:06
par nicodache
rappel : le compte user a un ID de 0.
faut y penser lors de la création du compte
pis pour le reste, voir dans la conf de ssh si le login root est pas désactivé.
pis sinon, une fois loggué en admin, tu tapes "su", tu entres le mot de passe root, et voila
des fois ca marche

Ajout utilisateur root sur un NAS
Publié : jeu. 9 sept. 2010 23:18
par kalistyan
La commande "su" ne fonctionne pas...
-sh: su: command not found
Ajout utilisateur root sur un NAS
Publié : jeu. 9 sept. 2010 23:28
par Zedoune
Essaie avec la commande "login" plutot que "su"
Je sais pas exactement comment ça marche sur le système du NAS mais ça doit être un truc comme
login root
ou
login -f root
Ajout utilisateur root sur un NAS
Publié : jeu. 9 sept. 2010 23:34
par kalistyan
Ai trouvé ceci :
Another solution is NOT to create a new root user with any UID, but only to dupplicate the line admin in passwd and shadow and change admin to root ...
So at this moment you have two root like user
If a script use root name ... it's work
If script use UID 0 it's work
The only things is for the name of owner of file (il ls for ex.), the first name retreive in passwd is used ... so if you put root at top you see your file owned by root if it's admin you see admin ....
Philippe.
Mais pas sûr d'avoir tout capté...
Ajout utilisateur root sur un NAS
Publié : ven. 10 sept. 2010 07:53
par Alucardfh
Bah la citation te propose de cloner la ligne admin du /etc/passwd et de /etc/shadow et de les renommer root.
C'est moche mais comme ça t'aura deux user avec exactement les même uid/gid , mot de passe et droits mais un nom diffèrent.
Ajout utilisateur root sur un NAS
Publié : ven. 10 sept. 2010 08:30
par Zedoune
c'est pas forcément moche, et avec vi ça se fait très bien. Tu vas sur la première ligne, tu fais yyp:wq (pas en mode insertion !), ça va te dupliquer la ligne, enregistrer et quitter.
Ajout utilisateur root sur un NAS
Publié : ven. 10 sept. 2010 10:59
par kalistyan
Duplication OK
Mais toujours impossible de se loguer en root via Putty
Code : Tout sélectionner
# $OpenBSD: sshd_config,v 1.74 2006/07/19 13:07:10 dtucker Exp $
# 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
#Protocol 2,1
Protocol 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
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys
# 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
# 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 no
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
UsePrivilegeSeparation no
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
UseDNS no
#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/sftp-server
AllowUsers admin root
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# ForceCommand cvs server
Ajout utilisateur root sur un NAS
Publié : ven. 10 sept. 2010 11:39
par gizmo78
Tas modifier la permission de connexion du comptz root ou cetait deja comme ca?si tu las modifie tas redemarrer le service ssh?
Ajout utilisateur root sur un NAS
Publié : ven. 10 sept. 2010 11:44
par kalistyan
J'ai modifié ceci :
Avant :
#PermitRootLogin yes
AllowUsers admin
Après :
PermitRootLogin yes
AllowUsers admin root
Puis le service a été redémarré à partir de l'interface d'admin car en ligne de commande cela ne fonctionne pas...
Code : Tout sélectionner
[/etc/ssh] # /sbin/daemon_mgr sshd start /etc/ssh/sshd
sh: /etc/ssh/sshd: No such file or directory
[/etc/ssh] #
Ajout utilisateur root sur un NAS
Publié : ven. 10 sept. 2010 13:01
par Alucardfh
[cpp]/sbin/daemon_mgr sshd start /etc/ssh/sshd_config[/cpp] non ?
Ajout utilisateur root sur un NAS
Publié : lun. 18 oct. 2010 14:34
par trailx
Au cas où, quelle ta ligne dans /etc/passwd pour ton compte root que tu as ajouté ?
Ajout utilisateur root sur un NAS
Publié : lun. 18 oct. 2010 14:48
par kalistyan
Ajout utilisateur root sur un NAS
Publié : mar. 19 oct. 2010 09:50
par trailx
[:666 ] Et tu arrives à faire un telnet avec le compte root ?
Perso ssh, je le lance avec la commande /opt/sbin/sshd