A strange request [Solved :) ]

Post here if you are a new Porteus member and you're looking for some help.
User avatar
brokenman
Site Admin
Site Admin
Posts: 5455
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: A strange request [Solved :) ]

Post#16 by brokenman » 24 Jun 2016, 01:57

No, if one is mostly working in always fresh mode.
I guess every situation is different. I work exclusively from fresh mode, but I always have a personal settings module that gets loaded along with base to make my life easier. On my system, guest is in the wheel group and I rarely have to enter a password.

I don't think you can echo a password to su unless you trick it somehow.
How do i become super user?
Wear your underpants on the outside and put on a cape.

donald
Full of knowledge
Full of knowledge
Posts: 1155
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Re: A strange request [Solved :) ]

Post#17 by donald » 24 Jun 2016, 02:56

@ Ed
Yes, it's me again.. :)

Some observations:
One has to use the guest Pw

Code: Select all

guest@porteus:~$ echo guest | sudo -S activate ./tree.xzm
if one uses the root PW ,toor, you get

Code: Select all

guest@porteus:~$ echo toor | sudo -S activate ./tree.xzm
Password: Have a gorilla...
Password: 
sudo: 1 incorrect password attempt
guest@porteus:~$
BUT
once the Pw is given it seems to be valid for some time.
(some Minutes)

to check this behavior open a terminal, start a program with sudo,
-- i use xfce so i used thunar --, close it and reopen it again

Code: Select all

guest@porteus:~$ sudo thunar
Password: 
guest@porteus:~$ sudo thunar
guest@porteus:~$ sudo thunar
guest@porteus:~$ sudo thunar
as you can see i had to give the Pw only once.

this works as long as i do it in the same terminal
(I don't know how long exactly it will work)
If you open a 2nd terminal and invoke the same command (e.g.sudo thunar)
you will be asked for the Pw while you still can start thunar (or whatever)
in the 1st terminal without Pw.-- crazy.

I'm writing this as an explanation for myself (and you) because i could not believe
that the command

Code: Select all

guest@porteus:~$ echo toor | sudo -S activate ...
did work for you -- because "echo toor" is definitely wrong..

User avatar
Ed_P
Contributor
Contributor
Posts: 3144
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: A strange request [Solved :) ]

Post#18 by Ed_P » 24 Jun 2016, 03:33

donald wrote:@ Ed
Yes, it's me again.. :)
Hey Don. Haven't heard from you in awhile. How are you? :D
I'm writing this as an explanation for myself (and you) because i could not believe
that the command

Code: Select all

guest@porteus:~$ echo toor | sudo -S activate ...
did work for you -- because "echo toor" is definitely wrong..
It does indeed work for me and in a new guest terminal window.

Code: Select all

guest@porteus:~$ chrome.sh
Activating Chrome module
Press Enter after Activated

Starting Chrome - takes a moment or two

Press Enter when done using Chrome.

Deactivating Chrome module

Cleaning up
guest@porteus:~$ 
A different script but same commands.

Code: Select all

if [ "$RUN_OPTION" = "" ]; then 
   echo Activating Chrome module
   echo toor | sudo -S activate $OPTIONAL/chrome.xzm     > /dev/null 2>&1 &
   echo Press Enter after Activated
   read


and


echo Deactivating Chrome module
echo toor | sudo -S deactivate $OPTIONAL/chrome.xzm     > /dev/null 2>&1 &
I do note that you are using Porteus 2.0 whereas I am using 3.0 so that may explain the difference results.

Will be interesting to see if it still works when I reboot in the morning. :D
Ed

donald
Full of knowledge
Full of knowledge
Posts: 1155
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Re: A strange request [Solved :) ]

Post#19 by donald » 24 Jun 2016, 21:05

Hi Ed
--> you are using Porteus 2.0 ..<--
xfce 3.2 rc3 32Bit (always fresh) was used. :shock:

I'm at a loss.. :unknown:

Bogomips
Full of knowledge
Full of knowledge
Posts: 2534
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: A strange request [Solved :) ]

Post#20 by Bogomips » 24 Jun 2016, 21:41

^^^

Cinnamon 3.2rc3 got GUI dialog as well. :)
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
Ed_P
Contributor
Contributor
Posts: 3144
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: A strange request [Solved :) ]

Post#21 by Ed_P » 24 Jun 2016, 21:42

donald wrote:xfce 3.2 rc3 32Bit (always fresh) was used. :shock:
I was going by the Distribution shown on your user id. It could be a rc3 problem. I haven't tried it there, yet.
Ed

