General :: Running My Shell Scripts As Root ?
Aug 18, 2010
I have been playing around with shell scripting, nothing too complex just learning the basics. if i try to run a script as root (by entering "sudo" then the "command") it says command not found. i can only do it ass root if i specify the full path (/home/username/bin/command) im pretty sure the directory that my scripts are in are part of the superusers path.
View 14 Replies
ADVERTISEMENT
Aug 4, 2010
I am running Linux Mint 9..I play xbox live and run it through my laptops wireless network connection so i dont have to pay 100 dollars for the usb wireless adapter for the xbox. In windows 7 this is easy to configure so that when i turn my laptop on and then xbox it automatically connects.
View 10 Replies
View Related
Jan 25, 2011
I login as normal user. I can 'su root' fine - password authenticates. However, If I try to run System->Administration->Users/Groups, when it asks for root password, it is rejected. When I run updater, it reports failure to authenticate, but doesn't even ask for root password beforehand. Is there a cached password someplace?
View 7 Replies
View Related
Jul 20, 2010
How to login as root in linux shell?
View 3 Replies
View Related
Jun 18, 2011
I am trying to access an aspx page which, when accessed with certain parameters in the URL, downloads a file. I need to do this with a shell script, rather than interactively. I tried using wget, but I get a response of 302 from the server, which redirects me to the default page and then downloads the default page html itself. I quickly tried curl which seemed to be doing the same thing. It works perfectly from browsers on either Linux or Windows. Originally, I had a problem with interpretation of ampersands in the URL, but I put quotation marks around the URL, so that isn't the problem now.
I cannot fix this on the server side, because the aspx page will be accessed on a variety of servers which are probably all set differently and which aren't under our control.
View 5 Replies
View Related
Sep 24, 2009
I've been having a bit of trouble running a shell script with cron. A friend of mine does a community radio show and the station has a live stream but no podcasts, so I've set up a script to record the stream and encode it as an mp3 while I'm away using mplayer and lame -that's what I'm trying to do anyway.
Here's the script, but it doesn't seem to run- at least, I don't see any of the files it should be outputing, would they be in the cron.weekly directory (where I have the script) or in my home directory?
#This is a script to record 'The Unnamed Show'
#it will record the show from the live stream, then convert the output #to an MP3
#Finally, it will delete any files no longer required HOME=/home/byron/
View 2 Replies
View Related
Mar 11, 2011
I know that shell scripts can be used to execute more than one linux command at the same time. But can the same be performed in an e-mail (i.e) whenever i open that specifice-mail, the linux command should execute.
View 6 Replies
View Related
Jul 15, 2011
Today I faced a very strange issue while switching to root account in a bash shell.My OS : CentOS-5.1.4
I logged in my system with account name user1 and I open the terminal and below shell opens
[user1@localhost ]$
Now when I type su and want to switch to root account , it fails
[user1@localhost ~]$ su
Password:
su: incorrect password
[user1@localhost ~]$ exit
I know the password is 123 & I m 100% sure .
View 8 Replies
View Related
May 20, 2010
how to write a shell script the searches for processes running on my system. I really don't know where to start. can anyone give me a hand and explain how the script works?
View 3 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 28, 2010
I have a bit of a dilemma.
I'm using XFCE and it doesn't by default lock the screen before hibernating. I see this as a bit of a security risk, and as I can't hibernate while the screen is locked, I'm a bit lost as to how to achieve this.
I've begun editing /etc/acpi/hibernate.sh, here's what I have so far code...
If I run with sudo, the system hibernates, but gnome-screensaver will not fire. I can verify this by trying "sudo gnome-screensaver-command --lock". The screen goes black, but is not locked. The screen locks properly without sudo.
So the only solution I can see is to edit /etc/acpi/hibernate.sh in such a way that gnome-screensaver-command runs under the current user, and pm-hibernate is called as root.
Also, when I click the HIBERNATE button in XFCE, how does it call pm-hibernate under root without prompting me for a password? I normally wouldn't be interested in such things, but as it seems relevant to my problem I'm a little more eager to learn
View 3 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
Feb 5, 2011
how to list the currently running processes via code a shell script. FYI i now about the top method in the terminal but i need a way to have it via a shell script.
View 4 Replies
View Related
Nov 11, 2010
I have a script that executed 100000 C Programs, reads the commands from a file and executes them. There is a requirement to measuer the time that each of this 100K C programs running.If it exceeds 120 sec I want to Kill that Process.Any Idea to embed this in my shell script?
View 4 Replies
View Related
Apr 27, 2009
from nmap localhost | grep mysql command i will come to know whether mysql server is running or not.my problem is i want to test whether mysql server is running or not in shell script and if it is running i need to tell the user to stop the server to run the shell script.
View 3 Replies
View Related
May 31, 2011
Possible Duplicate: Leave bash script running on remote terminal while not logged in? I run a program, say ./a.out 10 from the shell prompt. Assume that there's a while(1) inside the program being run. Now if I try to close the shell, it warns me that it'll kill my running program too! So, how to kill the shell and still let my program continue running in the background?
I tried exec ./a.out 10 but the shell is still there. Another alternative is to simply double click my executable but then how will I pass command line parameters?
View 2 Replies
View Related
Aug 16, 2010
KDE panels look strange with black colors when I login using root account.Is it possible to make KDE look normal? I am using root account because I spend most of the time performing administration tasks and I don't want to type my strong password so frequently.
View 1 Replies
View Related
Aug 10, 2011
Is there a non-root shell command that can tell me if a user's account is disabled or not? note that there is a fine distinction between LOCKING and DISABLED:
LOCKING is where you prepend ! or * or !! to the password field of the /etc/passwd file. On Linux systems that shadow the passwords, this marker flag may be placed in /etc/shadow instead of /etc/passwd. Password locking can be done (at a shell prompt) via password -l username (as root) to lock the account of username, and the use of the option -u will unlock it.
DISABLING an account is done by setting the expiration time of the user account to some point in the past. This can be done with chage -E 0 username, which sets the expiration date to 0 days after the Unix epoch. Setting it to -1 will disable the use of the expiration date.
The effect of locking to to prevent the login process from using a supplied password to hash correctly against the saved hash (by virtue of the fact that the pre-pended marker character(s) are not valid output character(s) for the hash, thus no possible input can ever be used to generate a hash that would match it). The effect of disabling is to prevent any process from using an account because the expiration date of the account has already passed.For my situation, the use of locking is not sufficient because a user might still be able to login, e.g. using ssh authentication tokens, and processes under that user can still spawn other processes. Thus, we have accounts that are enabled or disabled, not just locked. We already know how to disable and enable the account - it requires root access and the use of chage, as shown above.To repeat my question: is there a shell command which can be run without root privileges which can output the status of this account expiration info for a given user? this is intended for use on a Red Hat Enterprise 5.4 system.The output is being returned to a java process which can then parse the output as needed, or make use of the return code.
View 2 Replies
View Related
Jan 27, 2011
I logged in my system as root. but when i run a simple shell script i got an error like . Permission Denied. why m getting this error.
View 3 Replies
View Related
Feb 10, 2011
how to run a shell script taking command line arguments in a jsp page.
View 1 Replies
View Related
Oct 8, 2009
I use kubuntu (8.04) which does not have a root account.
[sudo] password for ts:
However, starting xclock or gvim on root shell on konsole has the "Can't open display" error appears.
Error: Can't open display: localhost:0.0
Press ENTER or type command to continue
View 2 Replies
View Related
Apr 14, 2010
Is there a way I can run 'completely' one of my script when ubuntu's desktop appears no matter if root , administrator, desktop user or an unprivileged user logged in?
What does the script do? The script mounts a partition, looks for a file in that partition and finally on the basis of that file a decision of copying a partition to another partition is made. That copying is done via
[Code]...
View 5 Replies
View Related
Sep 26, 2010
I have installed release CentOS 5.5 w/ fetchmail services. I've already configured the /.fetchmailrc in the correct format that I've learned from topics and I've checked also the sedmail running status. When I invoke the #fetchmail command this often happens:
fetchmail: WARNING: : Running as root is discouraged.
2 messages for user1 at mx.mailserver.com.ca: (1 of 2) (4353 octets) .....flushed
I have configured two NIC 's One for the public IP and another for the local network, I've tried to use the two IP's in the POP3 and SMTP settings of Mozilla Thunderbird but still user1 can't get messages.
View 14 Replies
View Related
Nov 23, 2009
I am trying to set the umask for a process(orkaudio) which is running as the root user.This program creates dir and files and I need the umask to be 022. I have edited my /etc/bashrc -- and when i type in umask i get 0022 --- Not sure how to go about getting this resolved...
View 1 Replies
View Related
Jan 20, 2011
want to run VirtualBox with root permissions. Trouble is that only when run as root i can access attached USB devices inside of a virtual machine, otherwise, these a greyed out).Now running VirtualBox as a root user also changes the configuration folders, making all my virtual machines already defined disappear. I also don't want to copy all to the root configuration folders. Is there a way to give the VirtualBox root permissions but without actually running the application as a root user. Is it possible to do without changing the permissions of the non-root user, i.e. i don't want my user to have all root permissions, due to security considerations.
View 1 Replies
View Related
Sep 4, 2009
Is suid disabled from running all home made bash scripts or just from running them as root or:
Who would know for sure.
I googled several combinations of Mandriva Linux how-to suid disabled setUID etc... so far all I found was "many distributions are disabling suid for security reasons" nothing specific.
View 2 Replies
View Related
Mar 9, 2010
I tried to create a user on Solaris 10 but when I try to login the user with "su -" I get the error message "no directory". When I try to login with "su" I get the error message "no shell".
I tried the useradd several combinations e.g.
All the tries i made didn't work. I also checked the permissions on /etc, /bin, /sbin and / and it seems ok so that the newly created user can access them.
View 14 Replies
View Related
May 1, 2011
I Want to run below script withing expect utility
Code:
mystring "abc:-)"
mystring1=${mystring/)/.}
View 2 Replies
View Related
Apr 18, 2011
Basically I want to be able to run XP in a shell inside the Ubuntu environment (as opposied to just having duel install.
Is this possible? Stable? Realistic?
Its only for gaming really as I don't have all that much luck with Wine.
View 5 Replies
View Related
Oct 28, 2009
Is It possible to change a process running in root-user to non-root-user by setting suid / uid / euid / gid etc... I so please instruct how, when and wat to set in order to change a process running in root-user to non-root user
View 4 Replies
View Related