General :: Changing User And Running Commands Inside Of A Script?

Feb 22, 2011

My current script is as followed:

Code:

#!/bin/sh
su et
cd "media/ET"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.

[code]....

I want ET to be run as the user "et" and for some reason, I can't directly su/sudo to run the file without being in the user "et" and the "/media/ET" directory.

View 2 Replies


ADVERTISEMENT

Slackware :: Running Root Commands As User?

Nov 7, 2009

After a few hours work I have managed to set up pptd so that my daughter can log into her account at Imperial College. My problem now is that I need to have a script that she can run if she wants to log in. She will have to invoke a couple of root commands and I do not want to give her the root password What she needs to do to set up networking is:

Quote:

pppd call imperial dump debug logfd 2 nodetach require-mppe
/sbin/ip route add default dev ppp0

How can I enable things so that she can run this script as user?

View 12 Replies View Related

General :: Using The Expect And Send To Execute List Of Commands Inside A File?

Feb 2, 2011

i am working on some kind of PBX and i have list of telephone numbers inside a file, i have to insert these numbers into the correct command and then telnet to a remote server and execute these commands. i can read the telephone numbers and insert them into the command with no problem, but when i try to insert these commands into the send i face problem. here is the basic code

#!/bin/bash
read msisdn < input
string="ZZZZ:MSISDN=$msisdn;"

[code]....

i can make external loop inside the Bash which read the input file and issue the command and then telnet and execute, but this will make the script connects and disconnects again for each line which cause high load on that server and hardwar problem. i am wondering if there is an option inside the expect interperter which makes the send read directly from a file... somthing like this:

expect "<"
send "input-filename
"
expect "<"
expect eof

View 1 Replies View Related

General :: Commands For Changing Directories In Fedora

Jan 19, 2011

What are the commands for changing directories in fedora linux i wanted to install something so i put it in my desktop and documents folder but i couldn't install becuase i couldn't change directories.

View 4 Replies View Related

Programming :: Awk Commands Inside Of A Bash Script ?

May 4, 2011

im pretty sure this is a remedial task for many of you but im having an issue with arrays from a shell script being accessed in an awk command. im pretty good with shell scripting but i am embarrassingly unfamiliar with awk. so here's the meat of the script...


Code:

I am trying to take an input file of ip addresses and corresponding netmasks and put it into a format to be loaded onto a juniper switch. the result should look something like this.. x.x.x.x/netmask using the cidr notation. no matter what subnet is provided though, /32 always gets appended to the end of the ip even when it should be /16, /24, etc... also, the cisco part works fine so that doesnt need any attention.

View 5 Replies View Related

Server :: SQL Commands Inside Bash Script?

May 5, 2011

I'm trying create script to manage one mysql database, including new db and user creation. But I'm not able get it working when I put SQL commands into function. So I create simple script for testing which is still not working

Code:

#!/bin/bash -x
MAIN_DIR="/admin/mysql"
MYSQL_CNF="$MAIN_DIR/auth.cnf"
MYSQL_CMD="mysql --defaults-file=$MYSQL_CNF"

[code]....

View 1 Replies View Related

General :: Lost All Running Programs On A Server (inside *screen) When Client Restarted?

Apr 21, 2011

I sshed to a server a week ago, then ran *screen* and created a few windows in my screen session. I then ran a few programs on those screens. All the programs were running in the background (I run them with &). I did not close or detach from the screen sessions. So I was still connected to those screen sessions from my client machine.

Then, this morning I find my client machine rebooted. When I do screen -ls I find there are no screens available to reattach to. But that is not the worst part. The strange thing is that all my processes (which were running on the server) have disappeared as well, even though they were running in the background. I thought 1) using screen I will be able to re-attach to old screens when my client restarts, 2) If I have sshed to a server and have run programs in the background, restarting the client should not stop those programs (even if I had not used screen).

View 2 Replies View Related

General :: Running Ubuntu 10.04 Inside VMware Player - Windows Vista - Can't Connect To The Internet

Jun 10, 2010

I'm running Ubuntu 10.04 inside VMware Player running under Windows Vista and I can't connect to the internet or the host computer from the Ubuntu.

I have set all the VMware services to manual (like VMware DHCP Service), but starting them manually doesn't help.

In VMware, the network seems to work (there is a green dot beside the network icon) and I have tried both Bridged and NAT settings.

ifconfig doesn't show the eth1 interface, unless I give it as a parameter (or use -a). I think this means that Ubuntu thinks that the network isn't connected at all.

View 1 Replies View Related

