RE: [suse-linux-uk-schools] wont run as root
With this solution. I tried ssh -x user@localhost and then ran the app but it failed to connect to Xserver. Just as it did when I tried the same operation with ssh.
With this one, the x has to be upper case, and you should specify the command you are trying to execute as part of the single continuous line. Let's suppose you were trying to run Yast2 as the root user in and xterm, while you were logged in as the user fred. The full path to Yast2 is actually: /sbin/yast2 So, in your xterm you would type as a single command: ssh -X root@localhost /sbin/yast2 You will then be asked to provide a password, which is that of the root user. After all that, the program, yast2 would start up. In the command line simply replace /sbin/yast2 with the full path to the program you want to run. (If you don't know the full path, you can find it out by typing: whereis yast2 whereis myprog etc In some cases you may need to do this investigation actually logged in as root, simply because some programs are privileged and may only be accessed by that user. Once you've determined the full path to the program, you can return to your humble user's x session and try again. Hope this helps Andrew -- Email: aray@computerpark.co.uk --------------------------------------------------------- This private and confidential e-mail has been sent to you by Computer Park Ltd. If you are not the intended recipient of this e-mail and have received it in error, please notify us via the email address or telephone number below, and then delete it from your mailbox. Email: mailbox@computerpark.co.uk Tel: +44 (0) 1536 417155 Fax: +44 (0) 1536 417566 Head Office: Computer Park Ltd, Broughton Grange, Headlands, Kettering Northamptonshire NN15 6XA Registered in England: 3022961. Registered Office: 6 North Street, Oundle, Peterborough PE8 4AL =========================================================
--- Andrew RAY <aray@computerpark.co.uk> wrote:
With this solution. I tried ssh -x user@localhost and then ran the app but it failed to connect to Xserver. Just as it did when I tried the same operation with ssh.
With this one, the x has to be upper case, and you should specify the command you are trying to execute as part of the single continuous line. Let's suppose you were trying to run Yast2 as the root user in and xterm, while you were logged in as the user fred.
The full path to Yast2 is actually:
/sbin/yast2
So, in your xterm you would type as a single command:
ssh -X root@localhost /sbin/yast2
You will then be asked to provide a password, which is that of the root user.
After all that, the program, yast2 would start up.
In the command line simply replace /sbin/yast2 with the full path to the program you want to run.
(If you don't know the full path, you can find it out by typing:
whereis yast2
whereis myprog
I'd be more inclined to do: ssh -X root@localhost $(which app) That way, the string of the interpolated subshell will evaluate to the program specified -- moreover, this will only work with the program in $PATH. -- Thomas Adam ===== Thomas Adam "The Linux Weekend Mechanic" -- www.linuxgazette.com ________________________________________________________________________ Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://mail.messenger.yahoo.co.uk
I'd be more inclined to do:
ssh -X root@localhost $(which app)
That way, the string of the interpolated subshell will evaluate to the program specified -- moreover, this will only work with the program in $PATH.
I think I'm getting lost in your syntax here, please forgive me. BUT, taking my example of yast2, which on a SuSE system is in /sbin/yast2, what exactly would you like to see typed on a single command line? Andrew -- Email: aray@computerpark.co.uk --------------------------------------------------------- This private and confidential e-mail has been sent to you by Computer Park Ltd. If you are not the intended recipient of this e-mail and have received it in error, please notify us via the email address or telephone number below, and then delete it from your mailbox. Email: mailbox@computerpark.co.uk Tel: +44 (0) 1536 417155 Fax: +44 (0) 1536 417566 Head Office: Computer Park Ltd, Broughton Grange, Headlands, Kettering Northamptonshire NN15 6XA Registered in England: 3022961. Registered Office: 6 North Street, Oundle, Peterborough PE8 4AL =========================================================
--- Andrew RAY <aray@computerpark.co.uk> wrote:
I'd be more inclined to do:
ssh -X root@localhost $(which app)
That way, the string of the interpolated subshell will evaluate to the program specified -- moreover, this will only work with the program in $PATH.
I think I'm getting lost in your syntax here, please forgive me. BUT, taking my example of yast2, which on a SuSE system is in /sbin/yast2, what exactly would you like to see typed on a single command line?
Sorry, I agree entirely. My point was if you do: whereis APP_NAME then you have to issue *that*, find the path, and then add it as an option to the command. You could argue that if "APP_NAME" is in $PATH then you don't need to use $(which...) in which case I would agree. I was generalising in my example, and not referring to yast2 per se. :) -- Thomas Adam ===== Thomas Adam "The Linux Weekend Mechanic" -- www.linuxgazette.com ________________________________________________________________________ Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://mail.messenger.yahoo.co.uk
I thought you meant macro expansion, so, to take a different example, let's assume netscape is the application (usually placed in /opt/netscape/netscape, not usually on the $PATH). Am I to assume that you meant type: ssh -X root@localhost $(which netscape) because the macro expansion fails, and you end up with a defaulted ssh session as the root user, hash prompt and all. ssh -X root@localhost /opt/netscape/netscape will, of course, work every time, however, and has the additional advantage that it can be included in that fashion in any shell-script, or as a short-cut on the desk-top etc.etc. Andrew -- Email: aray@computerpark.co.uk --------------------------------------------------------- This private and confidential e-mail has been sent to you by Computer Park Ltd. If you are not the intended recipient of this e-mail and have received it in error, please notify us via the email address or telephone number below, and then delete it from your mailbox. Email: mailbox@computerpark.co.uk Tel: +44 (0) 1536 417155 Fax: +44 (0) 1536 417566 Head Office: Computer Park Ltd, Broughton Grange, Headlands, Kettering Northamptonshire NN15 6XA Registered in England: 3022961. Registered Office: 6 North Street, Oundle, Peterborough PE8 4AL =========================================================
--- Andrew RAY <aray@computerpark.co.uk> wrote:
I thought you meant macro expansion, so, to take a different example, let's assume netscape is the application (usually placed in /opt/netscape/netscape, not usually on the $PATH).
Am I to assume that you meant type:
ssh -X root@localhost $(which netscape)
because the macro expansion fails, and you end up with a defaulted ssh session as the root user, hash prompt and all.
That is what would happen if $(which netscape) returned nothing, yes.
ssh -X root@localhost /opt/netscape/netscape
will, of course, work every time, however, and has the additional advantage that it can be included in that fashion in any shell-script, or as a short-cut on the desk-top etc.etc.
Oh, agreed. Even if netscape wasn't in /opt/netscape, it wouldn't take a genius to realise that all he has to do is change the location. The hard-coded form is perhaps more portable. In the old days "which" was actually an alias to "type -p". -- Thomas Adam ===== Thomas Adam "The Linux Weekend Mechanic" -- www.linuxgazette.com ________________________________________________________________________ Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://mail.messenger.yahoo.co.uk
Andrew RAY said:
With this solution. I tried ssh -x user@localhost and then ran the app but it failed to connect to Xserver. Just as it did when I tried the same operation with ssh.
With this one, the x has to be upper case, and you should specify the command you are trying to execute as part of the single continuous line. Let's suppose you were trying to run Yast2 as the root user in and xterm, while you were logged in as the user fred.
The full path to Yast2 is actually:
/sbin/yast2
So, in your xterm you would type as a single command:
ssh -X root@localhost /sbin/yast2
I didnt realise the "x" had to be "X" so guess thats why it didnt work. But I know now. Cheers
You will then be asked to provide a password, which is that of the root user.
After all that, the program, yast2 would start up.
In the command line simply replace /sbin/yast2 with the full path to the program you want to run.
(If you don't know the full path, you can find it out by typing:
whereis yast2
whereis myprog
etc
In some cases you may need to do this investigation actually logged in as root, simply because some programs are privileged and may only be accessed by that user.
Once you've determined the full path to the program, you can return to your humble user's x session and try again.
Hope this helps
Andrew
-- Email: aray@computerpark.co.uk
---------------------------------------------------------
This private and confidential e-mail has been sent to you by Computer Park Ltd.
If you are not the intended recipient of this e-mail and have received it in error, please notify us via the email address or telephone number below, and then delete it from your mailbox.
Email: mailbox@computerpark.co.uk
Tel: +44 (0) 1536 417155 Fax: +44 (0) 1536 417566
Head Office: Computer Park Ltd, Broughton Grange, Headlands, Kettering Northamptonshire NN15 6XA
Registered in England: 3022961.
Registered Office: 6 North Street, Oundle, Peterborough PE8 4AL
=========================================================
-- To unsubscribe, e-mail: suse-linux-uk-schools-unsubscribe@suse.com For additional commands, e-mail: suse-linux-uk-schools-help@suse.com
participants (3)
-
Andrew Nix
-
Andrew RAY
-
Thomas Adam