Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-20-2008, 08:06 AM
PJ Beers
 
Posts: n/a
Default Unable to su

Dear slackers, I have no idea what the solution to my problem might be,
so I turn to you. The short of it is that I can no longer su to root.
If I run su I get the following output:

~$ su
Password:
Sorry.
~$

I still am able to log in as root, so I think something must be wrong
with my own useraccount, but I don't know what. I did not forget root's
password, in any case.

Likewise, I have also become unable to mount my iPod, which formerly I
could. Root can still mount it, fstab formerly said, and still says

/dev/ipod /mnt/ipod vfat noauto,defaults,gid=100,user

but I can't.

I googled about the su issue, but the only fix I saw concerned the
permissions for su, and they are correct on my box (I checked against
the package from which it originated).

Now, what I'm looking for is a way to fix my user-acount, so that I'm
able to su again, and so that I can mount partitions which users should
be able to mount again.

To clarify, all this happened after I made some changes to my
partitions. It's a long story so I'll only mention what I think is most
important. I have Slackware 10.1 installed on two Reiserfs partitions,
one for / and one for /home. Among other things,

(1) I added a partition, which effectively moved Slackware from
/dev/hda8 and /dev/hda9 to /dev/hda9 and /dev/hda10 (and afterwards
changed fstab accordingly, reinstalled grub to the boot record of root,
etcetera; I re-installed grub many times, I load it from ntldr, the
winXP boot manager).

(2) I imaged, restored, shrinked and then enlarged my root partition (in
that order, to counter some unexpected side-effects of restoring an
image to a larger partition), after which reiserfsck prompted my to run
with the option --rebuild-tree. After that I was able to login as root
again, and for root everything seemed to work fine.

(3) I imaged and restored my /home-partition, and then zipped (to a
fat-drive) and unzipped the /home/'my account'-folder.

Somewhere I must have done something wrong, but I don't know what, or
what might have changed. I did check the file-permissions in my
home-folder, but all files seem to be owned by me, and group users, so
I'd say nothing's wrong there. I also erased all temp-files that were
associated with my user-account, but to no avail.

Well, I hope you have some further ideas to solve this. If this is the
wrong place for my question I'll check elsewhere, just tell me.

Regards,
PJ
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-20-2008, 08:06 AM
buzzedlightyear
 
Posts: n/a
Default Re: Unable to su

to mount my ipod as user...i have this in my /etc/fstab:
/dev/sda2 /mnt/ipod/ vfat noauto,users,rw
0 0
i can mount it as user and it works fine, so i'd say try that entry and
see if it works. btw...why does it show ipod under dev? just out of
curiousity, what do you use to interface with your ipod? gtkpod?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-20-2008, 08:06 AM
PJ Beers
 
Posts: n/a
Default Re: Unable to su

buzzedlightyear wrote:
> to mount my ipod as user...i have this in my /etc/fstab:
> /dev/sda2 /mnt/ipod/ vfat noauto,users,rw
> 0 0
> i can mount it as user and it works fine, so i'd say try that entry and
> see if it works.


Well, I'd be surprised if it did, because before I was able to mount it
myself fine, I'll try though.

> btw...why does it show ipod under dev? just out of
> curiousity, what do you use to interface with your ipod? gtkpod?


I have a 2.6 kernel installed and use udev. It works like this; in
/etc/udev/rules.d/udev.rules I added the following as the first rule:

BUS="scsi", SYSFS{model}="iPod ", KERNEL="sd?2", NAME="%k",
SYMLINK="ipod"

(I found this on the gtkpod-page, and yes, I do use gtkpod, works great )

After that, when I plug in my iPod it can be mounted as /dev/ipod.

PJ
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-20-2008, 08:06 AM
PJ Beers
 
Posts: n/a
Default Re: Unable to su

PJ Beers wrote:
> buzzedlightyear wrote:
>> to mount my ipod as user...i have this in my /etc/fstab:
>> /dev/sda2 /mnt/ipod/ vfat noauto,users,rw
>> 0 0
>> i can mount it as user and it works fine, so i'd say try that entry and
>> see if it works.

>
> Well, I'd be surprised if it did, because before I was able to mount it
> myself fine, I'll try though.


Just tried it, to no avail:

~$ mount /dev/sda2
mount: must be superuser to use mount
~$

