Announcement

Collapse
No announcement yet.

shh/sft into a specific directiory at log in

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    shh/sft into a specific directiory at log in

    im going to be givong my parents access to my media server via sftp.

    if i create a new user on the server and use
    Code:
    usermod -d /newhome username
    to change the user's home dir to the media dir would it be ok as the user wont be doing anything apart from accessing the media files.

    Sent from my WAS-LX1A using Tapatalk
    Tutorials:
    Yoda's ownCloud Installation on Kubuntu 20.04

    #2
    can anyone advise me on this?

    Sent from my WAS-LX1A using Tapatalk
    Tutorials:
    Yoda's ownCloud Installation on Kubuntu 20.04

    Comment


      #3
      shh/sft into a specific directiory at log in

      I don’t know how skilled you are with the Linux CLI. If you are not an expert I’d advise you to use the add user GUI in System-Settings instead, if your server is not headless. If you are reasonably good then ignore the rest.


      The /media directory is usually a mount point for CDROMs and occasionally For HDs. You shouldn’t attempt to make a home account out of it.

      After creating their user account and installing a suitable media player (VLC is my favorite but there are many other fine players) they can insert a CD into the CDROM and an option will pop up to offer to play the CD automatically.

      If you created a directory in their account to store MP3’s & MP4’s and populated it, then they can use VLC, or any other player like a browser to play individual selections or set up a list to loop through.
      Last edited by GreyGeek; Apr 19, 2018, 08:50 AM.
      "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
      – John F. Kennedy, February 26, 1962.

      Comment


        #4
        Originally posted by GreyGeek View Post
        I don’t know how skilled you are with the Linux CLI. If you are not an expert I’d advise you to use the add user GUI in System-Settings instead, if your server is not headless. If you are reasonably good then ignore the rest.

        The /media directory is usually a mount point for CDROMs and occasionally For HDs. You shouldn’t attempt to make a home account out of it.

        After creating their user account and installing a suitable media player (VLC is my favorite but there are many other fine players) they can insert a CD into the CDROM and an option will pop up to offer to play the CD automatically.

        If you created a directory in their account to store MP3’s & MP4’s and populated it, then they can use VLC, or any other player like a browser to play individual selections or set up a list to loop through.
        sorry pal my bad i should have said.

        if u use the usermod command and set the users home dir from/home/user to /share where the media files are stored

        e.g usermod -d /share username

        Sent from my WAS-LX1A using Tapatalk
        Tutorials:
        Yoda's ownCloud Installation on Kubuntu 20.04

        Comment


          #5
          Personally I wouldn’t change the home directory, I’d link the /share directory into their home account. In ~/.bashrc or ~/.profile I’d add a line which cd’s into the linked share
          cd /home/acctname/share
          Or, write a Bash script with that line and have it set to execute at KDE login. That option is (was?) on the same dialog page that lets you set an automatic login that avoids the login page
          "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
          – John F. Kennedy, February 26, 1962.

          Comment


            #6
            what's the difference between /.bashrc and /.profile?

            Sent from my WAS-LX1A using Tapatalk
            Tutorials:
            Yoda's ownCloud Installation on Kubuntu 20.04

            Comment


              #7
              Originally posted by GreyGeek View Post
              Personally I wouldn’t change the home directory, I’d link the /share directory into their home account. In ~/.bashrc or ~/.profile I’d add a line which cd’s into the linked share
              cd /home/acctname/share
              Or, write a Bash script with that line and have it set to execute at KDE login. That option is (was?) on the same dialog page that lets you set an automatic login that avoids the login page
              how do i link to the dir, i know i have to edit the .baahrc or . profile file but what do i put into it and which one do I edit

              Sent from my WAS-LX1A using Tapatalk
              Tutorials:
              Yoda's ownCloud Installation on Kubuntu 20.04

              Comment


                #8
                As more and more info leaks out about what you want to do, I am assuming that you created the /share directory, since it does not exist in Ubuntu or its derivatives. So, why not just create that directory under your home account and not bother with a soft link?

                Inside your home account just issue
                mkdir share
                It will be a directory just like "Downloads" or "Documents" or "pictures"..

                If you don't want your parents accidentally deleting files in THAT directory remove the write permission for it so that only you, when you temporarily restore the write permission, can add or remove audio and video files. That way, they can play the files but cannot delete them. Just right click on the directory in the directory panel of Dolphin and chose "Properties". On the "Permissions" tab select owner and the option to just read files. Then click "OK" at the bottom of the dialog.
                "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                – John F. Kennedy, February 26, 1962.

                Comment


                  #9
                  Originally posted by GreyGeek View Post
                  As more and more info leaks out about what you want to do, I am assuming that you created the /share directory, since it does not exist in Ubuntu or its derivatives. So, why not just create that directory under your home account and not bother with a soft link?

                  Inside your home account just issue
                  mkdir share
                  It will be a directory just like "Downloads" or "Documents" or "pictures"..

                  If you don't want your parents accidentally deleting files in THAT directory remove the write permission for it so that only you, when you temporarily restore the write permission, can add or remove audio and video files. That way, they can play the files but cannot delete them. Just right click on the directory in the directory panel of Dolphin and chose "Properties". On the "Permissions" tab select owner and the option to just read files. Then click "OK" at the bottom of the dialog.
                  basically that wouldn't help as i dont want to share my home dir as ive created the /share dir and it is in use how do i link to the /share dir in by editing the .baahrc or . profile file but what do i put into it and which one do I edit

                  Sent from my WAS-LX1A using Tapatalk
                  Tutorials:
                  Yoda's ownCloud Installation on Kubuntu 20.04

                  Comment


                    #10
                    Ok. Try this. If kuser is not installed then install it. It is a graphical front end to the user commands.
                    It will be installed in the System menu.
                    Open it and select the "User" tab. Then click the "Add" using the single person icon at the left end of the icon menu bar. You'll get a dialog that looks like this:

                    Click image for larger version

Name:	kuser_example.jpg
Views:	1
Size:	66.6 KB
ID:	643835

                    From there you can set the home folder (/share) , check the "copy skeleton" (basic home account files), select the login shell ( /bin/bash), uncheck the "Account disabled", and add privileges from the groups tab, etc..
                    If things get messed up you can use that dialog to delete the account and start over.
                    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                    – John F. Kennedy, February 26, 1962.

                    Comment

                    Working...
                    X