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


ADVERTISEMENT

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

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

Server :: AD User Login To Nagios - Unable To Execute CGI Scripts In Apache

Apr 25, 2011

I have a nagios server monitoring around a 1000 hosts in our office. To make things easier, i've integrated apache into Active Directory for the website authentication. This works perfectly, however the Nagios website uses alot of CGI scripts to display information I get the message below when trying to show CGI scripts with an AD user. Local users work fine. 403 Forbidden You don't have permission to access /nagios/cgi-bin/status.cgi on this server. I tried adding the AD users to the cgi.conf file within Nagios (which works for local accounts) but it doesn't seem to work even with this change.

View 4 Replies View Related

General :: Execute Different Commands With Same Name?

May 14, 2010

I have a two seperate files on my computer,

which execfile
/usr/local/bin/
/usr/bin/

so, i have two files with the same name in two different directories. How can I specify exactly which command to run?

View 6 Replies View Related

CentOS 5 Server :: Login As Postgres User And Enter Commands?

Sep 10, 2010

I've had a server setup working perfectly for the last 2 years. Today we installed a newer version of postgresql and recompiled apache/php.

Postgresql will not start now.

"service postgresql start" = /var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first. To initdb we need to be as user postgres.

"su - postgres" = "no file or directory"

In /etc/passwd = postgres:x:26:26:PostgreSQL Server:/var/lib/pgsql:/bin/bash

how i can login as postgres user and enter these commands?

View 2 Replies View Related

General :: Execute Example.sh Files Like Other Commands?

Jun 23, 2010

I just want to know that how can I execute a example.sh (script) from command-line like other Unix commands. Please write full procedure

View 4 Replies View Related

General :: How To Execute Multiple Commands When Using Find

Jan 22, 2011

I'm trying to run multiple commands on things I have found, how can I achieve this? find . -exec cmd1; cmd2 does not seem to work; it instead runs cmd2 after cmd1 has been executed on every file.

View 2 Replies View Related

General :: Execute Commands Over SSH In A Batch File?

Feb 17, 2011

I'm looking to, all in the course of one batch file:

ssh into a remote computer execute commands (per the batch file) on the remote host.

What options do I need to add to the ssh invocation so that the batch file executes the lines following the ssh invocation over the connection?

e.g., with sftp it's simply adding a -b /dev/stdin and then << EOF at the end; how do I do this with SSH?

View 1 Replies View Related

General :: Easier Way To Execute Long Commands?

Jul 29, 2010

I use a long mount command to mount a NAS drive but have to retype it every time I need to mount the drive. Because it is on my laptop I only need to mount the drive from time

View 4 Replies View Related

General :: Execute Commands After Logging In Into The Ssh Connection Not Locally?

Oct 20, 2010

I am creating this script which will login to a server with ssh and check if a particular exists there, if not it will create the user.This is the script:Quote:

ssh 192.168.100.5
cat /etc/passwd|grep -i $1 > /dev/null
if [ $? -eq 0 ];

[code]...

View 9 Replies View Related

General :: Execute Series Of Grep Commands In Script?

May 10, 2011

Executing series of grep commands to get counts in a large file. I'm appending to this file. Series of commands will be;

"greg -ir "May/0504" SentEmails.txt | wc -l >> Stats.txt
"greg -ir "May/0505" SentEmails.txt | wc -l >> Stats.txt
"greg -ir "May/0506" SentEmails.txt | wc -l >> Stats.txt
"greg -ir "May/0507" SentEmails.txt | wc -l >> Stats.txt

View 3 Replies View Related

General :: Type And Execute Commands In Window From Computer

May 19, 2010

ssh to a machine on my network open up a terminal (gnome, xterm, whatever) and have it visible on that machines display be able to type and execute commands in that window, from my computer. i have kind of achieved this. on machine A, i ssh to machine B. on machine B, i open up a terminal and execute screen, C-a :multiuser on. on machine A, i execute screen -x and connect to the term on B. everything i type from A or B can be seen. i just want to be able to set this up without having to physically be at machine B. does that make sense?

View 7 Replies View Related

General :: Write A Shell Script That Allows Only User 1 And User 2 To Execute A Program?

Feb 25, 2010

I've looked everywhere but I can't find where to change the default box for incoming mail, or am I on the wrong track. It's a nuisance having to change folders and I can't configure wastebin to empty on exit.And I can't get kmail to import from evolution. Do I have to go to the evolution storage and do it manually, and if so, how do I do that?

View 1 Replies View Related

General :: Get Gnome Terminal Execute Different Commands From Diff. Tabs?

Jan 6, 2010

In gnome terminal it is possible to open multiple tabs with Quote:$ gnome-terminal --tab-with-profile=jake_lardasset --tab-with-profile=virtualsexgranny -x alpineWe got even further....Quote:gnome-terminal --tab-with-profile=james_treesexer --command pymol --tab-with-profile=loverboy13 --command alpineand pymol runs, but not in the tab and alpine runs in the tab.The problem is, that when using a script to check mail it has Quote:gnome-terminal --tab-with-profile=chrissypink --command alpine --tab-with-profile=jake_hugerichard -x ssh xxxx@xxxx.ut.eenot the other way aroundIs there a simpler way to do this?And why is it not possible to execute ssh with the --command parameter and -x has to be used ,but top and so on can be executed with --command

