[Novalug] "Root" / sudo in Ubuntu (was launch perl script from ubuntu desktop)
rogerb at bronord.com
rogerb at bronord.com
Tue Jun 26 13:00:31 EDT 2007
A neat trick learnt from Peter (what's-his-name):
sudo bash
after entering a password, one is running a bash shell in-a-shell. Here, I do
things like
>nautilus
search directories and open files to edit them, from within nautilus but under
the privileged bash shell - a nice way to look thru directories and edit
config files, etc. One can also, of course,
>gedit
to open the simple editor.
Of course, don't forget to close the programs and ctrl-d out of the privileged
shell.
--
Roger W. Broseus
NEW Email: RogerB at bronord.com
NEW Web Site: www.bronord.com
> On Tue, 2007-06-26 at 09:50 -0400, Bonnie Dalzell wrote:
>> On Tue, 26 Jun 2007, Ed James wrote:
>>
>> EJ >Silly question, but have you tried it as root?
>> EJ >
>>
>> Ubuntu does not do root as in there being a root user. When you need to do
>> something as root you enter sudo and then the command and then the OS asks
>> you for your passowrd and then after you give the password you get to
>> execute the thing as root.
>
> There is a ROOT(0) user. Logins are just DISABLED by default.
>
> If you wish to log in as root {HIGHLY NOT recommended} but howto is:
>
> $ sudo -i {opens an interactive root shell see 'man sudo'}
>
> Now at the 'root' prompt run the command:
> # passwrd
> and follow the prompts to set the 'root' user password.
>
> Now it's possible to "log in a user root"
>
> The next set is to adjust 'gdm' to allow user 'root' to log in from the
> Graphic user login screen.
> See both 'man gdm' and the files in /usr/share/doc/gdm for how.
>
> IOW
> Ubuntu has a 'root' account it is just that logins are DISABLED by
> default for some very good reasons.
>>
>> So I can launch an editor to edit things that root needs to edit by
>> typing sudo gedit or sudo pico for example.
>>
>> My perl scripts launch just fine from the command line with the command:
>>
>> perl myprogram.pl
>>
>> It is trying to make a launcher on the desktop that is frustrating me.
>
> In the "launcher's" command line entry place the following:
> perl /full/path/to/myprogram.pl
>
> Now do you want to make it simpler to run, both from the command-line
> and it's entry in the "launcher"?
> {and even make it possible to 'double click' on the file and have it
> run from the browser.}
>
> To the top of the file 'myprogram.pl' add the following line:
> #!/usr/bin/perl
> /\ Note the '#' character must be the very first character of the file.
>
> And then set the file permissions to these:
> # chmod =rwxrxrx myprogram.pl
>
> {note you can adjust the permissions somewhat and my want to adjust the
> user and group.}
>
>
> --
> --
> Don E. Groves, Jr.
>
> $ /usr/games/fortune :
> In the first place, God made idiots; this was for practice; then he made
> school boards. -- Mark Twain
> _______________________________________________
> Novalug mailing list
> Novalug at calypso.tux.org
> http://calypso.tux.org/cgi-bin/mailman/listinfo/novalug
>
More information about the Novalug
mailing list