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?

View 11 Replies


ADVERTISEMENT

Programming :: Including User Defined Header File?

Apr 29, 2011

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

sample.c

Code:

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

[code]...

View 2 Replies View Related

General :: Automate Sudo Su - User Command From A Script?

Feb 9, 2011

i want to automate sudo su - user command from a script...it will then ask for a password...how do i automate this?

View 3 Replies View Related

Ubuntu :: Add User Permission To Use Sudo In Command Line?

Oct 20, 2010

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.

View 5 Replies View Related

Red Hat :: Setup User's PATH Env When Sudo Command In RHEL5 ?

Dec 16, 2008

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?

View 3 Replies View Related

Ubuntu :: Cannot Use 'sudo' Command Either With Root Or User Passwords

Apr 19, 2010

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.

View 9 Replies View Related

Ubuntu :: Give A User Sudo Privilege From Command Line?

Mar 14, 2011

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?

View 9 Replies View Related

Programming :: Send The Output Of A Command In A File Defined By A Eval $"$var1"?

Jul 7, 2010

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}"

[code]....

View 3 Replies View Related

Ubuntu Security :: Sudo User_Alias Referenced But Not Defined?

Sep 3, 2010

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?

View 1 Replies View Related

Programming :: Bash Scripting With Sudo / Password Prompt And Accepting User Input?

Jul 30, 2011

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.

View 14 Replies View Related

General :: Use The Command "sudo Su Root" From User Besides Ubuntu?

Mar 17, 2011

Why can't you use the command "sudo su root" from a user besides Ubuntu?

View 2 Replies View Related

General :: Sudo Cd /root Gives Sudo - Cd - Command Not Found

Jan 6, 2011

Kernel 2.6.21.5, Slackware 12.0

Code:

Code:

On the other hand

Code:

So, I do not understand why the notification "sudo: cd: command not found", considering cd is a bash built-in command.

View 3 Replies View Related

Ubuntu :: Script To Setup Ufw With Ssh On User Defined Port?

Apr 3, 2011

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.

[Code]....

View 2 Replies View Related

General :: User Defined Input In Shell Script

Dec 2, 2010

I want ssh a remote server through shell script with predefines username and passwd. i dont know how to use expect command to do that.

View 4 Replies View Related

Ubuntu :: No SUDO Access When Admin User Created Through Kubuntu User Manager?

Jan 6, 2010

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

View 4 Replies View Related

Server :: Sudo - Command Can't Run By Sudo

Jun 18, 2010

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.

View 8 Replies View Related

Fedora :: Defined Aliases In File Not Working - No Command Found

Apr 15, 2011

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

View 2 Replies View Related

Server :: Invalid Command 'ProxyHTMLEnable' Perhaps Misspelled Or Defined By Module Not Included

Jul 18, 2010

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

[Code]...

View 6 Replies View Related

Software :: Invalid Command 'CustomLog' - Misspelled Or Defined By Module Not Included

May 1, 2010

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.

View 2 Replies View Related

Programming :: Perl - Way To Encrypt Command-line Input When User Enter A Password ?

Nov 4, 2010

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 ?

View 2 Replies View Related

Programming :: Bash Shell Read User Argument From Command Line And Test It

Aug 29, 2010

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"

View 12 Replies View Related

Programming :: C With Gcc: Are All Variables Defined Like Pointers

Sep 13, 2010

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

Are all variables defined like pointers?

View 5 Replies View Related

Programming :: C++: Macro Not Defined In Quotes?

Dec 12, 2009

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 << "
";

[code]....

This seems lame, because then this doesn't work:

Code:

CL_Image leaves_corner_tl(gc, "DATADIR/PACKAGE_NAME/img/leaves_corner_tl.png");

So, am I literally going to have to strcat DATADIR/PACKAGE with the other text every time I want to prefix DATADIR/PACKAGE_NAME onto another string?

View 2 Replies View Related

Programming :: NameError: Global Name 'set' Is Not Defined

Apr 17, 2011

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

Script1
#!/bin/python
import Mytest

[code]....

The error message is :

NameError: global name 'set' is not defined

View 14 Replies View Related

Programming :: How To Test Whether A Macro Is Defined

Mar 20, 2011

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?

View 2 Replies View Related

Programming :: Python - Global Name Not Defined

Jun 17, 2011

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.

View 5 Replies View Related

Ubuntu Servers :: Invalid Command 'ProxyHTMLEnable', Perhaps Misspelled Or Defined By A Module Not Incl?

Jul 18, 2010

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

Code:
alias.conf authz_default.load autoindex.conf deflate.conf
dump_io.load mime.load proxy.conf proxy.load[code]...........

View 4 Replies View Related

Programming :: Use Environment Variables That Are Defined Outside Of The Script?

Feb 8, 2011

I am writing an expect script and I wish to use environment variables that are defined outside of the script.

View 6 Replies View Related

Programming :: Created A File With A Pre-defined Size ?

Feb 19, 2010

I have created a file with a pre-defined size as follows:

Code:
#define FILEPATH "testfile"
#define FILESIZE 16

[code]...

View 5 Replies View Related

Programming :: Write A Perl Script Which Will Give An Interactive Session To A User To Execute Command On The Server

Feb 25, 2011

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';

[Code]...

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved