Ubuntu :: Run A Script That Needs Root Privileges Without Typing In The Password?
Mar 25, 2011
I'm trying to run a script that needs root privileges without typing in the password. I want to copy a file from my documents folder into /etc/X11 to overwrite my xorg.conf. I do this because I will have my computer switch from my monitors to my TV when I watch a movie. But I'd like to be able to make it a clickable icon so I don't have to type in cp /... /etc/...
Then I read a lot of places that said to add this to the sudoers file (sudo visudo)
Code:
nertskull ALL = NOPASSWD: /home/nertskull/Documents/switch_TV.sh
I've done all that, and I still get asked for my password when I run that file.
nertskull ALL = ...
%nertskull ALL = ...
%users ALL = ...
%admin ALL = ...
I'm sure it's something simple I'm overlooking, but I've read 5 different threads on this, and I can't find anything they did that I'm not doing. Also, here is my sudoers file, because I know location within the file matters. But what I read said I should be putting my stuff at the end.
Code:
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
I'm really new to Linux so this will probably sound like a pretty naive question to most users, but how do you change the root password?To install Java, I have to type # su into Terminal,which then asks for the password.What's weird is that when I start typing a password, no characters show up. I don't know if this is supposed to happen or not.I've found a bunch of different sites on the Internet that explain how to change the root password, but none of them seem to work for my specific work station.
I've got Ubuntu 9.10 64 bit. In the GRUB boot menu, I can choose to boot normal or in recovery mode (I'm led to believe older versions don't have this option).I've tried typing # sudo passwrd into Terminal, but I already have a root password set up apparently, so I can't change it there.
I've been using Ubuntu for like a year now. Whenever I want root privileges I just type sudo and enter my User password. I wanna know if there's a way to change this, in a way that My User password is: "ABC" and the password needed to have root privileges is: "ABC123". I have no problem using the terminal, I actually prefer it to any GUI, it just seems easier to me.
i am having problems with privileges i have created a new user with my name, but i cant get root privileges on it. i need the same privileges as the root profile.
I run ProFTPd with TLS authentication on my Debian Lenny server. My problem is that despite of the fact that my users connect chrooted, one of my friends had root privileges after logging in form a Macintosh and could browse the root directory, too.
I accedently typed in a command in the terminal that made my computer load up without typing in user name or password. i would love you have that back. is there a command that you can use to get back there login screen. i am using ubuntu 9.10. i also dont know what the command was that i typed...
my laptop is shutting down after i type in the password to start the upgrade.
logs:
syslog
WARNING: Could not launch application 'gnome-user-share.desktop': Unable to start application: Failed to execute child process "/usr/lib/gnome-user-share/gnome-user-share" (No such file or directory)
auth.log
administrator : no tty present and no askpass program specified ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/sbin/shutdown -h now
After connecting to any host, the openssh client hangs after I type the password. The strange part is, it only hangs if when I use the wlan card. If I connect my phone to the computer and uses it to connect to my server, it works 100%.
If I use any other computer at the wireless network, it works 100% If I use putty on the same machine, it works 100%
It is only a problem when I use the build-in wireless card, under openSuSE 11.3, on my Lenovo L512. (note that everything besides ssh works completely).
We formatted a USB stick to EXT3 for use on a linux formatted device.Now, when we try and transfer files from this ubuntu laptop onto the USB stick, it says permission denied.
All of as now the add-to-panel item that via it you can shutdown the PC without the need of typing any password to gain root privileges.
How is this possible? I know that fro default the login screen is run by root but how do this app sends the signal to the login-screen to shutdown? I mean, this app is run without root privileges by me, the simple user, and when clicked the PC shutdowns via a signal from this app to the login screen.... How can I call this signal to an app of mine?
We have Ubuntu 8.0.4. We'd like to give this one user the ability to reboot the server but no other root privileges. I'm assuming this can be done using sudo. What file and what change do I need to make to it?
So let's say I entered some dir in MC as a regular user and there is a file with very long name which is not convenient to spell and I want to edit it with nano as root. In this directory I type in a command "sudo nano [name]" and autocompletion doesn't work because the TAB key is for another purpose in MC. Can I insert a name of selected file without typing it in MC?
I just installed this floppy drive in my computer and I can view files on floppy disks but I can not add files to a disk, formating will not work. All the privileges and ownership are set as root and I can not change them. (But I physically own it) Here is what the privileges are set for:
changing the su password so i can install things. I was told to replace it with sudo because it is locked. I did this but i didnt work, it said my permissions are denied. How do i get root privileges in the terminal?
Ive done something, Im not sure what...... I was trying to backup my mysql DB so I can reformat that server and install different server OS, then reinstall mysql and restore the DB... Well, somewhere in this mess I did something and now I get DBI connect failed : Access denied for user ''@'localhost' to database 'mysql'CONSTANTLY! I cant see any of my SQL DB's anymore... I just need to get the privileges back that Im missing, back up these DB's and get on with this already!
Half the time I click on a text box to write and star typing only to find out I'm typing somewhere other than where I clicked.It's not dwell click and the active text box seems to be related to mouseover.
i need to connect to a remote linux server on certain times (automated), but i need to log on to the server. So i want to make a script (shell perhaps) that periodically connects to the server and checks some files and folders.How do i automate it and how can i log on automatically to the remote server without typing everytime the password and login (the script should do it himself)
I've just got a TP-Link wn-851n PCI WLAN card, and the problem is that ubuntu can search for the network, but I can't join into the network after typing the password. I'm sure that it is correct as m Windows notebook is also using that network.
Taking a look in dmesg, and it start to loop this message after I joined the network.
Tell me how I can I login as root?I want to get root privileges in www directory because I have a web server and I want to put there my site and I can not do that
I am basically on a Fedora 8 but I have some of my files on telnet machine, to which I can log on. There I don't have root privileges though. How can I transfer files from that machine to my machine, using ftp or some other mechanism?
Is there a way to grant 'root' privileges to my user account? My account name ... I'll call it 'masterskop' as it is my forum name here, but not on my computer.Would it look like this in the sudoers' file?My purpose is to get access to all the folders and files in the 'File System'. The root and lost+found folders have 'Xs' on them...No access! And for example, under properties of the 'var' folder it states that 'you are not the owner, so you cannot change these permissions.' How can I get access to all of it everytime I login as the main user of my computer? I do not have anyone else using this computer.I did edit this file and used my real user name ... logged out and logged back in and still I do not have access/edit these folders and files.
I have the script below that I want to run when my sister logs into her account. But the problem is that `ifconfig up` or `ifconfig down` requires root privileges. How do I initiate the program when she logs in and have root the the runner of the program.
Code:
#!/bin/bash while true do elevenpm=`date +%s --date "2300"`
not sure if this is a silly issue or what. I recently upgraded to 10.10. When I insert my usb device, it automounts as /media/usb0, with root privileges. I have to manually unmount it, and afterwards if I select the "mount (drivename)" usb stick from Places it will automount as /media/(devicename) with proper