View 2 Replies View Related

General :: Ubuntu - Cannot Execute Basic Commands (ps, Ls, Ifconfig) - File Not Found

May 4, 2011

When I try execute a variety of basic commands (including ps, ls, ifconfig, locate), I receive the error 'no such file or directory'.

Here are some suggestions that I've found online, that I have tried without success: I did a 'whereis ps' and found the file in the /bin/, and have checked that '/bin' appears when I do 'echo $PATH' I did a filesystem check which showed my hard drive as being clean I tried doing a 'sudo chmod 777 ps' but was told that I dont have permission. I don't think permissions for these files would have changed though (and I can't check as I can't run the 'ls' command).

View 3 Replies View Related

General :: Execute My Scripts (example.sh) Files Like Other Normal Commands From Command-line?

Jun 23, 2010

I just want to know that how can I execute my scripts (example.sh) files like other normal commands from command-line. Please describe the full method

View 5 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 :: Can't Execute Commands As Sudo Nor Access Sudoers File In Mandriva 2010.1

Aug 16, 2010

since a recent upgrade to Mandriva 2010.1 I am not able to 'sudo' as administrator or when I use the 'root' password. I am the only user on this machine (Dell Inspiron 530S multi-booted with Window's Vista Home Premium, Ubuntu 10.4, and Mandriva 2010.1). I can get into the 'Manage Users' section of the control center by authenticating as 'root' but I can't access 'sudoers file' from command line.

View 4 Replies View Related

General :: Allow User To Execute Faillog

Aug 11, 2010

I want to allow a user to reset people's faillog. When I go into the /etc/sudoers file and put this syntax in I still get an error stating : /var/log/faillog permission denied.

Here is what I put syntax:

%user ALL=/usr/bin/faillog,/var/log/faillog

View 1 Replies View Related

General :: Using 'say' To Login SSH And Execute Command

Mar 25, 2010

My problem is:

sub init() {
$Test->description("Establishing the connection to the client");
eval {
$Host = host($CLIENT) or die($@);
$Conn = connect("#ssh") or die "Client connection Failed" . $@;
};
if ($@) {
$Log->error("Unable to instantiate the Objects for the Test" .
[Code]...

Here I'm trying to connect windows machine using connect object which is working fine. But when I tried to execute the command on Windows machine from Linux machine by using:

[Code]...

View 1 Replies View Related

General :: Execute Firefox As It's Own User ( SUID )?

Jun 8, 2010

i was wondering if it is possible to run a program such as firefox or any other internet program as its own user (ie user firefox), but still in my desktop session, this way the program would have its own home folder and store all the data there, while i use it normally, i was trying to set the suid on the firefox binaries but then it doesn't starts at all.

View 6 Replies View Related

General :: Execute A Command On X-session Owned By Another User?

Jul 13, 2011

Is possible (by root of course) to run a command from console, that will be executed on X-session owned by another user on the same linux box/machine ? Example: Can root open xclock for another local user logged into X11 ?

View 2 Replies View Related

Fedora :: How To Execute Commands On Startup

Aug 11, 2011

how to execute commands on startup. I've added lines to /etc/rc.d/rc.local, /etc/rc.local, I've put scripts (with extension .sh) into /etc/init.d/ and I've set the executable permission thing on all of them with chmod -x. I *still* can't get anything at all to execute on startup. The truth is, I'm trying to enable multitouch and button tapping automatically when I startup Fedora. I have the commands

[code]...

Which I want to execute whenever I start Fedora (it's a bit tedious to write them every time, or even to have to execute a script myself whenever I start my computer). Furthermore, if I can figure this out, then I can do all sorts of things. Does anyone have a clear, surefire way in which I can do this? I'm not good with using Linux at all

View 7 Replies View Related

Ubuntu :: Execute Other Commands In A Row In That Same Newshell

Nov 13, 2010

I have a script --> WEP.sh and i want to open severel new processes in a second shell.

gnome-terminal -e "airmon-ng check" #this is working... but is there any possibility to execute other commands in a row in that same newshell for example airmon-ng stop wlan1 or sleep 10 or echo....?

View 2 Replies View Related

Programming :: Execute Commands After Run Command?

Jan 13, 2011

I am executing a run command in a script after that i need to copy files into a directory which are the inputs for the run,on run a new shell is created and the remaining commands in the script does not execute,wot should i do to execute the remaining commands in the script??

View 2 Replies View Related

Programming :: Execute SQLite Db Commands From C++?

Jun 10, 2010

Anyone know how to execute SQLite db commands from C++?

View 1 Replies View Related

CentOS 5 Server :: Can't Execute Some Commands?

May 22, 2009

I am trying to determine if I should upgrade PHP's PEAR on my server. I am trying to check the version of PEAR currently installed. I am getting the following error when I use the pear -V command:Warning: realpath(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s)(/usr/share/pear:/usr/share/php) in System.php on line 459I tried adding /tmp to my php.ini file, but then when I use the pear -V command it doesn't do anything. I do not get any errors or anything.I am also trying to install symfony and have the same situation described above when I use the following command: pear cannel-discover pear.symfony-project.comDoes anyone have any thoughts? If not the solution, does anyone have any suggestions on how to begin troubleshooting this?

View 2 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







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