Software :: Pass To Shell Environment As Regular User / Will It Apply To Builds Ran Under Sudo?
Jan 17, 2011
If I pass to my shell environment as a regular user will it apply to builds ran under sudo?I posted a thread similar to this regarding a build with TOR; however, this is applicable to all programs.
View 6 Replies
ADVERTISEMENT
Dec 19, 2010
I made a Desktop User account. When I went on that account, it allowed me to execute sudo as if I was an administrator. I don't know what might be causing this. I do have ufw set up and blocking incoming connections. Do you guys know what might be at the root of this?Also, when I used sudo from the user account (which I shouldn't have been able to do), I provided the password for my admin account.
View 9 Replies
View Related
Aug 15, 2009
I want to run /etc/acpi/actions/blank.sh as a regular user, but it will only run as root. I am trying to setup a keyboard shortcut to run the above script without success. I can run the file blank.sh as root, but not as regular user. Basically I went to: System > Preferences > Keyboard Shortcuts, and added a shortcut to blank the screen. I used the name: Blank Screen, the command: /etc/acpi/actions/blank.sh, and the shortcut: XF86Launch1. XF86Launch1 corresponds to the extra "Access IBM" key found on my keyboard. xev confirms that pressing the "Access IBM" key gives the keycode XF86Launch1. I can launch other programs such as firefox using this method. Here is the actual file blank.sh:
Code:
#!/bin/bash
RADEONTOOL='/usr/sbin/radeontool'
STATUS=`$RADEONTOOL light|awk '/The radeon backlight looks / {print $5}'`;
[code]....
The better method would be to get /etc/acpi/events/blank to accept a hotkey sequence, but this seems broken in Fedora 11. The file blank:
Code:
event=ibm/hotkey HKEY 00000080 00001001
action=/etc/acpi/actions/blank.sh
acpi_listen for keys Fn+F1 reports: ibm/hotkey HKEY 00000080 00001001, but the above file is not being executed.
View 1 Replies
View Related
Jan 28, 2010
I heard (although I can't find any sources for proof) that the USER environment variable may not be set in a old Unix shells (maybe even some obscure shells as well). What is the probability that it won't be set?
View 2 Replies
View Related
Jun 2, 2011
I have been give a task of replicating one of our production systems to create a test system. I have been restricted to use c shell to set up its environment variables. I am new to this my questions is how do i set environment variables for a particular user on c shell e.g ORACLE_HOME and ORACLE_SID permanently for a particualar user i know in bash you edit the .bash_profile file. What do i do for c shell?
View 2 Replies
View Related
Sep 7, 2010
I need sudo for www (apache) user to run a shell script('ip.sh' contains iptables rules) from cgi-bin directory via browser using a per script. I edit sudoers( www ALL=(ALL) NOPASSWD: ALL ),but when run the bellow command that's with err:
# sudo -u www sh /srv/www/cgi-bin/ip.sh
iptables v1.4.4: can't initialize iptables table `filter': Permission denied (you must be root) Perhaps iptables or your kernel needs to be upgraded. And:
# ls -al ip.sh
-rwxr-xr-x 1 root root 243 Sep 7 14:18 ip.sh
I edit sudoers so
'www ALL=(ALL) NOPASSWD: /srv/www/cgi-bin/ip.sh,/usr/sbin/iptables' too. but it doesn't work too. how can I execute this script via browser ?
View 14 Replies
View Related
Jul 27, 2011
I am setting up a cron job, where i am calling a shell script to make few builds. I got struck at a point, need some expert inputs to proceed further. The script is categorized in 5 parts and in the last part while building software it asks for few questions like:-
1. Build mode choice
2. normal build
3. Copy Images
4. Arch
User manually has to input ans for these questions:-
1
yes
n
64
The ans's are fixed and this won't change. How shall i hard-code them or do something in the script so as when script flow reaches to this point it automatically take's these value. So far the cron job is not getting completed as it's waiting for user to key in these values manually. I had faced similar issue while building kernel modules but there it was easier as i had to take default values always:-
View 2 Replies
View Related
Oct 26, 2010
As seen in this thread: viewtopic.php?f=20&t=50703xmessage is queuing a shutdown/reboot command, but if pressed, nothing happens. How do I get xmessage to send a textinput value to sudo?odify my execIsuma code to suit if you can, would make things much simpler.
View 8 Replies
View Related
Sep 28, 2010
What is the difference between creating a "regular" user and creating a "system" user on Linux?
For example:
Code:
adduser john
Code:
adduser --system john
Similarly it seems there are normal groups and system groups. Doing an internet search and reading man pages does not give much information on the whole concept of system and regular user/group.
View 1 Replies
View Related
Mar 10, 2011
I've set up a user account for friends & colleagues that does NOT require a login password. Unfortunately, in this OS some things don't work unless you login -- sudo Must regular users have AND use Root's password?
View 9 Replies
View Related
Jan 14, 2011
i am running slackware and i cant set my terminal to regular shell. when i open up a terminal i see something like bash4.1 instead of hostname and nickname how can i change this. i use more than one terminal so id liek to make this change for all terminals
View 5 Replies
View Related
Jun 16, 2011
Why does this work
Code:
for myfile in `find . -name "R*VER" -mtime +1`
do
[code]...
View 2 Replies
View Related
Aug 2, 2011
Code...
I am somewhat confident that there is a neater way.
Question: Does anybody know the answer?
View 3 Replies
View Related
Dec 23, 2010
I have the following code :
Code:
E_BADARGS=65
if [ $# -ne 2 ] ; then
[code]...
View 1 Replies
View Related
Oct 2, 2009
I have some messy code that I wrote a while back and I am trying to organize it. The program opens xpaint and uses xwit and xte to draw packman and so on. I want to split it all up I am going to add more to it. Basically like i would want drawing packman in one function i guess you could call it and then coloring him or the background in another
<code>
#!/bin/bash
pkill xpaint
res=`xwininfo -root | grep geom | sed -e 's/^.*try ([0-9][0-9]*x[0-9][0-9]*)+.*$/1/'`
Xoriginal=`echo $res | cut -d 'x' -f 1`
Yoriginal=`echo $res | cut -d 'x' -f 2`
X=`echo "($Xoriginal/2)-400" | bc `
Y=`echo "$Yoriginal/2" | bc `
#t=$(($Y/2))
bob=`echo "$Y/2" |bc `
echo $X
echo $Y
/usr/bin/xpaint -size "$Xoriginal"x"$Yoriginal" -popped &
sleep 4
paintersMom=`xwit -all -print | grep XP | cut -d ":" -f 1`
canvasWin=`xwit -all -print | grep Untitled | cut -d ":" -f 1`
#toolres=`xwininfo -id $paintersmom | grep geom | sed -e 's/^.*try ([0-9][0-9]*x[0-9][0-9]*)+.*$/1/'`
#canres=`xwininfo -id $canvasWin | grep geom | sed -e 's/^.*try ([0-9][0-9]*x[0-9][0-9]*)+.*$/1/'`
#echo $paintersMom
xwit -id $paintersMom -move 0 0
xwit -id $canvasWin -move 0 0
xwit -root -warp "$X" "$Y"
sleep 4
for((i=45; i < 315; i++))
do
xte 'mousedown 1'
ang=`./deg2rad $i`
movex=`echo "$X+$bob*c($ang)" | bc -l`
movey=`echo "$Y+$bob*s($ang)" | bc -l`
xwit -root -warp "$movex" "$movey"
done
xwit -root -warp "$X" "$Y"
xte 'mouseup 1'
#xwit -id $paintersMom -focus -raise
#sleep 1
#xwit -id $paintersMom -warp 30 390 #// fill in command on tool bar
#sleep 1
#xte 'mouseclick 1'
#sleep 1
#xwit -id $canvasWin -warp 221 40 #// color selection
#sleep 1
#xte 'mouseclick 1'
#sleep 1
#xwit -id $canvasWin -warp "$(($X-150))" "$Y" #//location on pac man
#sleep 1
#xte 'mouseclick 1'
#sleep 1
#xwit -id $canvasWin -warp 62 44 #// selecting color black
#sleep 1
#xte 'mouseclick 1'
#sleep 1
#xwit -root -warp 62 120 #// selecting back to canvas
#sleep 1
#xte 'mouseclick 1' #// color canvas black
#sleep 1
#xwit -id $paintersMom -focus -raise
#xwit -id $paintersMom -warp 27 108 #//click back to pencil
#sleep 1
#xte 'mouseclick 1'
#sleep 1
</code>
Here for example $paintersmom is would be in the drawing of pacman but I would also want to use it when I colored him in.. but I would want both processes in a different shell script.
View 15 Replies
View Related
Jul 16, 2011
I am calling a URL from shell script and passing few argumants,Here i have to pass file content as one argument.How can i pass file content through URL.
eg:
content=`cat /Users/test1.txt`
open http://localhost:8080?filecontent=$content
[code],...
View 1 Replies
View Related
Dec 7, 2010
I am new to bash scripting (not programming in general).
I am writing a bash script that will run a Python script I have written.
I want to be able to do the following:
Pass parameters to the bash script via the cronjob (so I can have two cron jobs) one to be run with parameter 'foobar', and the other 'foo'
switch based on the parameter passed to the bash script (by switching, I mean an if/else based on the paramter passed to the bash script).
View 3 Replies
View Related
Jan 25, 2011
I want to have a choice or more preferable pass shell as command line argument when I ssh to an linux account.i.e. If John logs in to account "zzz" on server "abc", by default definition of account "zzz" n server "abc" he get csh.But Sally desires that when she logs in to account "zzz" on server "abc", she needs the login shell to be ksh,and Rick wants bash when he logs in to account "zzz" on server "abc".What is the most non-intrusive / easiest way to achieve this? Each user can set their preference on ssh command line or create a simple alias by each shell, but not sure how to do this.
View 6 Replies
View Related
Jul 19, 2010
When I execute something with sudo, the environment that it executes in doesn't have all the environment variables from /etc/profile{,.d/} defined. I googled around and found that there is a way to get the environment variables from the calling environment to be carried over to sudo's own environment, but that's not exactly what I want. I just want sudo to read the /etc/profile and /etc/profile.d/ before executing commands.
View 2 Replies
View Related
Jan 19, 2010
I want to add my daughter as a user and give her full permissions to all the same folders and files that I use. I have given her permission to folders and their sub folders however she doesn't have rwx on the individual files within the folders. What is the command line to set this up?
Also with the command;
Code:
chown -R root:root files
what is the -R for and when do I need or not need it?
View 4 Replies
View Related
Feb 2, 2011
I have a Python script that I run which needs to execute under a special environment, so I would run the program like so from my working directory (~/project/src):
python manage.py shell
This opens up an interactive shell for me to start typing my own commands.I have another set of administrative activities that I would like to house in another directory (~/project/admin). The manage.py is really finicky about running from the working directory. So, to make this whole thing work, I made a script which starts off like so:
#!/usr/bin/python ../src/manage.py shell
There are a couple problems with this. The first is that it doesn't work:
/usr/bin/python: can't open file '"/../src/manage.py" shell': [Errno 2] No such file or directory
How do you specify multiple parameters to the interpreter?How do I change the working directory?
View 2 Replies
View Related
May 7, 2010
1. What file do i have to edit in order to include /usr/local/bin in the class path (ie. I put an executable in /usr/local/bin and when I try to execute it, it says the command cannot be found, etc.) EDIT: Solved, just didn't set PATH correctly. EDIT: New problem. When I try to execute a program in /usr/local/bin, it says "fopen: john.ini: File not found" Yet when i cd to /usr/local/bin, it doesn't say that. What would cause this?
2. Once I get my system setup the way i like it, how would i go about making it into a bootable CD/DVD?
3. How would I pass arguments from a shell script to a program?
View 4 Replies
View Related
Oct 6, 2010
I'm with Linux 2.6.32-25-server #44-Ubuntu SMP Fri Sep 17 21:13:39 UTC 2010 x86_64 GNU/Linux , Ubuntu 10.04 Server
And I wanna execute the next script in bash profile code...
View 1 Replies
View Related
Apr 22, 2009
How to use sudo to run a perl script with the environment variable JAVA_HOME on linux?
Running testenv.pl as sudo do not pickup the environment variable JAVA_HOME
value. code...
View 1 Replies
View Related
Jul 11, 2011
I have an Ubuntu server running Couch Potato, Sick Beard and Sabnzbdplus. Everything "works" pretty well in a sense that CP and SB push the NZB's to Sabnzbdplus, but Sab crashes regularly (haven't found the solution or the cause for this problem, so if you have some advice regarding that, it's welcome).To counter this problem (Sab crashing) I have a script written which checks if Sab is runnning and if it isn't start it:
Code:
bart@Pyro:~$ cat CheckSabRunning.sh
#!/bin/sh
[code]....
View 9 Replies
View Related
Mar 11, 2011
I have installed ubuntu-desktop and can log in fine. Whenever I start Synaptic, etc and am prompted for my password I am told it is incorrect. I reinstalled ubuntu server and tried the same thing with xubuntu-desktop and I experience the same thing.
View 1 Replies
View Related
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
Feb 11, 2010
I'd like to set up a shell script that will send various emails at regular intervals through gmail. I'm sure that there is some sort of text-based email client out there, but I'd like to do this with cron or anacron. I know a little bit of shell scripting but am definitely not great at it.
View 2 Replies
View Related
Jul 14, 2010
Note: I have made a thread similar to this before, but the title/contents were too botched to repair.I know that using C-r you can search for past bash commands containing a particular string, but how would you search for past bash commands matching a particular regular expressionIs there a keyboard shortcut for that or do you have to use a shell command?
View 4 Replies
View Related
Oct 7, 2009
I'm new to UNIX scripting; I�m stuck with the following I have an Oracle SQL script that takes three parameters
1- File Name
2- File Path
3- File creation date
Under UNIX I have a folder where files will be placed frequently and I need to upload those files to Oracle, what I need is a UNIX script that can do the following
Loop through Directory "/home/applmgr/snktmp"
Picks only files
Pass the file name to parameter &1
[code]....
Is the above possible? I already knows how to call the Oracle Script from UNIX Im only stuck on writing the UNIX part where it List the files attribute(name,path,date) and store them to parameters ,Looping until the last file in the directory If the above is not possible,then how can I create the below from the command line
Filename{concatenation Mark}filePath{concatenation Mark}creationdate
Filename{concatenation Mark}filePath{concatenation Mark}creationdate
Filename{concatenation Mark}filePath{concatenation Mark}creationdate
Filename{concatenation Mark}filePath{concatenation Mark}creationdate
View 4 Replies
View Related