I want to autorun a script when I insert my USB-drive and I have successfully done that, only one problem... I want it to run as root automatically, without a popup asking me for the password. How can I do this?
							
						
					Announcement
				
					Collapse
				
			
		
	
		
			
				No announcement yet.
				
			
				
	
Autorun script as root?
				
					Collapse
				
			
		
	This topic is closed.
				
				
				
				
				X
X
- 
	
	
	
		
	
	
		
		
		
		
		
		
		
	
	
 Re: Autorun script as root?
 
 the proper way to do this would probably be to add some
 directive in the /etc/sudoers (see "man sudoers") file
 to exempt that specific command from asking the password.
 
 another way is to have your script belong to root:root
 and set the "set user id" bit to the permission mask.
 this probably raises some security issues, but
 maybe someone has a better idea...Code:chown root:root <path_to_your_script> chmod 750 <path_to_your_script> chmod u+s <path_to_your_script> 
 this is what crops up to my mind at this time at night... 
 gnu/linux is not windoze
 - Top
- Bottom
 
- 
	
	
	
		
	
	
		
		
		
		
		
		
		
	
	
 Re: Autorun script as root?
 
 What the script does is mount two truecrypt encrypted drives. Right now the script is on my hard drive, but I would also like it to be on the USB-drive, so when I insert my USB-memory it acts like a key and the script on the USB-memory is executed after the USB-memory is mounted. Can I do this?
 - Top
- Bottom
 Comment
Users Viewing This Topic
				
					Collapse
				
			
		
	There are 0 users viewing this topic.




Comment