Programming :: Run A User-defined Command Without Sudo ?
Jan 24, 2011
I wrote a shell script and was able to compile it using SHC. after that i copied it to the /bin folder and tried running it as a normal user, but i keep getting the error " operation not permitted killed "
I tried changing the permissions. but it doesn't work. it only works with sudo. there must be another way. otherwise it won't be linux right?
i got a sample.c which generate a linked list for sorting according to the number generated. then i want to split the sorting function into a header file. and it looks like the sort function in the header file could not access the linked list in the main. the error is dereferencing pointer to incomplete type
I have a problem about user permission, I just destroy my user...So, I create a new one. But I can't have the permission to use "sudo" or to install program... So, I cannot do a lot of thing in my computer. The logical solution is to boot in failsafe mode and access to the root terminal, but, I don't know how to change the permission to allow me to use sudo.
In RHEL5, the PATH of root is /sbin and /usr/sbin...., the PATH of common user has not /sbin or /usr/sbin, how to give the /sbin and /usr/sbin to a common user when he run command which sudo?
I was wondering if someone had a logical reason and therefore complete, hopefully that makes total sense, for why when I install Ubuntu I cannot use the 'sudo' command either with root or user passwords. Even if I try to edit the permissions for sudoers, I still recieve an error message that says access is denied and so as the root user on my pc I don't understand why I can't put my name in the sudoers file or use the sudo command with the correct password.
I adjusted some settings in the desktop settings folder in KDE. I had only one user account on the machine. Next time I rebooted I could not log into KDE (it kept bombing out). I had to log into the console. Finally I managed to create a new account with useradd but this user cannot sudo
My problem is that my home directory is encrypted, so I need a new user with sudo privileges to delete all the kde files and folders in my original users home directory so that I can start with a new KDE setup (which won�t be a bad thing since I tinkered a lot).
How can I add sudo privileges to the new account (I presume I can do it by logging in with my sudo account in a terminal login?
Here is the block of code : (The red part is the code that doesn't work) The file is not created and see the output after the code. # i loop create environment structure and k loop create std procedure sub structure.
for i in TRAX2 TRAX BENCH PROD do eval mkdir $"acsayul02501_${i}" eval chmod 2770 $"acsayul02501_${i}"
I'm trying to configure my SUDO entries, for this I've added the next lines:User_List ADM = usernameADM ALL=(ALL) NOPASSWD: ALLWhen I close and save the file sends me the following warning>>> /etc/sudoers: syntax error near line 12 <<<visudo: Warning: User_Alias `ADM' referenced but not definedhat now?
I'm creating a bash script to do some tasks for me. I would like the script to be run at a set time of everyday. My first question is if it is possible that if one of the commands in the script requires sudo, is there a way to get around it with out making sudo not require a password. Such as, is there a way to include the password in the script? If that is the case, I can always just set the file as read only by sudo. I've been looking for a way to do this, with no success. if I have a command that wants input, how do I give it to the program. For example, if I want to make a zip file that is encrypted, the command would go as:
Code:
zip -r example * -e
now how would I get the script to insert my wanted password.
Im writing up a script to set up ufw with ssh on a user defined port. I have 2 minor issues, 1, this script can only run once, from the defualt configuration files. if the config files are previously modified, this script will fail. So how can i fix it so that the line specifying port in the ssh_config file can be read and rewriten to numerous times.
I have alot of echo type commands. how can I neaten that up?
Code: #If these aren't installed, install them now with: #sudo apt-get install openssh-server denyhosts ufw #This script is to help you set up decent security #on your Linux computers. Run this script as root.
Original HOWTO can be found at: [URL]... So the other day I was in IRC and someone had brought up a problem where they created a new Administrative user, but didnt have rights to use sudo. Looked into the problem a little bit to figure out what was wrong, and it turns out that when you create a new user through the user manager (in kubuntu, anyways. Havent tested in Gnome.) the user gets added to the adm group, however, a quick look at the sudoers file shows that its looking for users in the admin group to allow the use of sudo. So, to solve the problem we do the following: If youre on the new admin user (which Im assuming you are) use the following commands:
Code: su [insert username of old account without brackets] sudo usermod -G admin [username of new admin account without brackets] exit
Then simply logout, and then log back in (not always necessary, but the easiest way to flush the permissions.)
Code: su [insert username of old account without brackets] Means were going to Switch User to the old admin account Code: sudo usermod -G admin [username of new admin account without brackets] This simply adds the admin group to the secondary group list for the new user Code: exit Pretty self explanatory
I am having trouble running commands by using sudo. I configured visudo file with localuser ALL=(ALL) ALL but I can't run any command, it tells me command not found.
Defining tcsh aliases through a .aliases file has worked perfectly for me for years and years using cygwin and older versions of mandriva. I am encountering very annoying and mysterious problems when attempting to do the same thing with a .aliases file in a fedora 64-bit VM. Strangely, if I define aliases in the file, they won't work, but if I do so on the command line, then they will.
Here's a simple example: Suppose I define an alias for "ls" in the file: alias ls '/bin/ls' Then source the file. This happens: me: ls : Command not found. me: alias ls /bin/ls me: /bin/ls file1 file2 file3 etc. me: unalias ls me: ls file1 file2 file3 etc. me: alias ls '/bin/ls' me: ls file1 file2 file3 etc.
A second example: if I place either of these lines in my .aliases file: alias d '/bin/ls -alF !:1' alias d '/bin/ls -alF !*'and source the alias file, this happens:/ me: d Bad ! arg selector. However, if I define the alias on the command line: / me: alias d '/bin/ls -alF !*'then the alias behaves correctly:/ me: dtotal 376 drwxr-xr-x. 10 r r 4096 Apr 14 16:05 ./ drwxrwxr-x. 6 r r 4096 Feb 21 16:15 ../ drwxr-xr-x. 3 r r 4096 Apr 14 16:05 bin.v2/ -rwxr-xr-x. 1 r r 193872 Apr 14 15:35 bjam* -rw-r--r--. 1 r r 52804 Apr 14 17:20 bjam.my.log drwxr-xr-x. 77 r r 4096 Nov 17 09:49 boost/ -rw-r--r--. 1 r r 989 Nov 17 04:51 boost.css
I am getting following error "Invalid command 'ProxyHTMLEnable', perhaps misspelled or defined by a module not included in the server configuration" Saw this thread in /etc/apache2/mods-enabled/ I see
I am getting this error when trying to start apache. This is on a server that was functioning but now, when I tried to restart the server, this error shows up when trying to start the httpd service. The command that is causing the error is: CustomLoglogs/rosewood.access combined However, my guess is that it has something to do with either a module not being loaded or something wrong with the setup. But, as I said, this server was running so I am really not sure what changed. Server is Apache 2.0.52.
I need user to input a password through command line in Windows cmd prompt. Is there a way to encrypt the input (such as put it into ......) when user is typing ?
Trying to create a small script that will read user's input, test if user entered some input and if not display some message or display a text using user's input.
The script is the following but i get an error saying "[: 6: =: argument expected"
i'm practicing in very basic c programs using the gcc compiler.I found that when i create two variables let's say
Code:
int a,b and Code: a=15; b=3; a=b; b--;
then a equals 2.I thought that this isn't normal in C isn't it?I haven't had the time to read the gcc documentation yet...so i think it has something to do with my compiler's default settings.I use the
Code: gcc filename.c -o filename command to compile
I converted my programming project over to autotools, which gives me a config.h file with all the cool definitions, like these ones:
Code:
/* Location of data files. */ #define DATADIR "/usr/local/share" /* Define to the full name of this package. */ #define PACKAGE_NAME "lusus"
And naturally I think this is cool because then I can hardcore these into the binary. To my dismay, however, I discovered that the pre-processor does not do the text-substitution if the macro name is inside another quoted string.
Code:
// Prints out "/usr/local/share/lusus" std::cout << DATADIR << "/" << PACKAGE_NAME << " ";
I have a Red Hat 4.9 server running python 2.3.4. However I need some of the new functions so I downloaded and installed Python 2.7.1. I wanted to use the "set" function which was not in the earlier version.
/bin/python is 2.3.4 /usr/local/bin/python is 2.7.1
I have a script running 2.3.4 which calls the 2.7.1 script however it fails because it cannot find the "set" command here is an example
I've been reviewing some source code recently which contains many conditional compilation statements, and I found it hard to understand the code not knowing whether some macro is defined or not. Is there any way to test whether a macro is defined?
I found an interesting screencast online about how to make gtk Pyton apps. The thing is, though, the guy was using the interactive shell. I've been trying to get his code into a script, and have been having troubles.
Here's what I got:
Code:
It spits out the error "NameError: global name 'browser' is not defined"
I know I'm doing something wrong with how I'm telling it where to find "browser" and "text", but I can't figure out how to point it to the right place.
I am trying to write a perl script which will give an interactive session to a user to execute command on the server. I have written a small script to do this :
Code: !/usr/bin/perl -w use strict; use Net::SSH::Perl; my $host = '192.168.1.1'; my $username = 'user'; my $login_passwd = 'test123';