Fórumok
RBAC-cal kell megoldanom valamit, erre en(egy meglevo doksi alapjan)
exec_attr -ba a kivant profile parancsokat, pl:
myprofile:suser:cmd:::/usr/sbin/uiseradd:uid=0
csinalok egy role-t
roleadd -m -d /export/ftdfh/ myrole
hozzaadom a profile-t a rol-hoz
rolemod -P myprofile myrole
csinalok 1 usert magamnak
useradd myuser
hozzaadom a role-t
usermod -R myroole myuser
ezutan
su - myuser
/usr/sbin/useradd -g xxc tut
Permission denied
1 napja tokolok vele, mi lehet a baj. igen az ora-s doksi is kb. ugyanezt csinalja.
Otlet? Ugyfel/project manager/fonokom cimmog, en meg nem birok menni froccsozni, wtf?
Hozzászólások
profiles se hozza az ujonnan hozzaadott profile-t
BDL10442FE# id
uid=0(root) gid=0(root)
BDL10442FE# profiles myuser
Basic Solaris User
All
BDL10442FE#
Szia!
Nemtudom, hogy eliras, vagy tenyleg igy szerepel az exec_attr-ban: myprofile:suser:cmd:::/usr/sbin/uiseradd:uid=0
. Ha igen, akkor javitsd ki useradd-ra. A profiles myuser nem mutatja, azt csak a profiles myrole mutatna meg. A roles myuser mutatja a role-kat.
Masik dolog, hogy az exec_attr-ba beirt parancs nem lehet symlink, azt nem koveti az RBAC. Tehat nezd meg, hogy a /usr/sbin/useradd nem symlink-e veletlenul. Most nincs elottem Solaris, kulonben megneznem magam.
A userbol at kell menni role-ba (su - myrole), hogy mukodjon. Ha a userhez rendeled a profile-t, akkor a user pfexec useradd... modon tudja hasznalni a profile-ban levo parancsot.
Remelem segitettem.
Toni
1. typo
2. newm symlink
3. kiprobalom
Koszi
usermod -R myroole myuser
ebben a dupla o betű is typo?
nyilván
pfexec /usr/sbin/useradd -g 678 tutu
UX: /usr/sbin/useradd: ERROR: Permission denied.
nemjo, de igeretes volt. hetek ota olyan feladatok jonnek, amivel nem lehet haladni, utalom.
Probald meg a su - myuser utan su - myrole majd useradd. Vigyazz ne valts shellt kozben!
"Sajnos" a Solaris nem olyan, hogy csak ugy meg lehet tanulni google-bol.
a su - sejo :(
$ su - myrole
Password:
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$ id
uid=397(myrole) gid=1(other)
$ /usr/sbin/useradd -g 879 tutu
UX: /usr/sbin/useradd: ERROR: Permission denied.
man roles, hasznos olvasmány
Each user may have zero or more roles. Roles have most of
the attributes of normal users and are identified like nor-
mal users in passwd(4) and shadow(4). Each role must have an
entry in the user_attr(4) file that identifies it as a role.
Roles can have their own authorizations and profiles. See
auths(1) and profiles(1).
Roles must have valid passwords and one of the shells that
interprets profiles: either pfcsh, pfksh, or pfsh. See
pfexec(1).
Role assumption may be performed using su(1M), rlogin(1), or
some other service that supports the PAM_RUSER variable.
Successful assumption requires knowledge of the role's pass-
word and membership in the role. Role assignments are speci-
fied in user_attr(4).
Ja, és bezárhatnád a postban a code taget rendesen, mert így a kommentek is csúnyák. Két helyen is hiányzik a / a lezáró tagből.
Koszi, majd legkozelebb, neztem en is, h csunya
Mivel azota se jott "megoldas", ugy veszem, hogy nem en rontok el valamit. De akkor hanem ki/mi? Eddig akarmi doksit/howtot neztem, mind kb. ugyanezt csinalja. Ha ebbol nem lesz valami holnap, az csunya lesz. Sajnos nem tudok remote-t adni, pedig meg 1-2 sort is megerne a segites.
Szerintem nem hagytam ki egy parancsot sem, de szóljál, ha nem pont ugyanezt kapod:
root@x # echo 'myprofile:::my profile:' >> /etc/security/prof_attr
root@x # echo 'myprofile:solaris:cmd:::/usr/sbin/useradd:uid=0' >> /etc/security/exec_attr
root@x # roleadd -c myrole -m -d /export/home/myrole myrole
root@x # passwd myrole
New Password:
Re-enter new Password:
passwd: password successfully changed for myrole
root@x # rolemod -P myprofile myrole
root@x # groupadd -g 200 mygroup
root@x # rolemod -g 200 myrole
root@x # useradd -g 200 -u 200 -c myuser -s /bin/bash -m -d /export/home/myuser myuser
root@x # usermod -R myrole myuser
root@x # su - myuser
Oracle Corporation SunOS 5.10 Generic Patch January 2005
myuser@x:~>roles
myrole
myuser@x:~>profiles
Basic Solaris User
All
myuser@x:~>su - myrole
Password:
\u@\h:\w>roles
No roles
\u@\h:\w>profiles
myprofile
Basic Solaris User
All
\u@\h:\w>which useradd
/usr/sbin/useradd
\u@\h:\w>useradd test
\u@\h:\w>userdel test
UX: userdel: ERROR: Permission denied.
\u@\h:\w>id test
uid=150027(test) gid=1(other)
ez igy majdnem ok. kicsit sok benne a su, majd raprobalok pfexec-cel, a group a trukk benne?
Közvetlenül userekhez is rendelhetsz profilokat, nem kell role-okhoz. Így kvázi sudo-ként tud a pfexec működni.
Nem tudom, hogy mi a trükk benne, de azt a feladatot meghagynám, hogy kiderítsd, a te módszeredből melyik lépés hiányzik...
ez a legutolsó method ez működik, pfexec is ok. holnap még1 próbát csinálok, remélem jó lesz, sztán lehet papírozni meg fröccsözni :)))