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


ADVERTISEMENT

General :: Startup - Automate "sudo Chmod A+r /dev/usb/hiddev0" Upon Start?

Oct 22, 2010

I have a footpedal and fortunately there is a software for using it under linux (see [URL]). The author of that software already solved an issue for me (see issues there), but there is no option to ask simpler questions.

Unfortunately prior to use the software I have to change the device permission each time I start linux. How could I change that to be done automatically at startup?

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

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

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

Programming :: Automate The Password Prompt Required For Sudo Commands?

May 31, 2011

I have written a script to run commands on remote servers, it is working fine. But when I am running "sudo commands" on the remote servers, it asks for me password after prompting for ssh password. I am unable to automate this password prompt (which is just after ssh password prompt). This is the function I am using to provide passwords

Code:

pass ()
{
cd $DIR/"$dt1"_"$dt"
/usr/bin/perl << 'EOF'
use strict;

[code]....

I want the same function to be used , when it expects for sudo passwords for any of the below lines:

Code:

[sudo] password for vikas: orPassword: This is my "cmd" file passed in pass () function.

Code:

ssh -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no 192.168.1.100 "bash rcmds"

This is my script output

Quote:

[vikas@box1 ~]$ ./rscript.sh
++ rm -rf /home/vikas/May_31
++ mkdir -p /home/vikas/May_31
++ set +x

[code]....

how to automate the password prompt required for sudo commands.

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

Ubuntu Networking :: Automate Ifconfig Command?

Nov 8, 2010

I manage to get Ethernet over Firewire working between my Windows XP desktop and my Ubuntu 10.10 laptop.However, I am getting tired of having to manually issue the ifconfig command every time.How can I automate it so that the command is done at bootup?

View 1 Replies View Related

Slackware :: Set Default User And/or Password In Console Login, Automate Startx?

Jun 23, 2010

- is there a way to set the default user in console login so that all needed is to press enter(or event without it) to be able to input the password for that user - also is it possible to console login without password, by just inputting user name and pressing enter how to put startx for that user right on login, so that the user doesn't input the command manually

View 6 Replies View Related

Debian Programming :: Automate Command Line At Start-up

Jan 26, 2015

I'm trying to automate two command lines, a synclient and a syndaemon. They both work well if I type them manually in a terminal, but if I do a littre script to do this, tap to click and scrolling don't work anymore.

This is the script I wrote:
Code: Select all#!/bin/bash
synclient VertEdgeScroll=1
syndaemon -d -t -K
exit 0

So I made a chmod +x on the file, placed it in ~/bin then change PATH to include the directory. Then I added this file in "Startup applications".

The scripts run ok, mais it has a different effect than if I run the commands manually.

View 10 Replies View Related

General :: Enable One User To `sudo` Without A Password?

Jun 4, 2010

How can a user be setup to sudo (or su -) without entering a password?

View 1 Replies View Related

General :: Difference Between Sudo And Root User?

Feb 8, 2010

Can a sudo user do everything what a root user can do? I read sometimes expert say "You should run it as root rather than sudo user".

View 14 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 :: 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 :: Provide Sudo Access To Oracle User?

Dec 9, 2010

I need to provide sudo access to Oracle User, run only this particular "SRVCTL" command.

Do I need to edit "sudoers" file .if so where do I need to add these two lines in sudoers file.

1. apps/opt/grid/bin/srvctl

2. /apps/opt/oracle/product/11.2.0/db_1/bin/srvctl

View 2 Replies View Related

General :: How To Alias A Command For Sudo

Sep 25, 2010

I have an alias that I would like to use both as a regular user and as root, via sudo. Specifically, it is this:

alias rm=trash This works fine as a normal user, and it works fine when I use sudo -i to get a root shell prompt, but if I use sudo rm, the alias does not apply. So where do I need to put my alias so that it works in one-off sudo commands?

View 1 Replies View Related

General :: Execute A Command After Sudo?

May 4, 2011

I am working in a CentOS environment with numerous CentOS machines. Currently there are multiple developers that each have their own login/home directory and then for various admin tasks we all share a single super user account.

The problem

I have a number of aliases, variables, functions, and settings that exist in my personal login's .bash_profile. None of these are available in the shared super user's .bash_profile. My current work around is that everytime I sudo in as the super user and I re-execute my .bash_profile from my personal user's home directory. I am not allowed to edit the init stuff for the super user

The Question

Is there any way I can automate my sudo sequence such that it will execute my personal .bash_profile after I've executed sudo without requiring me to edit the super user's bash init stuff?

View 3 Replies View Related

General :: Sudo For Www User To Run Root Shell Script Via Browser?

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

General :: Easy Way To Explicitly Deny User Sudo Permission?

Jun 8, 2011

I am attempting to configure my sudoers file, and have quite a few questions.If you can answer any/all of them, I would be grateful.

-Is there a way to set it up so that root gets notified if a user tries to use a command they are not allowed to?

-If something like this already exists on my system, how do I set it up/use it/ read root's messages?

-I see a lecture=always default exists, but can I customize this lecture?

-Is there an easy way to explicitly deny a user sudo permission?

-I see there is an ALL wildcard. Is there something similar to a NONE wildcard?

View 3 Replies View Related

SUSE :: Automate Execute Command, Reboot And Execute Command?

Dec 1, 2008

Is there a way to execute some command and then after the command completes utomatically reboot the system and then after the system reboots execute another command ? For example look at the sequence shown below(1) Execute command-1(2) After the command-1 in (1) is completed,reboot the system (3) Execute command-2(4) After execution of command-2 reboot the sytemIs there a way i can automate this process so that i need not reboot the system manually

View 5 Replies View Related

General :: Write A Script To Sudo The Last Command?

Feb 19, 2011

for some commands such as apt-get install xxx, I forget to add sudo first, then I need to retype it. What I want is in such cases, I just type a simple command, for example resudo. It will sudo my last command sudo apt-get install xxx. Is it possible in bash?

View 1 Replies View Related

General :: Run Ubuntu Command Sudo Apt-get In Mandriva?

Sep 12, 2011

How i can run the following command (for Ubuntu) in Mandriva 2005 ? What is the similar command ?

sudo apt-get install python-wxgtk2.8 pyro mercurial build-essential bison flex mercurial python-numpy

View 1 Replies View Related

General :: Execute Root Command Without Sudo?

Jan 24, 2010

On my ubuntu I have a command pm-suspend, which puts the computer to sleep. It has to be run with sudo. Since it is inconvenient to be forced to type the password every time I want my computer to sleep, I thought maybe there's a way around it. Naively I thought that if I'd create a script as root, that invokes pm-suspend, and then let anyone execute that script, I could run that script as my own user and then that script would be considered run by root and hence be allowed to run pm-suspend. Obviously that didn't work. The root-check procedure in pm-suspend still found out that the original executor was someone different from root.

Still I think something similar (although slightly more elaborate) should work.I'm thinking about the process that allows the user to mount hard drives for example. Normally root is required, but it is somehow bypassed by the gnome utility mounting.

View 8 Replies View Related

General :: Sudo Versus SU - SAX2 Command?

Jun 3, 2010

I've been using SuSE for a while and something has been bugging me. Not a show stopper, but nevertheless, an interesting one. Most tutorials, forum posts, etc. recommend using a sudo command to accomplish stuff. For example:

Code:
sudo make install
sudo vi file

However, this does not always work. For instance, I was recently working on a resolution problem with my ViewSonic VX922 - it would only display at 1024x768 rather than the native 1280x1024. Viewing some posts, I found the command "sudo sax2 -r". What I discovered is that there seems to be a big difference between sudo and su

Code:
drkhelmt@SPACEBALL1:">sudo sax2
root's password:
sudo: sax2: command not found
drkhelmt@SPACEBALL1:">su
Password:
SPACEBALL1:/home/drkhelmt: #sax2
SaX: Checking update status for intel driver
SaX: initialization already done
SaX: cal [ sax2 -r ] if your system has been changed !
SaX: startup
SaX: X server:0.0-> grant
SaX: importing current configuration
SPACEBALL1:/home/drkhelmt: #

So the question, why does the command sax2 (and others) work when after the su command rather than a sudo?

View 5 Replies View Related

General :: Sudo Command Doesn't Work

Oct 17, 2010

I want to install some software using sudo apt-get command,but it dosen't work.(my network works well) how to handle it? below is the output of terminal:

@ubuntu:~/Downloads$ sudo apt-get install build-essential cdbs fakeroot dh-make debhelper debconf libstdc++6 dkms libqtgui4
Reading package lists... Done
Building dependency tree

[Code].....

View 4 Replies View Related

General :: Usage Of Sudo Command In Ubuntu And Red Hat?

Apr 18, 2010

In Red Hat, suppose if root user wishes to give a privilege to run the fdisk command to a user named sam.And he makes appropriate configuration changes in /etc/sudoers file. Now when sam wishes to run the fdisk command, then he has to issue:

Code:
[sam@system43~]$sudo /sbin/fdisk -l
Password: But in ubuntu, after the same configuration being done, what sam needs to do is:
Code:
[sam@somesystem43~]$sudo fdisk -l
Password: ***

That means, in ubuntu the user need not type the full path of the command. I wish to know how can I make red hat system work like ubuntu as far as the sudo usage is concerned.

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







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