[SOLVED] sudo -i changes ownership of .Xauthority to root, breaks X

From a normal user's terminal session running in xmonad, I tried to enter a root terminal session with "sudo -i".
I got sent to the virtual console and couldn't switch back to X. An error message told me .Xauthority was not writable. The user's .Xauthority file was now owned by root and not writable.
After removing the root-owned files, I could start X and everything seems normal.
"sudo -s" and "su" work as expected.
Do I have a bad configuration? Do I not understand "sudo -i"?
Edit: Could sudo's "initial login" try to start X as root? I have auto-login configured for the first virtual console. I'll try to switch that off and try again.
SOLVED: The cause was my root user's .bash_profile and .zprofile. I copied my user's .bash_profile and .zprofile over to root and didn't notice that I should comment the following line to automatically start X:
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
Last edited by Markus00000 (2013-06-13 13:04:31)

Change
archimedes ALL = (ALL) NOPASSWD: SHUT, NOPASSWD: PAC
to
archimedes ALL=(ALL) NOPASSWD: SHUT, NOPASSWD: PAC

Similar Messages

  • [Solved] Unable to change ownership of folder

    I'm running ArchLinux on a desktop but I have my music files on an external HDD.
    So, I added a line to /etc/fstab to enable the music partition on the external drive to be mounted.
    However, the folder where it is mounted was created by root so I can't access it (as user) without changing the ownership.
    So, I did
    # chown paul:users /mnt/music
    which gives me the message:
    chown: changing ownership of `/mnt/music': Read-only file system
    However, ownership remains as root and I'm still unable to acees this folder.
    What's going on here?
    Last edited by paulfxh (2008-03-13 21:31:03)

    paulfxh wrote:
    kumico wrote:are you sure the fs is mounted in rw mode, the error message shouldn't be wrong when it says it's a rad-only(ro) fs
    But, I'm not worried about it being ro as I only want to "listen" to the music and not change any of the files.
    You will only be able to change the ownership if you unmount and remount the filesystem read-write
    (then after changing ownership you can unmount and remount it read-only again, if you so wish)
    Last edited by dyscoria (2008-03-13 21:11:35)

  • [SOLVED] [sudo] allow user to run commands as root

    Hello,
    I want to run programs like netctl and vpnc as normal user without typing in my password. This is what I've come up with for /etc/sudoers:
    myusername ALL = (root) NOPASSWD: /usr/bin/netctl, /usr/bin/vpnc, /usr/bin/vpnc-disconnect
    But running e.g. "netctl start someprofile" fails because access to the file `someprofile' is denied -- the file is owned by root and only root may read it.
    Doesn't running programs as root also mean that these programs can read files owned by root? Or is this a misconception and I should change permissions to the corresponding files?
    Thanks & Regards
    Edit:
    I just realized, that, with the setup above, "sudo netctl start someprofile" does work without demanding a password. This is nice. But can it be tuned further so that I don't have to prepend "sudo"?
    Last edited by ball (2013-05-23 19:22:17)

    @qinohe:
    I am in group wheel and I already have
    %wheel ALL=(ALL) ALL
    myusername ALL=NOPASSWD: /usr/bin/netctl, /usr/bin/vpnc, /usr/bin/vpnc-disconnect
    So this would be same, wouldn't it?
    I just realized, that "sudo netctl start someprofile" does work without demanding a password. This is nice. But can it be tuned further so that I don't have to prepend "sudo"?
    Last edited by ball (2013-05-23 18:50:46)

  • How can I change ownership on locked folder? (error 120)

    I had to create a new user after my previous (file vault) sparse image became corrupt. Fortunately I had backup and I'm getting things back to normal with a new user name.
    But several of the folders and files on my secondary internal drive are now locked as read only. The owner is the old name (of the corrupted user folder).
    How can I unlock the folders to change ownership and permissions to my current user name? I am logged in as an administrator. Whenever I try I get an error code 120.
    G5 dual 1.8   Mac OS X (10.4.4)  

    Solved it. Checked the "ignore ownership" box on the secondary drive and I can unlock the folders. Works for now.

  • Chown: changing ownership of u01: operation not permitted.

    Hi
    I am dual booting Window 8 and Oracle Linux 6 on my system. Both OS is working perfectly. I have one NTFS partition "/dev/sda4" which gets mounted with no issues, when using mount command.
    In my / directory of linux system I have created u01 folder. I changed the ownership of this u01 folder from root:root to  oracle:oinstall (oracle user and oinstall group). Now when I am mounting /dev/sda4 to u01 using:
    sudo mount /dev/sda4 /u01
    It is getting mounted perfectly but the ownership of u01 is getting changed from oracle:oinstall to root:root again.
    Now I am trying to change it back to oracle:oinstall using:
    sudo chown oracle:oinstall /u01
    But it is showing error: "chown: changing ownership of u01: operation not permitted. "
    Note: My username is oracle and group is oinstall. I have put oracle user in  /etc/sudoers file:
          oracle ALL=(ALL) NOPASSWD:ALL
    Thanks
    Nitish

    Dude,
    Actually I wanted to install  oracle database in my linux system. I thought of putting database binaries in my NTFS partition. Everything was worknig fine. I was able to install oracle database such that the binaries are in NTFS partition.
    The only problem was that I was not able to change ownership from root:root to oracle:oinstall.  This is recommended by Oracle.
    It doesnt matter you are root user or any user you wont be able to change ownsership.
    I found out the probelm. Thing is that,  no user can change ownership of NTFS or FAT system. It will always be mounted as root:root. I formatted the partition in EXT2 format and mounted it to /u01 folder. It was root:root then I changed it to oracle:oinstall by chown command and it was successfull.
    If you have any other idea or workaround please let me know.
    Thanks
    Nitish

  • Change ownership from "system" on mounted volume?

    I have an external firewire drive with 3 partitions all of which are mounted on an iMac, and which until recently all had the same ownership and permission settings under my admin account. One of the volumes (the one storing all the users' iTunes songs) somehow changed ownership to "system" and group to "wheel". I can no longer access the volume nor can the other user accounts on the iMac, although it shows up as a mounted volume when viewed in Disk Utility. "Repair permissions" is unavailable for this volume in Disk Utility. The other two volumes are unaffected and retain the original ownership settings. I'd like to reset ownership from "system" to my admin account, but do not know how to do so as apparently it needs to be done through unix commands using Terminal. What do I need to do?
    iMac   Mac OS X (10.4.8)  

    "...under Ownership & Permissions, click on the lock, enter your password, and change the Owner to you, with R&W access and the Group to admin, also w/R&W access, and click o Apply to enclosed items. Click the lock and close the Info window. No need to use Unix commands in the Terminal app."
    I first tried that approach but unfortunately the procedure does not work. Under Ownership & Permissions it says "You have No Access". I can click on the lock and select my name under Details: Owner, but once I click to relock, Owner just reverts back to "system".

  • How do I change ownership on iTunes Match from one account to another?

    I purchased iTunes Match using one account but use another as my account for iCloud and my iPhone. How do I change ownership of my Match account?

    I don't think you can.  Purchases made with an account are tied permanently to that account.  This is the reason why it is not a good idea to have more than one iTunes account unlesss you really need to keep them separate.

  • How do I change ownership of an iPad?

    Hi guys,  help me save an iPad !!
    This is a tough one because I do not have access to the previous owner's ID password.   Talking about a 4th gen iPad, 32GB, iOS 8.3 with a badly shattered front glass.     My 5-year old grandson did this.   Done this sort of work before (old MacBook, inverter board), so I got the parts and instructions from ifixit.com and ready get to work on replacing the glass.   But ...., I needed to make sure we can use it fully.   It kept asking for the ID password.  I have already erased it with restore/iTunes connection after trying the other fixes in the book..    Of course, now I need the ID pw to activate it.      It's unusable now.
    This is a divorce situation in a family member.    Go figure.     We are trying to get her to give us the pw or, remove the iPad from her "list of devices" in her iCloud account as specified by Apple instructions.      She has refused to help with this, though the iPad is her son's which I got for him for Christmas sometime ago.   We are still trying to get her cooperation on this.
    OK, that's the sad story of a good, but dead,  iPad. 
    ???  Question:    Is there any way to change ownership of this iPad without its ID pw ???       Well, I said it was a tough one !
    Hope and Thanks,   Mark

    Thank you for using the Apple Support Communities
    Unfortunately it is impossible to change ownership of this device without having access to the previous owner's account.

  • How does one change ownership of event?

    How does one change ownership of an event?
    We are running OCS 9.0.4.2 on redhat enterprise linux 3.0
    I have a calendar entry which I got from:
    mySess.fetchEventsByRange(Api.CSDK_FLAG_STREAM_NOT_MIME | Api.CSDK_FLAG_FETCH_EXCLUDE_DAILYNOTES |
    Api.CSDK_FLAG_FETCH_EXCLUDE_DAYEVENTS, hand, in_start, in_end, eventProp, result);
    BEGIN:VEVENT
    UID:20050620T151524Z-505dd-1-7af6ed32-Oracle
    ORGANIZER;X-ORACLE-GUID=FEA199DDB9763627E030378E793341C1;CN=old owner:mailto:old.owner@email
    DTSTART:20050801T120000Z
    DTEND:20050801T220000Z
    END:VEVENT
    So now I'm trying to save the event under the new owner using this:
    mySess.storeEvents(Api.CSDK_FLAG_STORE_MODIFY,event,result);
    where event reads as follows:
    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//ORACLE//NONSGML CSDK 9.0.4.2//EN
    BEGIN:VEVENT
    UID:20050620T151524Z-505dd-1-7af6ed32-Oracle
    ORGANIZER;CN=new owner:mailto:new.owner@email
    DTSTART:20050805T120000Z
    DTEND:20050805T220000Z
    END:VEVENT
    END:VCALENDAR
    And i've run mySess.setIdentity to change to the old owner and new owner with no success?
    Please how does one change the owner of an event?

    The Calendar Sdk doesn't allow you to change the ownership of an event. (ORGANIZER value).
    Regards,
    Jean-Philippe

  • Is there any way that I can change ownership (not authorization) of a song so that I don't have to go between my parent's family account and my new account?

    So a little backstory i joined the army and get to go home and use the account where the majority of my music is very little, but now when i try transferring these songs to a new device some of them aren't authorized, and I don't want to go through this every time i get a new computer or ipod/iphone.  Is there any way that i can change ownership of a song or other file so that a different account is the one to authorize its use?

    No.
    tt2

  • Change ownership of entire hard drive

    I just installed a second hard drive to house all of my music files, and mounted it to /media, then transferred all of my files to it.  The problem is, I used samba to transfer all of the files from my XP box, so all the directories/files are owned by root, and it would take my a day and a half to chown each individual directory.  Is there an easy way to change ownership of the entire drive/directory?  Sorry for the noob question but google and man chown didn't really help me much.

    Use the recursive switch:
    chown -R USERNAME:users /media
    where USERNAME is your user name.

  • [solved] "sudo meld" doesn't work

    Hi there,
    recently I've installed "meld" for merging tasks. The problem: as a user meld works pretty fine but obviously doesn't save any changes to files that require root permission. Now I have tried to start meld with sudo, but this doesn't work:
    $ sudo meld
    Passwort:
    ** (process:9665): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags'
    ** (process:9665): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags'
    ** (process:9665): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
    No protocol specified
    /usr/lib/python2.7/site-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display
      warnings.warn(str(e), _gtk.Warning)
    /usr/bin/meld:126: GtkWarning: IA__gtk_icon_theme_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
      gtk.icon_theme_get_default().append_search_path(meld.paths.icon_dir())
    Traceback (most recent call last):
      File "/usr/bin/meld", line 126, in <module>
        gtk.icon_theme_get_default().append_search_path(meld.paths.icon_dir())
    AttributeError: 'NoneType' object has no attribute 'append_search_path'
    I must admit that i don't have an idea what that means
    So, any help would be appreciated
    Last edited by swordfish (2012-06-03 12:18:09)

    /dev/zero wrote:Something like gksudo may work?
    Seems you are right . I've installed gksu and now it seems to work - the GUI starts when I use "gksudo meld".
    Maybe gksu should become a dependency for meld?!
    Thanks a lot

  • How do I change ownership of apps?

    How do I change the ownership or Apple ID of apps I have purchased off the AppStore?
    Some of my apps were purchased using an Apple ID similar to [email protected]  When  iCloud was launched I signed up for it and now have a Apple ID like [email protected]
    I want to change ownership of apps from the gmail account to the iCloud account.  I don't want to have to sign in and and out of the AppStore on my iPhone, iPad and Mac to update apps.
    Any help on this matter will be appreciated.

    Thanks for that link.  Yes, it does clearly state Apple wont allow merging of Apple ID content.  Apple should reconsider this standpoint. Hopefully they will in the future.  Its only a matter of changing a record on their AppStore database.
    Its about 40/60 for the apps I have under my Gmail ID and my iCloud ID.  I will keep with iCloud and login into my Gmail ID when I've got lots of apps to update.
    Its a pain, but not the end of the world.  It must be frustrating for people with lots of apps on lots of devices.
    I am fairly new to Apple, however I feel the whole product ethos is much better than the Windows/PC approach.  I can't stand the fact I have to have a Microsoft email address just login into Windows 8.  I wish I had moved over to Apple years ago.

  • Bulk operation to Change Ownership of Reports in the CMS\FRS

    I have a large amount of reports that are owned by the administrator and need to change ownership to users for security & auditing reasons. I'm aware of the manual process to do this (basically re-publish them logged in as the user) however, doing this would be almost impossible to coordinate across the company.
    I have seen a few SQL scripts that have been used successfully by admins at other company's and based on XI R2, however I'm unable to get any of them to work (I'm on XI 3.1 SP3, FixPack3.1), nor do I fully appreciate the CMS SDK.
    Does anybody have any ideas on where I can go on this? Your comments\help appreciated as ever.

    Hello Neozeke,
    I recommend to post this query to the [BusinessObjects Enterprise Administration|BI Platform; forum.
    This forum is dedicated to topics related to administration and configuration of BusinessObjects Enterprise, BusinessObjects Edge, and Crystal Reports Server.
    It is monitored by qualified technicians and you will get a faster response there.
    Also, all BOE Administration queries remain in one place and thus can be easily searched in one place.
    Best regards,
    Falk

  • Trying to change ownership of my old iPod. The advice here is to go to "Devices" "Summary" "Restore", but I find "Devices" does not offer "Restore" but only "Sync", "Transfer", "Backup", and a greyed "Restore from backup."

    Trying to change ownership of my old iPod. The advice here is to go to "Devices">"Summary">"Restore", but I find "Devices" does not offer "Restore" but only "Sync", "Transfer", "Backup", and a greyed "Restore from backup."

    What I don't understand is that your iTunes looks different from mine--just a little bit. You have 3 circles, red, yellow, and green, in the upper right end of the top bar. INstead I have a square that is half gray. When I click it, I get a menu very similar to the menu under "File."
    The only place I see an entry for "Devices" is under "File," but it only gives the 4 options I mentioned before (see below). There is no "Summary."
    Here's another screen shot after I added an album to music. Now all the choices under "Devices" are grayed.

Maybe you are looking for

  • Error while deploying Production in CA server

    While deploying Production server at 21% the deployment gets failed and it shows the error given below please help me to solve it . And i again newly configured the server and tried the same error reaches don't know wats the problem. CONTAINER:atg.de

  • How to use allies names in ON condition

    i have the following query. SELECT DD.DATE_KEY , (SELECT MIN(NVI_DATE) AS NVI_MIN_DATE FROM FCT_SPA_NVI_OUTRIGHT A WHERE A.VENDOR_CODE=V.VENDOR_CODE) AS NVI_MIN_DATE , VO.BANK_ACCOUNT_NO , VO.BANK_NAME , VO.BANK_ROUTING_NO FROM DIM_VENDOR V LEFT JOIN

  • How Can I protect my swf files from decompiling / saving

    I have navigated through the internet for a long time now but could not find the solution to my problem which is "how to protect my swf file from decompiling/saving"? I know that it CAN BE DONE and here is an example of a file on the internet that ca

  • Big problem with police, Skype team, please read t...

    Hello everyone, hello Skype team. I want to tell short story what happened and I really hope you could help me. One day I was buying cellphone from a guy who I met in Skype. The phone, which I bought from him, was stolen, and now, after ~3-4 month, p

  • HT201071 Please add support for Camera RAW Canon PowerShot G2

    Please add support for Camera RAW Canon PowerShot G2, it may be ancient, but there are still a lot of G2s out there, and it's annoying to have a different workflow for pictures from them... best, case