0

Edit: echo and sudo used together as shown below can have unexpected consequences. Please avoid such usage as far as possible.

I'm on Lubuntu 12.10 fully updated.

I know that what I'm asking could be a security risk but I would still like to understand what's happening.

I can get the following aliases to work:

fast='echo "mypassword" | sudo -S apt-fast update && sudo apt-fast upgrade'
nm='echo "mypassword" | sudo -S service network-manager restart'
aalog='echo "mypassword" | sudo -S aa-logprof'
reloadsm='echo "mypassword" | sudo -S apparmor_parser -r /etc/apparmor.d/usr.local.seamonkey.seamonkey'
reloadgc='echo "mypassword" | sudo -S apparmor_parser -r /etc/apparmor.d/opt.google.chrome.google-chrome'

But when I try this alias

pua='echo "mypassword" | sudo -S nano /etc/privoxy/user.action'

I see this:

[12:32 PM] ~ $ pua
Received SIGHUP or SIGTERMa: 
[12:32 PM] ~ $ 

Can someone please explain why this happens and if there's a way to fix the error-giving alias?

(I don't want to do anything involving sudoers.)

1 Answer 1

0

It's a problem with nano, not the alias. Try using vim.

3
  • Could you please provide a link for that?
    – user25656
    Nov 29, 2012 at 8:11
  • Why, did it work? :P
    – penner
    Nov 29, 2012 at 8:12
  • I can't find any resources but it seems the OS is killing the process off after you start it up or nano is running out of memory.
    – penner
    Nov 29, 2012 at 8:25

You must log in to answer this question.