General :: Prevent RC Commands From Running?

Mar 17, 2011

I am running a shell script from a rc file in Linux. The shell script is going into a loop which runs for 8 hours. Now I want to prevent the shell script from running when Linux boots or I need to find a way to kill the shell script when it is running. I tried using killall, kill $! and Ctrl+C etc. Nothing seems to work. Can you suggest a way out. I am new to Linux.

View 2 Replies View Related

General :: Running SQL Commands From Within Bash

Aug 1, 2010

I would be running SQL commands (UPDATE/SELECT) from within my bash script. I am completely new to this subject. Is MYSQL used for this purpose? Alternatively, what is sqlplus?

View 6 Replies View Related

General :: Terminal Commands Running Behind The GUI?

Jan 10, 2010

Recently I gained interest in running command from the terminal, like rhythmbox-client --play-pause and vlc --open, but I could not find the vlc's pause command under vlc. there's a way I can have a terminal display the commands that run when I do some action. For example, when I click on pause in vlc, the terminal should show me what command it used to pause vlc. What's the closest ting I can get to this?

View 1 Replies View Related

General :: Running Ssh Commands With Sudoers Login?

Dec 10, 2010

I added the following line in /etc/sudoers file

<username> ALL=(ALL) NOPASSWD:ALL

after adding this if I run any command it is not asking for the password. Now I need to shutdown the remote machine with sudoers user.

View 6 Replies View Related

General :: Does Running Commands Verbosely Make Them Slower

Jul 20, 2011

I've found myself using the -v flag for lots of applications less and less (especially for trivial stuff like tar and cp). However, when I did and I was, say, unzipping a large file, it would take longer than when I didn't use the -v flag.I assume this is because the terminal has to process the text and I'm filling up whatever buffer it might have. But my question is, does this make the application actually run slower or does it complete in the same amount of time and what I'm seeing is the terminal trying to catch up?

View 5 Replies View Related

General :: Commands To Display Running Processor Number Id?

Jan 24, 2011

I have 8 cores system, but I only want to use 4 cores of it. Are there any commands to show which cores are running tasks?

View 1 Replies View Related

General :: Running Multiple Commands Remotely Via SSH In A Script?

Dec 18, 2009

In a script I am writing I am trying to add logic so that the script can figure out if a remote server uses rpm or dpkg and then run the appropriate command to print a list of installed packages. This works locally, but I need to get it to work through SSH and I have no idea how to do that. The relevant portion of the script is below. It would also be nice to find a way to not need the full path to the executables but I'm not real concerned about that.So anyone know how to make this code work via SSH?

Code:
if [ -x /usr/bin/dpkg ]; then
dpkg --get-selections

[code]...

View 4 Replies View Related

General :: Separating User Commands Using Visudo?

Jul 20, 2011

Here is my scenario, I want to create about 3 groups of users:

--Admins-create and manage users
--Support1-Restart basic stack apps(httpd, mysql etc)
--Support2 Backups

So in my sudoers file i have managed to set them all up to perform the tasks above. However, I want to limit the users in the specific groups from running commands from other groups. eg a user in admins shouldnt be able to restart the stack applications etc. I have tried using the ! to create an exception eg !/etc/init.d/httpd start for the users but its not working.

View 6 Replies View Related

General :: New User - Run Commands PERMISSION DENIED

Apr 19, 2011