User avatar
Ed_P
Contributor
Contributor
Posts: 3144
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: A strange request [Solved :) ]

Post#22 by Ed_P » 24 Jun 2016, 22:32

Yup. Me too. :( rc3 Cinnamon 64bit

Code: Select all

root@porteus:~# su guest
guest@porteus:/root$ cd /home/guest
guest@porteus:~$ ./chrome.sh
Password:                                                                <-------------------------------- 
Activating Chrome module
Press Enter after Activated

Starting Chrome - takes a moment or two

Press Enter when done using Chrome.

Deactivating Chrome module

Cleaning up
guest@porteus:~$ 
And only for the activate.

Code: Select all

if [ "$RUN_OPTION" = "" ]; then 
   echo Activating Chrome module
   echo toor | sudo -S activate $OPTIONAL/chrome.xzm     > /dev/null 2>&1 &
   echo Press Enter after Activated
   read
 :
 :
Ed

donald
Full of knowledge
Full of knowledge
Posts: 1155
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Re: A strange request [Solved :) ]

Post#23 by donald » 24 Jun 2016, 23:15

Ed, may i ask you to do a (simple) test?

(re-) boot into pure always fresh (guest)
open a terminal and run a program, e.g.like mousepad, with sudo
(it must be a fresh boot-up, otherwise the Pw may still be saved/valid)

Code: Select all

guest@porteus:~$ sudo mousepad
Password: 
use the root PW -toor-....this should not work.

If it works, than there is something wrong with the implementation of sudo.
IMHO sudo is meant to let a restricted user run a command with elevated rights,
without knowing the root Pw.(someone might correct me here)

(that's why "echo guest" works while "echo toor" should not)

maybe Mr. brokenman can shed some light on this matter.

User avatar
ncmprhnsbl
Full of knowledge
Full of knowledge
Posts: 842
Joined: 20 Mar 2012, 03:42
Distribution: 3.2.2-64bit xfce/openbox
Location: australia
Contact:

Re: A strange request [Solved :) ]

Post#24 by ncmprhnsbl » 24 Jun 2016, 23:30

donald wrote:IMHO sudo is meant to let a restricted user run a command with elevated rights,
without knowing the root Pw.(someone might correct me here)
pretty sure sudo can be set up in a number of ways, including using the root password(or none), it just defaults to the current users password...
its purpose is temporary priviledge escalation(one process or script) without a continuing root login...
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
brokenman
Site Admin
Site Admin
Posts: 5455
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: A strange request [Solved :) ]

Post#25 by brokenman » 25 Jun 2016, 00:11

pretty sure sudo can be set up in a number of ways, including using the root password(or none)
Yes this is correct. Compare both of your sudoers files and the problem should reveal itself. Also show if your user is in the wheel group or not.

EDIT:
Previously porteus only ever asked for the root password. Then we introduced sudo and sudoers was changed to ask for the root password so as not to confuse users. Sudo was gradually integrated and now should only ask for the user password.
How do i become super user?
Wear your underpants on the outside and put on a cape.

donald
Full of knowledge
Full of knowledge
Posts: 1155
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Re: A strange request [Solved :) ]

Post#26 by donald » 25 Jun 2016, 00:26

@ ncmprhnsbl, brokenman

Thanks for that.
I haven't thought about the fact that "sudo" might be configured differently
in the various versions of porteus.. :oops:

Ed, sorry for the confusion that I have caused.

User avatar
Ed_P
Contributor
Contributor
Posts: 3144
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: A strange request [Solved :) ]

Post#27 by Ed_P » 25 Jun 2016, 15:09

donald wrote:Ed, may i ask you to do a (simple) test?

(re-) boot into pure always fresh (guest)
open a terminal and run a program, e.g.like mousepad, with sudo
(it must be a fresh boot-up, otherwise the Pw may still be saved/valid)

Code: Select all

guest@porteus:~$ sudo mousepad
Password: 
use the root PW -toor-....this should not work.
Sure.

Code: Select all

guest@porteus:~$ sudo mousepad

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

Password: 
I feel much better now.
Password: 
You do that again and see what happens...
Password: 
Two responses of "toor" one of "guest". And a banner at the top of Mousepad (a strange name for a text editor) shows:

Code: Select all

Warning, you are using the root account, you may harm your system.
And thank you brokenman for the explanation.
donald wrote: Ed, sorry for the confusion that I have caused.
No problem and no confusion. We've ended up with clarify. :good:

Thank you all. :beer:
Ed

Post Reply