PJ
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-20-2008, 08:06 AM
buzzedlightyear
 
Posts: n/a
Default Re: Unable to su

try 'mount /mnt/ipod' ...its mountpoind instead of the device
itself...thats what i do. maybe your's is just borked though.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-20-2008, 08:06 AM
PJ Beers
 
Posts: n/a
Default Re: Unable to su

buzzedlightyear wrote:
> try 'mount /mnt/ipod' ...its mountpoind instead of the device
> itself...thats what i do. maybe your's is just borked though.


Doesn't work either. I don't think the problem is in fstab or with the
iPod, which I can use perfectly well if I mount it as root:

~# mount -o uid=1000 /dev/ipod /mnt/ipod

works perfectly. I'm not sure whether I need the uid=1000 bit, but it
doesn't hurt

No, I think something's wrong with my user-account, something that would
explain both the su problem and the mount problem; if only I knew what...

PJ
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-20-2008, 08:06 AM
Menno Duursma
 
Posts: n/a
Default Re: Unable to su

On Mon, 06 Jun 2005 22:08:21 +0200, PJ Beers wrote:

> If I run su I get the following output:
>
> ~$ su
> Password:
> Sorry.


Check that the permissions on "su" are correct, on my box it looks like:

~$ ls -l /bin/su
-rws--x--- 1 root wheel 35780 2004-06-21 21:20 /bin/su*

Which means users should be in the "wheel" group for them to access it at
all ("menno" is, but "pan" is not, etc.) And as it's a SUID binary when is
does get run, it will be executed with the privileges of the user owning
it, rather then the user that spawn it (root in this case).

Try something like:

gpasswd -a pj wheel
chgrp wheel /bin/su
chmod 4710 /bin/su

If this seems to make no sense, here is a more elaborate attempt of mine
to explain the SUID concept:
http://groups-beta.google.com/group/...eacf7c3639f04f

Another thing concerning /bin/su , maybe the authentication method or
user/group authorization configured in you /etc/suauth , for that read:

man suauth

> I still am able to log in as root, so I think something must be wrong
> with my own useraccount, but I don't know what. I did not forget root's
> password, in any case.
>
> Likewise, I have also become unable to mount my iPod, which formerly I
> could. Root can still mount it, fstab formerly said, and still says
>
> /dev/ipod /mnt/ipod vfat noauto,defaults,gid=100,user
>
> but I can't.


Here again "mount" needs root (or actually EUID 0) privileges to work, so
change the permissions to suid, like:

chgrp wheel /bin/mount
for p in go-rwx g+x u+srwx ; do chmod $p /bin/mount ; done

> I googled about the su issue, but the only fix I saw concerned the
> permissions for su,


Which are very likely to be the problem indeed.

> and they are correct on my box (I checked against the package from
> which it originated).


Are you really sure about that?

--
-Menno.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-20-2008, 08:07 AM
PJ Beers
 
Posts: n/a
Default Re: Unable to su

Menno Duursma wrote:
> On Mon, 06 Jun 2005 22:08:21 +0200, PJ Beers wrote:
>
>>If I run su I get the following output:
>>
>>~$ su
>>Password:
>>Sorry.

>
> Check that the permissions on "su" are correct, on my box it looks like:
>
> ~$ ls -l /bin/su
> -rws--x--- 1 root wheel 35780 2004-06-21 21:20 /bin/su*
>
> Which means users should be in the "wheel" group for them to access it at
> all ("menno" is, but "pan" is not, etc.) And as it's a SUID binary when is
> does get run, it will be executed with the privileges of the user owning
> it, rather then the user that spawn it (root in this case).
>
> Try something like:
>
> gpasswd -a pj wheel
> chgrp wheel /bin/su
> chmod 4710 /bin/su


<snip>

On my box, permissions are:

~$ ls -l /bin/su
-rwx--x--x 1 root root 35780 2005-06-05 21:32 /bin/su*

Now I took a risk, and removed and reinstalled the shadow-package (from
Slackware 10.1, the same version as I was using, from which /bin/su
originated). Now I get:

~$ ls -l /bin/su
-rws--x--x 1 root bin 35780 2004-06-21 21:20 /bin/su*

Apparently, I _did_ miss one important part of the permissions, i.e. the
's'-bit. Can it be that the 's'-bits were changed during all the imaging
and resizing operations?

