Find the answer to your Linux question:
Results 1 to 3 of 3
Greetings I'm using Ubuntu 9.10 on a home network (without internet access) Occasionally I need to restart the print server. Code: xterm -e 'sudo /etc/init.d/samba restart' each time it asks ...
  1. #1
    Just Joined!
    Join Date
    Nov 2009
    Posts
    3

    Restart Print server with Xterm, but without a password



    Greetings

    I'm using Ubuntu 9.10 on a home network (without internet access)

    Occasionally I need to restart the print server.

    Code:
    xterm -e 'sudo /etc/init.d/samba restart'
    each time it asks for the password but because this is a closed network, I'd like to dispense with it asking for the user password each time.

    Any suggestions?

  2. #2
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,653
    You can edit the sudoer file to disable passwords for specific commands.
    Sudoers Manual

    Something like
    Code:
    aurbo localhost = NOPASSWD: /etc/init.d/samba restart
    Use visudo to edit. It uses vi as the default editor. You might want to change that to something like nano, which is a little more intuitive to use.
    Code:
    sudo EDITOR=nano visudo

  3. #3
    Just Joined!
    Join Date
    Nov 2009
    Posts
    3
    Thanks,

    I'll give it a try


    Steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •