Ubuntu :: Make A Shell Script Run With Root AND Non-root Priveledges?

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


ADVERTISEMENT

OpenSUSE Install :: Revert The Changes Or Change The Permissions Again To Root:root Or Make Sudo Work

Aug 10, 2011

Accidentally I changed the ownership of all the directories under / to my own instead of root:root. Now I am unable to use sudo and many bad things are happening. Is there a way to revert the changes or change the permissions again to root:root or make sudo work ?

View 3 Replies View Related

General :: How To Login As Root In Shell

Jul 20, 2010

How to login as root in linux shell?

View 3 Replies View Related

Ubuntu :: Waiting For Root Device - Dropping To Shell

Nov 29, 2010

I was upgrading online through my android phone's easytether app. My phone rang, and I was bounced offline. When I came back the upgrade did not resume, and when I tried to start over, dpkg and whatever was busy so I closed all my windows and tried to reboot. This is where I ended up: Here is a screenshot:

View 3 Replies View Related

Ubuntu :: Unresponsive Keyboard At Root Shell Prompt?

Jan 28, 2011

I have no user name or password and cannot log in. In recovery mode, I after I enter "drop to root shell prompt" my keyboard does not respond when I try to "give root password for maintenance" or try to enter "Control-D" at the blinking cursor.

View 3 Replies View Related

Ubuntu :: Bashrc Take Effect Immediately In Root Shell?

Mar 9, 2011

How do you get your bashrc take effect immediately in your root shell? I read this.

[URL]

Code:
. ~/.bashrc

Does this not work in your root shell?

View 1 Replies View Related

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

Ubuntu :: Setting Root Password For Maintenance Shell - Failed

Aug 10, 2010

I'd like to keep root pw==sudo pw==user pw on a box with Code: $ lsb_release -ds Ubuntu 9.10 $ uname -rv 2.6.31-22-generic #61-Ubuntu SMP Wed Jul 28 02:02:56 UTC 2010 Just now it hung going to sleep, so I shutdown via BRS. On cold boot, HD mount failed and I got the prompt to hit Esc to goto maintenance shell. I did that, got the prompt for the root password, and entered my sudo.

That failed! though it has worked before ... but I changed my user password on that box recently, and I'm pretty sure I haven't needed to fsck between then and now. I'm wondering: What do I need to do to set my root pw? I was able to C-d out of the shell, and karmic took care of itself, but I'd prefer not to rely on that. Is there a way to make my root pw always equal my user pw? If so, is that a Very Bad Idea?

View 2 Replies View Related

Ubuntu Installation :: Root Disk Does Not Exist - Dropping To Shell

Oct 13, 2010

Just tried installing Ubuntu 10.10 from a USB device on my Windows 7 machine but something goes wrong. Far into the installation the computer restarts, asks me which operating system I want to start (it had already done this once before) and I choose Ubuntu. Then I get three alternatives:

Ubuntu, Linux 2.6.35-22-generic
Ubuntu, Linux 2.6.35-22-generic (recovery mode)
Windows 7 (loader) (on /dev/sdb1)

I pick the top choice, and get the following message:
ALERT! /host/ubuntu/disks/root.disk does not exist. Dropping to a shell.

If I start recovery-mode i get the same message. There's some text above the message that reads "new low speed USB device using ohci_hcd and address"... Could there be a problem with the usb-drive? If I remove the USB drive I get the message: Gave up waiting for root device.

View 2 Replies View Related

General :: Switching To Root Account In A Bash Shell?

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

Ubuntu :: Deleted User Main Folder - How To Restore Using Root Shell

Apr 14, 2011

I have system that was cloned from another system hence the user was same in both computer. I changed the computer name - to TANU. Then I added another user - BANU. I gave admin rights to second user. Logged out the first user DON- who is now only the desktop user. Before deleting the account through users and groups - I deleted the folder DON from home folder. I restarted the comp. unable to login. I had created automatic login for both users. How to restore the folder DON while using root shell.

View 2 Replies View Related

Ubuntu :: E233 - Cannot Open Display - When Starting Gvim On Root Shell

Aug 30, 2009

However, "E233: cannot open display" error appears when starting gvim on ubuntu 8.04root shell.

E233: cannot open display Press ENTER or type command to continue # kdesudo gvim /etc/fstab kdesudo: cannot connect to X server.

View 5 Replies View Related

General :: Running Shell Program On Startup As Root In Terminal

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

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

Software :: Execute Shell Commands That Require Root Password From PHP?

Jun 26, 2010

php. I am developing a web-interface for an application that sometimes needs root privs. Editting /etc/sudoers is not an option since the web interface needs to be portable to other users when they install my application. Is there any workaround ?PHP Code:

php code:$command = "./script.sh /dev/$DISKNAME &";$shellOutput = shell_exec($command); 
Code:

[code]...

View 2 Replies View Related

Ubuntu Installation :: Boot Fails: Can't Find Root Device + Drop To Shell

Dec 27, 2010

From one day to the other my system stopped booting properly. Since I (finally) fixed it, I wanted to share my solution. It runs on a fakeraid pair of SSD's of 60 GB each (actually a single Revodrive device, but it shows up as two devices). When Ubuntu 10.10 boots, I'm dropped to a shell.During boot, when I removed "silent splash" from the kernel's command line, I got these messages:

Code:

[ 4.960240] scsi 6:0:0:0: Direct-Access ATA OCZ-REVODRIVE 1.20 PQ: 0 ANSI: 5
[ 4.960425] sd 6:0:0:0: [sdg] 117231408 512-byte logical blocks: (60.0 GB/55.8 GiB)

[cod]....

I doubt that this is what was needed (as I had that already when it didn't work, but I might be required in addition to installing dmraid)

# update-initramfs -a

After installing this, the problem was solved!! This is strange since I don't recall uninstalling this package or changing anything important, for that matter (perhaps did apt-get upgrade, but that's about it!). [URL]

View 2 Replies View Related

General :: Ubuntu 6.06: Mounting /root/sda1 /root Failed: No Such Device

Jan 22, 2010

An old machine in our office, running Ubuntu 6.06 all of a sudden will not boot up. I get the following info during boot:

Uncompressing Linux... Ok Booting the kernel
mount: Mounting /root/sda1 /root failed: No such device
mount: Mounting /root/dev on /dev/.static/dev failed: No such file or directory

[code]....

I haven't changed anything on the system as far as I'm aware, and I ran some HD diagnostics and everything seems fine. however when I try to mount the drive with the following command:

sudo mount -t ext3 -o rw /dev/hda1 /mnt

I get the following error:

mount: wrong fs type, bad option, bad
superblock on /dev/sda1, missing code
page or helper program, or other error
In some cases useful info is found in
syslog - try dmesg | tail or so

I ran fdisk -l and it says the partition type is Linux. The output after running dmesg | tail :

[12207.483801] init_special_inode: bogus i_mode (101)
[12207.483809] EXT2-fs: corrupt root inode, run e2fsck
[12260.427078] init_special_inode: bogus i_mode (101)

[code]...

Update: After running e2fsck -p /dev/sda1, I get the following info:

/dev/sda1: clean, 142449 / 9584640 files, 5402711 / 19161520 blocks

View 1 Replies View Related

Ubuntu :: Root User Directory Does Not Exist, Root Password Not Recognised?

Oct 26, 2010

I no longer have access to my root desktop. On a session I attempted to change the root username but i apparently assigned it a wrong directory that does not exist. When I rebooted with my new root username, i was instead recognised as a simple user (no root privileges). I tried the console to change to "old" root but root password is not accepted and there is no way to access to sudoer files. it seems that inserting a new username requires root privileges and i am back to square one. Simply logging with old root username and password after restart gives me a blank screen with nothing on it and cannot even reboot.

View 9 Replies View Related

Ubuntu Security :: Giving Root Permission To An Application But Without Running It As Root?

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

Ubuntu :: Can't Cd To Root Acount /home In Terminal - Sudo Cd /root Fails?

Jul 25, 2011

can't cd to root acount /home in terminal - sudo cd /root fails?

View 3 Replies View Related

General :: Did Not Find Any Option For Root Password For Root User In Ubuntu 9.10?

Mar 2, 2010

i used opensuse 11.1 ...there is option for root user to create password for root...but for ubuntu i did not find anything like that...so how can i create root password....or how can i use root

View 1 Replies View Related

Ubuntu :: Deleted Something As Root And Did Not Get Space Back / Nothing In Root Trash?

Jul 22, 2010

So I transfered a few folders with videos in them to the public folder on an Ubuntu 10.04 laptop I have from my Ubuntu 10.04 64bit laptop. When I wanted to delete the folder I didn't have permission so I ran "gksudo nautilus" so I could delete it as root. So I deleted the folder but I did not get the space back!

I went to /.local/Shared/Trash and one of the folders I deleted was there but deleting it didn't get that space back either.

I did some searching but most of what I find doesn't help or tells me to look in the folder /.local/Shared/Trash folder but that didn't help any.

View 3 Replies View Related

Ubuntu :: Root-User : Unset The Root Password?

Oct 14, 2010

A friend of mine has told me to set a root password and use root (f.e. switching to su in terminal and work with root rights instead).Is there any way to unset the root password? I know how to use sudo now.

