Re: Shell confusion
Thanks to all the contributors to this subject. I am pleased to say that I managed to work around the problems I was having, and understand the causes of the problems. Of course, I also had to get to grips with vim, I'll be doing my own introductory document on that shortly. It's been 25 years since I last used a line editor and took a bit of searching to find the right basic information. Anyway, if you contributed, consider your name listed here. Thanks again. Dave -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Shell confusion
Garry T. Williams wrote: On Thursday 12 March 2009 21:25:27 Dave Bolt IT Solutions wrote: When I start a terminal as dave I get a prompt [d...@test-host ~]$ When I do su amandabackup I get a prompt bash-3.2$ ^^^ Check the manual page for su(1). If you had entered `su - amandabackup', that user's login scripts would have been run. In general, using su without its `-' parameter is a bad idea[*] especially when switching to the root login. Interesting thought, I generally warn people that - or -l will do a login, and they will wind up running in the other user's home directory. Definitely not what people want many times, such as running make install after building a package, or the like. For instance sudo su root -c make install runs the install rules in the current directory, probably just what you wanted. sudo su - -c make install runs the install part of whatever Makefile is in root's home directory. Almost certainly not what you intended! __ [*] Unless, of course, you know why you want to do that. -- Bill Davidsen david...@tmr.com We have more to fear from the bungling of the incompetent than from the machinations of the wicked. - from Slashdot -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Shell confusion
Matthew Flaschen wrote: You should not run GUI apps under a root shell. Do: sudo gedit or better yet: sudoedit /etc/the_config.ext May I suggest: gedit sftp://r...@localhost/etc/foo.conf as an alternative? :-) Of course this only works if you have sshd running, but it avoids running the whole GUI app as root. That works with all editors using gio/gvfs or the old gnome-vfs (e.g. gedit) or KIO (KWrite, Kate etc.). Kevin Kofler -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Shell confusion
Thanks for the explanation of the use of - in the su command. I checked the man pages for su, (why did you put su(1)), and found the following comment about a login shell, -, -l, --login make the shell a login shell which did not lead me to understand that a user's login script would have been run. (Doesn't seem to make any difference in this case anyway). Regards Dave - Original Message - From: Garry T. Williams gtwilli...@gmail.com Check the manual page for su(1). If you had entered `su - amandabackup', that user's login scripts would have been run. In general, using su without its `-' parameter is a bad idea[*] especially when switching to the root login. __ [*] Unless, of course, you know why you want to do that. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Shell confusion
On Fri, Mar 13, 2009 at 01:25:27AM -, Dave Bolt IT Solutions wrote: Since both of these users are apparently configured for bash, can anyone explain what is happening? The sentence configured for bash is a nonsense statement. You have used su to switch to a user that does not have access to the currently running X display, hence the error. All perfectly normal. -- Marc Wilson | Love your enemies: they'll go crazy trying to figure m...@cox.net | out what you're up to. Like the 'Love your enemies..' comment. :) So what I mean is that when I look at the user in System -Administration-Users and Groups, I see that both dave and amandabackup have /bin/bas as the login shell, in other words configured to use bash. Anything more complicated regarding configuration is beyond my current knowledge, so your clarification is welcomed. Regards Dave -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Shell confusion
On Fri, 2009-03-13 at 15:09 +, Dave Bolt IT Solutions wrote: Thanks for the explanation of the use of - in the su command. I checked the man pages for su, (why did you put su(1)), and found the Because the man pages have traditionally been organised into several sections. The number in parentheses indicates the section of the manual that the page is in (this is important since for e.g. there are library calls that have the same name as commands, e.g. /usr/bin/printf is documented in printf(1) but the printf call in the stdio library is documented in printf(3)). The conventional man sections are: 1 User Commands 2 System Calls 3 C Library Functions 4 Devices and Special Files 5 File Formats and Conventions 6 Games et. Al. 7 Miscellanea 8 System Administration tools and Deamons See man man for more information. Regards, Bryn. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Shell confusion
On Fri, 2009-03-13 at 15:41 +, Bryn M. Reeves wrote: On Fri, 2009-03-13 at 15:09 +, Dave Bolt IT Solutions wrote: Thanks for the explanation of the use of - in the su command. I checked the man pages for su, (why did you put su(1)), and found the Because the man pages have traditionally been organised into several sections. The number in parentheses indicates the section of the manual that the page is in (this is important since for e.g. there are library calls that have the same name as commands, e.g. /usr/bin/printf is documented in printf(1) but the printf call in the stdio library is documented in printf(3)). The conventional man sections are: 1 User Commands 2 System Calls 3 C Library Functions 4 Devices and Special Files 5 File Formats and Conventions 6 Games et. Al. 7 Miscellanea 8 System Administration tools and Deamons See man man for more information. Doh. Forgot to mention that to select a section you just put the number as the first argument to man. E.g: $ man 1 printf - /usr/bin/printf's man page $ man 3 printf - printf() call in stdio.h's man page Bryn. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Shell confusion
On Fri, 2009-03-13 at 15:09 +, Dave Bolt IT Solutions wrote: Thanks for the explanation of the use of - in the su command. I checked the man pages for su, (why did you put su(1)), and found the following comment about a login shell, -, -l, --login make the shell a login shell which did not lead me to understand that a user's login script would have been run. (Doesn't seem to make any difference in this case anyway). Regards Dave - Original Message - From: Garry T. Williams gtwilli...@gmail.com Check the manual page for su(1). If you had entered `su - amandabackup', that user's login scripts would have been run. In general, using su without its `-' parameter is a bad idea[*] especially when switching to the root login. I've been watching this thread because others are much more shell knowledgeable than I but my understanding of bash usage of the 'su' command is... [cr...@aspire-one X11]$ su - gedit xorg.conf su: user gedit does not exist # this doesn't work because it expects the next argument to be the actual user [cr...@aspire-one X11]$ su - -c 'xorg.conf' Password: -bash: xorg.conf: command not found # this passes the -c argument (execute command), getting closer but still a failure because the system didn't understand what I wanted. [cr...@aspire-one X11]$ su - -c 'gedit xorg.conf' Password: # this was really close but even though my current directory was /etc/X11, the file xorg.conf was empty and had I saved my edits, it would have saved them in /root because when executing the 'su -' portion of the argument, it loaded root's environment which caused it to switch the current path to /root [cr...@aspire-one X11]$ su - -c 'gedit /etc/X11/xorg.conf' Password: # this clearly works as it specifically calls the editor and the exact file to edit. [cr...@aspire-one X11]$ su -c 'gedit xorg.conf' Password: # this sort of works but it does toss the following error which I can seemingly ignore...I don't recommend this but it doesn't load the normal root environment which moves me back to /root. Failed to get connection to session: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.) I would probably suggest that you get used to a terminal based editor rather than a GUI editor (something like vi or emacs) and you could just 'su -' and become root and not have to deal with various security issues of running gtk as root but even so, the usage of '-c' option with the su command gives you the ability to become superuser for just one process, much like the sudo command (and sometimes sudo is easier but you have to edit /etc/sudoers to allow yourself to sudo). Craig -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Shell confusion
You should not run GUI apps under a root shell. Do: sudo gedit or better yet: sudoedit /etc/the_config.ext Matt Flaschen Only, dave is not in the sudoers file. This incident will be reported. So, I found the sudoers file, but not at all clear about exaclty what I need to put in there. Once again, I have to learn one thing in order to do another. Any help here? Thanks Dave -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Shell confusion
Dave Bolt IT Solutions wrote: You should not run GUI apps under a root shell. Do: sudo gedit or better yet: sudoedit /etc/the_config.ext Matt Flaschen Only, dave is not in the sudoers file. This incident will be reported. So, I found the sudoers file, but not at all clear about exaclty what I need to put in there. Once again, I have to learn one thing in order to do another. Any help here? Thanks Dave you need to uncomment the #%wheelALL=(ALL)ALL to %wheelALL=(ALL)ALL in the sudoers file, then add your user account to the wheel group using system-config-users phil -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Shell confusion
Matthew Flaschen wrote: You should not run GUI apps under a root shell. Do: sudo gedit What is the difference between running su - -c gedit and sudo gedit - they both run gedit as with root permissions. The only difference I know about is that the first form runs with root's environment. (Like the -i option of sudo.) I would expect this to be marginally safer, as you know you are using root's path. or better yet: sudoedit /etc/the_config.ext This is much safer, and you can still use gedit as your editor if you want by setting the VISUAL or EDITOR environment variables. Mikkel -- Do not meddle in the affairs of dragons, for thou art crunchy and taste good with Ketchup! signature.asc Description: OpenPGP digital signature -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Shell confusion
Mikkel L. Ellertson wrote: Matthew Flaschen wrote: You should not run GUI apps under a root shell. Do: sudo gedit What is the difference between running su - -c gedit and sudo gedit - they both run gedit as with root permissions. The only difference I know about is that the first form runs with root's environment. (Like the -i option of sudo.) I would expect this to be marginally safer, as you know you are using root's path. Just so. using the - causes execution of the initialization done at login as the shell starts. This can include .bashrc, .bash_profile, etc, etc. The the bash man page for the exact precedence of that stuff. or better yet: sudoedit /etc/the_config.ext This is much safer, and you can still use gedit as your editor if you want by setting the VISUAL or EDITOR environment variables. Mikkel -- Bill Davidsen david...@tmr.com We have more to fear from the bungling of the incompetent than from the machinations of the wicked. - from Slashdot -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Shell confusion
psmith wrote: dave is not in the sudoers file. This incident will be reported. So, I found the sudoers file, but not at all clear about exaclty what I need to put in there. Once again, I have to learn one thing in order to do another. Any help here? Thanks Dave you need to uncomment the #%wheelALL=(ALL)ALL to %wheelALL=(ALL)ALL in the sudoers file, then add your user account to the wheel group using system-config-users That's simplest, but you can also grant it directly to an account, and/or grant different privileges to different accounts. Matt Flaschen -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Shell confusion
On Fri, Mar 13, 2009 at 3:49 PM, Matthew Flaschen matthew.flasc...@gatech.edu wrote: psmith wrote: dave is not in the sudoers file. This incident will be reported. So, I found the sudoers file, but not at all clear about exaclty what I need to put in there. Once again, I have to learn one thing in order to do another. Any help here? Thanks Dave you need to uncomment the #%wheel ALL=(ALL) ALL to %wheel ALL=(ALL) ALL in the sudoers file, then add your user account to the wheel group using system-config-users That's simplest, but you can also grant it directly to an account, and/or grant different privileges to different accounts. Matt Flaschen Yes, it can get very granular indeed. I prefer that approach better. ~af -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Shell confusion
When I start a terminal as dave I get a prompt [d...@test-host ~]$ When I do su amandabackup I get a prompt bash-3.2$ From the first prompt I can launch gedit, from the second I get an error, No protocol specified, gedit:4724, Gtk-WARNING ** cannot open display. Since both of these users are apparently configured for bash, can anyone explain what is happening? Or where I have to look to see the difference in configuration? Thanks Dave -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Shell confusion
Dave Bolt IT Solutions wrote: When I start a terminal as dave I get a prompt [d...@test-host ~]$ When I do su amandabackup I get a prompt bash-3.2$ From the first prompt I can launch gedit, from the second I get an error, No protocol specified, gedit:4724, Gtk-WARNING ** cannot open display. Since both of these users are apparently configured for bash, can anyone explain what is happening? You should not run GUI apps under a root shell. Do: sudo gedit or better yet: sudoedit /etc/the_config.ext Matt Flaschen -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Shell confusion
On Fri, 2009-03-13 at 01:25 +, Dave Bolt IT Solutions wrote: When I start a terminal as dave I get a prompt [d...@test-host ~]$ When I do su amandabackup I get a prompt bash-3.2$ The prompt display is configured per user, the amandabackup user appears to not have any configuration. You can see the same thing by creating a new user, and wiping out *all* the files and directories in their homespace, but most specifically, the dot-prefixed bash files (.bash_profile /or .bashrc). From the first prompt I can launch gedit, from the second I get an error, No protocol specified, gedit:4724, Gtk-WARNING ** cannot open display. My guess might be that the amandabackup user doesn't have a homespace, or points to one with permissions or SELinux restrictions preventing it being used as normal homespace. Since both of these users are apparently configured for bash, can anyone explain what is happening? They're *probably* not, bash is *probably* the default, in the absence of configuration to the contrary. I saw a similar thing (shell prompts disallowed displays) when I did an experiment of trying to use a FAT32 formatted USB memory stick as the homespace for a new user. -- [...@localhost ~]$ uname -r 2.6.27.19-78.2.30.fc9.i686 Don't send private replies to my address, the mailbox is ignored. I read messages from the public lists. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Shell confusion
On Fri, Mar 13, 2009 at 01:25:27AM -, Dave Bolt IT Solutions wrote: Since both of these users are apparently configured for bash, can anyone explain what is happening? The sentence configured for bash is a nonsense statement. You have used su to switch to a user that does not have access to the currently running X display, hence the error. All perfectly normal. -- Marc Wilson | Love your enemies: they'll go crazy trying to figure m...@cox.net | out what you're up to. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines