How to get the user's home directory in Unix if I know the username?

I have a problem to determine a user's home directory in Solaris system.
for example, I know the username as "smith", how can I know smith's
home directory (the absolute path string)? pls help me...

if the user is the one running the program, you can always get the home directory using System.getProperties ("user.home");
If you are trying to get the properties of another user, you could try using setProperties to change the user name first, before getiting the home directory, but it probably won't work because of the security manager. You could read the /etc/passwd file and parse the path out, but once again, the user of the code would have to have appropriate permission.

Similar Messages

  • Need to write/delete a file (token) to/from user's home directory

    I want to build a class that runs on Windows/Unix clients. It needs to get to users' home directories (both environments) and write the token on login, delete it on logout.
    What method (or code snipet) would get a user's home directory?
    What method (or code snipet) would write/delete a file from it?
    Thanks much

    Even if you are not writing an Applet, this is applicable. But I thot if you were, you might need this.
    See 'SignedAppletDemo.java'
    http://developer.java.sun.com/developer/technicalArticles/Security/Signed/

  • Change NAME of User Account, Home Directory, Time Capsule and Network

    Hi All.
    I have a small home network and I would like to do this for all four of these.
    I think I have instructions on doing this for User Account, Home Directory and Time Capsule.
    Can anyone give me the "it is OK to do this" so I don't have to worry about something going wrong in the future?
    Also, can I do this for my network and does anyone know where I find this?
    Thanks.

    hotwheels 22 wrote:
    So I gather I cannot rename the name of the "Macintosh HD" which I guess is the name of my Hard Drive?
    Technically, it's the name of the OSX volume or partition, but is often just called your internal hard drive, since most folks only have one partition.  But some have multiple partitions, usually for dual booting, such as OSX and Windows; or Lion and Snow Leopard. 
    Yes, you can rename it easily (but you might check whether that will cause a problem with DejaVu).  It won't be a problem for Time Machine.
    Just right-click it in a Finder sidebar or on your desktop.  Do not use any slashes or colons, however -- you might want to avoid any punctuation or special characters.
    And then - In Accounts I have "Full Name" as literally my first and last name.
    Yes.   Each user account has a full name and a short name.  The full name isn't used for much.
    the HOME FOLDER is showing a totally different name than the "Full Name".
    Correct.  It's the same as the short name.
    So I set the HOME FOLDER name through some hocus pocus in the article and then what is the relationship between these things?
    The short name and the home folder name should be the same.  The article shows how to rename the home folder, create a new user account with a matching name, then delete the old account. 
    If you're not comfortable with the instructions in the article, I'd strongly advise not doing it.  You may end up having to do a full system restore.  I don't know, but perhaps your local Apple Store will do it for you.
    Functionally I have a HARD DRIVE and a HOME FOLDER and then the Full Name (listed in Accounts) is just sort of what I get called by...?
    The hard drive (OSX partition) is where your entire Snow Leopard installation is:  OSX itself, your Apple and 3rd-party apps, and one or more home folders.  (Many folks who share a Mac have separate home folders for each user.)
    have I been smoking?
    No comment. 

  • How to use smb share for home directory with AD account

    I have extended the schema of our AD and bound a macbook pro running 10.6.8 to the domain. AD users are able to logon, and if I select the option to use their AD homedirectory attribute then this smb share is used as a network drive. My question is though, I need users to logon to MAC using a different smb share for their home drive than the path set in the home directory attribute. Does anyone know how I can achieve this?
    Cheers
    Paul.

    But this method cannot use Regular Expression because my searching target is more than one line.Yes it can!
    Like you said, first you list all the files in the folder.
    For each file, use a BufferedReader to read the first lines, then you may use a StringBuffer to append the lines into it (don't forget to append the '\n' to each line).
    Finally, compile your pattern ( "^November.*\nDecember" ) with the DOTALL flag,
    verify that the string (from StringBuffer) matches the pattern and there you have it!

  • How to get all users under an organizations?

    Hello everyone.
    Just want to know if anyone knows how to get all users under a particular organization.
    From the Search User form, I found they may kind of user such attribute conditions:
    MemberObjectGroup
    is in
    XXXX(organization)
    But unfortunately, the "is in" is not a valid AttributeConditionOperator, so besides using "recursive" self-written function, anyone knows any possible buit-in trick?

    Here is my solution:
    <Rule'>
        <RuleArgument name='organization'/>
        <RuleArgument name='context'/>
        <block>
            <defvar name='orgs'>
                <new class='java.util.ArrayList'/>
            </defvar>
            <invoke name='getChildObjectGroupNames'>
                <invoke name='getObject' class='com.waveset.ui.FormUtil'>
                    <ref>context</ref>
                    <s>ObjectGroup</s>
                    <ref>organization</ref>
                </invoke>
                <ref>orgs</ref>
            </invoke>
            <append name='orgs'>
                <ref>organization</ref>
            </append>
            <invoke name='getUsers' class='com.waveset.ui.FormUtil'>
                <ref>context</ref>
                <map>
                    <s>conditions</s>
                    <list>
                        <new class='com.waveset.object.AttributeCondition'>
                            <s>MemberObjectGroups</s>
                            <s>in</s>
                            <ref>orgs</ref>
                        </new>
                    </list>
                </map>
            </invoke>
        </block>
        <MemberObjectGroups>
            <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
        </MemberObjectGroups>
    </Rule>

  • How to get Active users list in Essbase 6.5.6

    Hi Gurus,
    How to get Active users list in Essbase 6.5.6 version
    I dont find any Esscmd to find active users list....
    i used LISTLOGINS command in ESSCMD but its not helping me out....
    pls suggest me some approach to find active users list.
    Thanks in advance....

    Hi  ,
    Display sessions will give only active users details which are currently connected to the ESSBASE .
    if you need this list ? or  you need the  total list of   security  active users list ?
    if you need the currently connected to the ESSBASE
    if you check  one server  At a time  or you can check the application level also
    1)server level
    display  session all;
    2)application level
    display session on application  'application name ';
    go for the  run command ---> essmsh----->  login;----->enter user name ----> enter password----->enter host (like server name )  then you need to you   above  1 &2  commands
    Thanks,
    suresh

  • How to get to user startup folder in windows 7

    How to get to user startup folder in windows 7

    Unfortunately your post is off topic here, in the TechNet Site Feedback forum, because it is not Feedback about the TechNet Website or Subscription.  This is a standard response I’ve written up in advance to help many people (thousands, really.)
    who post their question in this forum in error, but please don’t ignore it.  The links I share below I’ve collected to help you get right where you need to go with your issue.
    For technical issues with Microsoft products that you would run into as an
    end user of those products, one great source of info and help is
    http://answers.microsoft.com, which has sections for Windows, Hotmail, Office, IE, and other products. Office related forums are also here:
    http://office.microsoft.com/en-us/support/contact-us-FX103894077.aspx
    For Technical issues with Microsoft products that you might have as an
    IT professional (like technical installation issues, or other IT issues), you should head to the TechNet Discussion forums at
    http://social.technet.microsoft.com/forums/en-us, and search for your product name.
    For issues with products you might have as a Developer (like how to talk to APIs, what version of software do what, or other developer issues), you should head to the MSDN discussion forums at
    http://social.msdn.microsoft.com/forums/en-us, and search for your product or issue.
    If you’re asking a question particularly about one of the Microsoft Dynamics products, a great place to start is here:
    http://community.dynamics.com/
    If you really think your issue is related to the subscription or the TechNet Website, and I screwed up, I apologize!  Please repost your question to the discussion forum and include much more detail about your problem, that could include screenshots
    of the issue (do not include subscription information or product keys in your screenshots!), and/or links to the problem you’re seeing. 
    If you really had no idea where to post this question but you still posted it here, you still shouldn’t have because we have a forum just for you!  It’s called the Where is the forum for…? forum and it’s here:
    http://social.msdn.microsoft.com/forums/en-us/whatforum/
    Moving to off topic. 
    Thanks, Mike
    MSDN and TechNet Subscriptions Support

  • How to get one users meetings via admin login

    I need to get a list of meeting rooms that the user is a
    participant/host/presenter in.
    In all the documentation I look at, it always suggest to use
    "report-my-meetings" while logged in as the user. This really isn't
    an option for the system that I'm building. I am logged in through
    an account that has full administrative access, but I'm having a
    tough time finding out what to pass to accomplish this.
    Any help would be appreciated, thank you.

    To my knowledge (and I have looked for this type a data a few
    times), there are no reports that ever differentiate a user as a
    participant/host/presenter directly. I think the reason is because
    users sometimes are promoted and demoted within a single meeting?
    That is not to say a custom report couldn't be made, but either the
    XML API (probably not) or directly from the MS-SQL DB on a licensed
    installation.
    A small nuance to be aware of is, whenever you see a report
    that gives the users email address, you know that they are a fully
    qualified Connect user. When the email is not there in the report
    and only a name is given, they are a "guest". Also, if you assign
    yourself as someone's manager, then go to "Manager Reports" link
    found on the homepage, you will get a manifest list of all of the
    meetings attended by the staff member you assigned under you.
    Sadly, that report only gives the meeting room name, time-in &
    time-out. To find-out what there roll was, you'd have to find the
    meeting in the Meetings tab and look under the permissions link.
    Real bummer the report you want doesn't come pre-built with
    Connect. Silly, in fact. If you really need this made for you, PM
    me and I can see if our engineers could access this
    indirectly.

  • An error occurred while backing up the user's  home folder

    I have a user account that I'm trying to remove from a computer. I have updated to 10.5.2, and restarted a number of times and repaired permissions. There were 3 accounts on the machine I'm trying to remove, and the first 2 deleted just fine. However, this last one, the most important one, will not delete and save to a dmg file.
    The error message is "an error occurred while backing up the user's home folder" shortly after beginning the process.
    log file shows:
    /08 12:52:49 AM authexec[266] executing /System/Library/PrivateFrameworks/DiskImages.framework/Resources/diskimages-hel per
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] 2008-02-28 00:53:13.213 writeconfig[209:10b] DILDiskImageCreate: internal error - missing kDIHLCreateImageComponentsKey in return dictionary
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] 2008-02-28 00:53:13.230 writeconfig[209:10b] DIHLDiskImageCreate failed: 999 (options:{
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] "create-content-spec" = {
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] "iff-spec" = {
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] "any-owners" = 1;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] "copy-uid" = 501;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] "no-cross-dev-nodes" = 1;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] scrub = 1;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] "skip-unreadable" = 1;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] url = file://localhost/Users/woneal/;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] };
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] "nbi-spec" = {
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] filesystem = "HFS+";
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] layout = SPUD;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] };
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] };
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] "create-target-spec" = {
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] "image-type" = UDIF;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] overwrite = 1;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] url = file://localhost/Users/Deleted%20Users/woneal.dmg;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] };
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] "suppress-uiagent" = 1;
    2/28/08 12:53:13 AM [0x0-0xe00e].com.apple.systempreferences[197] })
    any ideas?

    This is the correct steps to solve this problem:
    1. Cancel the update (with the backing up error, of course)
    2. Do a manual backup
    3. Do a manual restore (your password to unlock your backup file is your AppleID password, not your IPhone keypad password)
    4. Now Update your phone. This time the backup should work.
    5. After it is updated, it will automatically restore, if you choose to restore not to set up a new phone.
    And yes, copy all your photos manually. Your backup probabally won't include photos.
    If this still doesn't work, try to stop your anti-virus software.

  • I recently downloaded a movie from itunes from my work computer and now I can't get it on my home computer. I have already hit the button add recent downloads.  I can

    I recently downloaded a movie from itunes from my work computer and now I can't get it on my home computer. I have already hit the button add recent downloads. Any suggestions?

    If it's a purchase, click here and follow the instructions.
    If it's a rental, you can't.
    (91159)

  • My 2 year old has deleted my 'apps store' icon and I cannot figure out how to get it back? Doesn't seem to be available in the on-line apps store, ironically enough

    My 2 year old has deleted my 'apps store' icon and I cannot figure out how to get it back? Doesn't seem to be available in the on-line apps store, ironically enough

    He dragged the icon out of the dock at the bottom and disappeared. That icon is merely a "shortcut" that opens the application when you click on it.
    You still have the app. Open your applications folder and look for the App Store app icon. Click and hold down on the App Store icon and drag the icon down into the dock to replace it. That puts the shortcut back into the dock.

  • How to get rid of a window which says: CalendarAgent wants to use the "login" keychain

    How to get rid of a window which says: CalendarAgent wants to use the "login" keychain

    I would get free EasyFind (Spotlight will be a total waste of time), and search for caremefile and caremefile.info. If it comes up with anything, right-click and select move to trash, or just destroy. Since you didn't install anything, shouldn't be necessary to authenticate with the admin password before it will move to trash. Could also click on reveal in finder, which will allow you to see the actual location. Set it up as per the screenshot below.

  • Is there a way to authenticate an iPad to our WLAN using a digital certificate and then authorize the user in Active Directory?

    We want to authenticate both a device (iPad) to our corporate WLAN, but after authenticating the device we would also like to authentiate the user in Active Directory if possible.  Has anyone had any experience with this?

    You need to make sure that the server sends the "GeoTrust DV SSL CA" intermediate certificate.
    See:
    * http://www.networking4all.com/en/support/tools/site+check/ (www.ucfs.net)
    * https://knowledge.geotrust.com/support/knowledge-base/index?page=content&id=SO9557
    * https://knowledge.geotrust.com/support/knowledge-base/index?page=content&id=AR1422

  • HT202213 The screen displayed on the instructions for home sharing described as being found on the left side of iTunes isn't visible on the new iTunes page?? Where do i find that screen i.e., how do I fine the home sharing icon on the new iTunes page?

    The screen displayed on the instructions for home sharing described as being found on the left side of iTunes isn't visible on the new iTunes page?? Where do i find that screen i.e., how do I fine the home sharing icon on the new iTunes page?

    ontthe top menu
    View > Show sidebar
    Then the computers for home sharing show up under the Shared section

  • Windows cannot load the user's profile but has logged you on with the default profile for the system.

    My Windows 7  crashed a couple days ago after a windows update, I got this message.
    Windows cannot find the local profile and is logging you on with a temporary profile. Changes you make to this profile will be lost when you log off.
    I restarted the machine and got this message
    Windows was unable to load the registry. This problem is often caused by insufficient memory or insufficient security rights.
    DETAIL - The process cannot access the file because it is being used by another process. for C:\Users\TEMP\ntuser.dat
    I checked the event Log I found these .
    Windows cannot load the user's profile but has logged you on with the default profile for the system.
    DETAIL - Only part of a ReadProcessMemory or WriteProcessMemory request was completed.
    Windows has backed up this user profile. Windows will automatically try to use the backup profile the next time this user logs on.
    Windows cannot load the locally stored profile. Possible causes of this error include insufficient security rights or a corrupt local profile.
     DETAIL - The process cannot access the file because it is being used by another process.
    This is the first error in the event viewer after a successful logon
    The description for Event ID 34 from source ccSvcHst cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
     If the event originated on another computer, the display information had to be saved with the event.
    ccSetMgr
    Windows cannot load the user's profile but has logged you on with the default profile for the system.
    DETAIL - Access is denied.
    Looking at the Logs all I can tell is that after the Desktop Window Manager started if caused this error.
    The winlogon notification subscriber <SessionEnv> was unavailable to handle a notification event.
    then this one
    The Desktop Window Manager has exited with code (0x40010004)
    Then this before it shutdown.
    The User Profile Service has stopped.
    I started up the PC and the first message I got was
    How can I get access to my user profile? do I need to createa new Administrator account? Please help
    The EventSystem sub system is suppressing duplicate event log entries for a duration of 86400 seconds. The suppression timeout can be controlled by a REG_DWORD value named SuppressDuplicateDuration under the following registry key: HKLM\Software\Microsoft\EventSystem\EventLog.

    hi do the following
    1. In Search programs and files (Windows 7) area, type in regedit, and press Enter.
    2. If prompted click yes,
    3.  expand the following HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
    4. click the sid that related to your admin profile (if you not sure, click each sid and in turn look to the right hand side of registry editor it will show who that sid is related to one of the registry files should hae in description localhost\admin or
    something similair)
    5. right click the sid and press delete.
    6. restart your machine and log back on with the admin account, this will then rebuild the admin profile... dont worry when it loads and none of your personal settings are saved or files or folders... go to c:\users
    in here you will see two folders for the admin account, one will be just admin and the other most likely admin.localhost
    i cant remember which one is which but just check both, one will still have all your files and folders in it.
    i suggest making a backup of your data before doing this incase something does go wrong, but ive had this happen many times in a domain enviorment and has worked for me everytime.

Maybe you are looking for

  • Ran a Procedure in BI Publisher ?

    hi all, i've created a stored procedure and was wondering if i can use Oracle XML/BI Publisher to run this procedure. basically, i'll be creating a report and will be using Data Template. is it possible to run this procedure in the Data Template? tha

  • LOOKUP TABLES

    should both the source and lookup tables be in the same schema??? i choose the source table from one schema and the lookup tabel from another schema,so when i try to save it, i get an error saying *"In order to create a lookup ,you must be sure that

  • Correspondence - problem in sort variant

    I run program RFFOAVIS_FPAYM for Correspondence . I define in spro sort variant for the program and specific payment method without any sort ! ! ! ! I choose specific sort variant. but the program always get the sort from REGUH-SRTF2. there's the cod

  • Show new page table record based on parameter value in first page in ADF

    I have to show a selected record on a new page whose input query value is in first page. For example I choose to edit an order id  by selecting order id and then pressing Edit Record button then in new page selected order record should show. I am wor

  • Getting exit code 7 when trying to install elements 11

    Hi im just wondering why im getting this error when trying to install on my mac book? Exit Code: 7 -------------------------------------- Summary -------------------------------------- - 0 fatal error(s), 22 error(s), 2 warning(s) ----------- Payload