By the way, I never noticed that before, to be honest... Is that what
you called the SUID-bit? How can I set the suid? (Already found that
out, see below.)

Also, if I understand correctly I don't need to make use of the
wheel-group if I leave su executable by others, as it is now...

Anyway, reinstalling the shadow-package did solve the su problem, so
thanks already!

So next... Might the above mean that permissions on mount have changed?

Right now I have:

~$ ls -l /bin/mount
-rwxr-xr-x 1 root root 61308 2005-06-05 21:32 /bin/mount*

and in the original package it says -rwsr-xr-x...

Can it be that imaging and restoring, and/or resizing partitions may
have changed all the suid-permissions to x-permissions? And how do I set
the suid-permission?

Currently my suid-binaries are:

~$ find / -type f -perm +4000 -ls 2>/dev/null
48188 36 -rws--x--x 1 root bin 35780 Jun 21 2004 /bin/su
57940 32 -rws--x--x 1 root bin 29492 Jun 21 2004
/usr/bin/chfn
57941 28 -rws--x--x 1 root bin 27780 Jun 21 2004
/usr/bin/chsh
57942 36 -rws--x--x 1 root bin 34540 Jun 21 2004
/usr/bin/chage
57943 20 -rws--x--x 1 root bin 16652 Jun 21 2004
/usr/bin/expiry
57944 20 -rws--x--x 1 root bin 19948 Jun 21 2004
/usr/bin/newgrp
57945 40 -rws--x--x 1 root bin 37880 Jun 21 2004
/usr/bin/passwd
57946 36 -rws--x--x 1 root bin 34616 Jun 21 2004
/usr/bin/gpasswd

Also, how do I find out which files originally had the suid-bit? I
thought of ~$ cat /var/log/packages/* |grep rws, but that didn't help

<snip>


> Here again "mount" needs root (or actually EUID 0) privileges to work, so
> change the permissions to suid, like:
>
> chgrp wheel /bin/mount
> for p in go-rwx g+x u+srwx ; do chmod $p /bin/mount ; done


Ok, I did the following:

~$ ls -l /bin/mount
-rwxr-xr-x 1 root root 61308 2005-06-05 21:32 /bin/mount*
~$ su
/home/pj# for p in go-rwx g+x u+srwx ; do chmod $p /bin/mount ; done
# exit
exit
~$ ls -l /bin/mount
-rws--x--- 1 root root 61308 2005-06-05 21:32 /bin/mount*

and then changed my mind and did:

/home/pj# for p in go+x g+x u+srwx ; do chmod $p /bin/mount ; done

Anyway, this seems to have helped Now I can mount the iPod myself
again! Thanks very much, the link to your explanation of chmod did help
alot.

PJ






>
>
>>I googled about the su issue, but the only fix I saw concerned the
>>permissions for su,

>
>
> Which are very likely to be the problem indeed.
>
>
>>and they are correct on my box (I checked against the package from
>>which it originated).

>
>
> Are you really sure about that?
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-20-2008, 08:07 AM
PJ Beers
 
Posts: n/a
Default Re: Unable to su

This is just to make a long story short, my previous post was overly
elaborative; the following is what was important:

Can it be that imaging and restoring, and/or resizing partitions
changed all the suid-permissions to x-permissions?

- and -

How do I find out which files originally had the suid-bit?
I.e., after a fresh Slack-10.1 install?

- finally -

Your (Menno's) explanation of _suid_, not _chmod_, helped a lot! Thanks.

To clarify, I'm still a bit to Linux, and to Slackware especially

Cheers!

PJ

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-20-2008, 08:07 AM
Menno Duursma
 
Posts: n/a
Default Re: Unable to su

On Tue, 07 Jun 2005 02:02:38 +0200, PJ Beers wrote:

> Can it be that imaging and restoring, and/or resizing partitions
> changed all the suid-permissions to x-permissions?


Depending on the exact way one has gone about "imaging" : yes.
(A simple "cp" or "tar" without "p" would do that, for instance.)

> How do I find out which files originally had the suid-bit?
> I.e., after a fresh Slack-10.1 install?


Get the manifest from here:
ftp://ftp.slackware.com/pub/slackwar...0.1/slackware/

Then search through it for the information you seek i.e.:

bzcat MANIFEST.bz2 |grep "\-rws"

--
-Menno.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:39 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646