View 9 Replies View Related

Ubuntu :: Switch From Root (#) To Normal Non-root Prompt($)?

Mar 20, 2010

how do i switch from root (#) to normal non-root prompt($). I'm new to linux

View 3 Replies View Related

Debian :: Root Access And Desktop Disabled \ Couldn't Open The Root Terminal?

Feb 19, 2011

I was using the latest stable release of Debian, dual-booted alongside Windows Vista, with the GNOME desktop, installed via netinst, trying to build and install a library that I knew and trusted, when suddenly I couldn't open the Root Terminal. I clicked the link (in Applications->Accessories (I think, whatever the top one is)->Root Terminal), and in the taskbar I saw an item that said "Starting Root Terminal". A few seconds later, that went away, but the terminal still wasn't open. I tried the regular user terminal, to see the same thing happen. Unsure of what was happening, I tried restarting my computer, since that's always the first step you should take in computer problems.

When I restarted, GNOME wouldn't start. The screen would flash a bit for a few seconds, then a dialog box would appear over a background of static that said "The greeter application is crashing. Attempting another one...".t would then go back to the DOS-style kernel, wait a second, and then the same thing would happen. After several of that, I would get a blue screen which said something to the effect of "It has been detected that the desktop environment has crashed six times in the past 30 seconds.

Waiting two minutes before trying again." When it did that, I tried logging in as root to assess the problem. I gave it the correct password, but it said that it was an incorrect login. After several tries (to ensure I didn't mistype the password), I logged in as myself. Same problem. I tried the su command, with the correct password, and it said it couldn't authorise it.

After a lengthy conversation with a friend of mine who was very good with computers, he basically summarised that he had no clue, but that his best guess would be a virus. Upon running the Linux installer, I found the Repair option. Not being particularly familiar with Linux, I used it simply to backup my important files onto a flash drive. I then tried running the Install option, in an attempt to simply write over my existing Linux and make it new again. The installer, however, consistently froze up when trying to start the partitioner, on the "Checking disks..." stage. I figured it was a problem with my partition. In my naivete, I simply used the Windows tools to clear that partition... It destroyed GRUB too, so I couldn't run any OS. I figured my computer was pretty well screwed, and at that point just decided to bring it into the shop and have them completely wipe it.

my computer was backed up onto an external hard driven I brought it back, I reinstalled Windows. Upon restart, it said that it was still looking for GRUB, which made no sense to me. After messing around with it a bit, I decided to just reinstall Linux too. To my lack of surprise, that fixed the problem. Both OS' now ran just fine. The first thing I did on Debian was to install the Clam Anti-Virus, which I understood to be one of the best Linux anti-viruses. However, within about 10 hours, got the same problem as originally. I wasn't doing any of the same things, and between the lack of consistency in activities and the fact that I had an anti-virus running,figured it wasn't a virus. Not knowing what to do, I just left it and have been using Windows since.

View 8 Replies View Related

OpenSUSE Install :: Create A Root Backup Image Of The Root Partition ?

Oct 12, 2010

Since I installed MS2 I messed up grub. Finally I got 11.3 back to its old glory.

What would be the best procedure to create a backup image with all settings and permissions ...just in case ?

View 5 Replies View Related

OpenSUSE Install :: Get Root Privileges On User Account Without Using Root Login?

Feb 5, 2011

i am having problems with privileges i have created a new user with my name, but i cant get root privileges on it. i need the same privileges as the root profile.

View 9 Replies View Related

Red Hat / Fedora :: Root Line Passwd File Now Unable To Login As Root?

Jan 26, 2010

I edited the passwd file to modify the default shell for root from bash to tcshnow when I try to login to root it gives me the following error:"su: /bin/tcsh : No such file or directory"

View 3 Replies View Related

General :: Failed To Change Real Root To Fake Root Using Chroot?

Jun 28, 2011

I created a chroot jail in /SECURITY/Jail. But when I used the command 'sudo chroot /SECURITY/Jail' to enter the fake root, I got an error message likegroups: cannot find name for group ID 105groups: cannot find name for group ID 119.

View 1 Replies View Related

General :: Root Logins Are Not Allowed \ When Try To Login As Root, After Logging Out As User, It Does Not Allow?

Dec 2, 2010

i just installed linux mandriva 2009. i set password for root and created a user account. when i try to login as root, after logging out as user, it does not allow me and gives the error "root logins are not allowed". even it does not show the root account. if i try to go to root from konsole terminal using su root, it allows to enter as a root but when i try to start the GUI with startx it gives error.not sure what to do and why i can't see my account in GUI mode

View 5 Replies View Related







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