i've query regarding, user creation in Linux( RHEL 5), i.e, i've created a user ([root@localhost ~]#useradd slash ) and switched into that user, but am not able to run commands in it......It's displaying a message saying, PERMISSION DENIED. Do we need to provide any permissions while creating a user

View 7 Replies View Related

General :: How To Allow User To Execute All Commands Without Sudo

Apr 30, 2010

Customer asked me to create a menu for linux he also asked me to do this: Open like a command like where a user can execute commands...so for this the users have sudo enabled. The code below works OK. But it has an issue when a command is executed but the command does not need sudo

Like for instance
Code:
cd /
sudo: cd: command not found

How can I allow a user to execute all commands when a command does not need sudo
Code:
echo -e "Press Control+C to finish"
#echo -e " "
while true;
do
read whichcmd?"Insert Command: "
sudo $whichcmd
done

View 3 Replies View Related

General :: User Access To Commands Having Root Privileges?

Oct 14, 2009

How to allow access to some commands having root privleges to be run by non root user. I am new to unix/linux and I have a major assignment. I have to find ways to run particular commands which can be run only by root from a non root user. I know sudo is one of the way but i need some different approach.

View 8 Replies View Related

General :: Script Which Will Login To Particular User And Execute Some Commands?

Mar 19, 2011

I am trying to write one script. Purpose of my script is that it will login to particular user and it will execute some set of commands.What I was trying....


#!/bin/bash
su - tom
ls -lrt

[code]...

View 6 Replies View Related

General :: Setting Up User To Use Sudo For Specific Commands?

Jan 17, 2011

I did some digging on the sudo command and I do know the config file is /etc/sudoers Read the manual for sudoers and found out that I must use visudo to edit the file I read some of the examples at the bottom of the file and tried entering my own account in following the example. one of the commands I was trying to allow my account to perform without root login is the mount command So I tried adding this in (kreid8 /bin/mount ALL) I then saved & exited the file and logged out of root and tried sudo mount -t vfat /dev/sdc1 /media. I got an error saying I had to be root in order to do that But when I use the visudo -l option it shows that I have that privellege. Did I edit the file incorrectly?

View 6 Replies View Related

General :: Changing User To Root?

Sep 17, 2010

I tried to make my account root by editing etc/group:

root:x:0:oneat
daemon:x:1:
bin:x:2:
sys:x:3:
adm:x:4:oneat
...

But it didn't succeed.What can I do more?

View 4 Replies View Related

General :: Changing User For Apache / PHP?

Oct 25, 2010

I have to develop a php script, that acts as a man-in-the middle for a db-like-software and a webshop. This should run on a server within a DMZ, behind two firewalls, that should filter every request from other sources, than the eshop, and any other protocol than HTTPS. This server is a debian-machine, with a apache 2.2 and php 5.3. I've installed apache and php without any problems, installed openssl, generated a certificat and installed it. I tested the connection successfully. The eshop-server can connect to the server inside the DMZ without problems and receives a correct answer.

The db-like-software (called "netbasic") generates a csv-file in a fixed directory. this csv-fils has an owner called "netbasic". The file-access-rights are: -rwxr--r-- (I've some problems to interpret this. I know, r stands for read and w for write, x for both and the order is for different usergroups). My problem is now, that my php-script tries to read the file (successfull), generates output (successfull) and then deletes the file (failed -> permission denied). I figured out, that the problem is, that apache (or, I don't know, just php) don't runs as root and has therefore no write-permission. Because the server is already secured with the firewalls, we, my workmates and me, don't see a problem, to change the apache-user to root. but I don't know how this is done and don't know, what to search for.

View 7 Replies View Related

Server :: Make A Normal User Execute Commands Of The Super User's?

Jul 3, 2010

I have a question that i want to make a normal user to execute the commands which the root user is able to execute, say if i have a user named siru and when i logged in using siru i cannot run commands like tracert,nmap@loccalhost and all but i can run when i have logged into root account so my question is how to make siru to run the command tracert,nmap@localhost.I have even edited the .bash_profile of siru's home directory from

# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then

[code]...

View 1 Replies View Related

General :: Changing Primary Group On A User?

May 18, 2010

Does anyone know how to change the primary group on a user without changing the password? I've tried updating the /etc/passwd and running usermod -g group userBoth of those does change the group but somehow it messes up the password so the user cannot get in with the same password.

View 5 Replies View Related

General :: Changing Default User Start Directory?

Jul 4, 2009

I would like to change the start directory, the directory at which ftp/shell points to when the user logs in.

View 1 Replies View Related

Ubuntu :: Commands For Changing Desktop Settings?

Feb 28, 2011

Does anyone know where I could find the commands with which you use to change the desktop settings.

I want to write a script which changes my monitor settings on Kubuntu 10.10 and redraws the taskbar.

View 1 Replies View Related

Security :: Changing Home Directory Permission In User Management After User Created In Suse(KDE)?

Feb 2, 2011

created a user but i forgot to change the home directory permission.so after user created when i go to the user and group mangement i cant see that permission filed related to the home permission directory.my purpose is to stop accessing other user to my home directory,how it can be possible??

View 4 Replies View Related

Ubuntu Installation :: 10.04 Running Inside Windows As Proprietary OS

May 18, 2010

I have ubuntu 10.04 running inside windows and want to make it the proprietary OS. I have an acer aspire 5517, are there any problems associated with this laptop's hardware and ubuntu.

View 3 Replies View Related

Ubuntu :: What Is Process Name Of Flash Player Running Inside Firefox

Jan 9, 2010

Using Ubuntu 9.10 I open up Firefox and run a video from ......com web page. How can I monitor if flash player is running using terminal ps (process) command? What is the flash player process name?

View 8 Replies View Related







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