Page 3 of 3 FirstFirst 123
Results 21 to 29 of 29

Thread: SSH block commands

  1. #21
    Join Date
    Dec 2012
    Beans
    26

    Re: SSH block commands

    Quote Originally Posted by sandyd View Post
    I think this should work


    Code:
    sudo groupadd nosu
    sudo nano /etc/pam.d/su
    You see where it says
    Code:
    #auth required pam_wheel.so deny group=nosu
    remove the '#' so that it looks like
    Code:
    auth required pam_wheel.so deny group=nosu
    now for any user you don't want to allow to su...
    Code:
    sudo groupadd -a -G nosu username
    Never tried it, but you can chroot using a livecd if it screws up
    Sounds good I guess... How do I install pam_wheel?
    Sorry, I'm still extremely new to linux

  2. #22
    Join Date
    Apr 2011
    Location
    Maryland
    Beans
    1,461
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: SSH block commands

    There's nothing that you need to install. PAM is integrated into your system and already has several roles in the way it works with administering the system. All you need to do is to modify the file '/etc/pam.d/su' to make the changes that Sandy posted above.

  3. #23
    Join Date
    Dec 2012
    Beans
    26

    Re: SSH block commands

    Quote Originally Posted by drmrgd View Post
    There's nothing that you need to install. PAM is integrated into your system and already has several roles in the way it works with administering the system. All you need to do is to modify the file '/etc/pam.d/su' to make the changes that Sandy posted above.
    Alright thanks, I'll try this once I get home and keep you all posted.

  4. #24
    Join Date
    Apr 2011
    Location
    Maryland
    Beans
    1,461
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: SSH block commands

    Hope it works the way you want it to. Do be careful, though, and make sure that you're doing it correctly. Messing these kinds of things up could potentially lock your from your system, and you'll have a bit of work to clean it up after. You might read up on chrooting (something I know little about unfortunately) and doing what Sandy suggested as a trial before you commit.

  5. #25
    Join Date
    Dec 2012
    Beans
    26

    Re: SSH block commands

    Alright so I copied and pasted Sandy's above commands, replacing username with the user that I wanted to block and got -a option not recognized.

    groupadd: invalid option -- 'a'
    Usage: groupadd [options] GROUP

    Options:
    -f, --force exit successfully if the group already exists,
    and cancel -g if the GID is already used
    -g, --gid GID use GID for the new group
    -h, --help display this help message and exit
    -K, --key KEY=VALUE override /etc/login.defs defaults
    -o, --non-unique allow to create groups with duplicate
    (non-unique) GID
    -p, --password PASSWORD use this encrypted password for the new group
    -r, --system create a system account

  6. #26
    Join Date
    Dec 2012
    Beans
    26

    Re: SSH block commands

    Never mind I used:
    Code:
    sudo adduser username nosu
    and it worked. So it worked more perfectly then I imagined. If I use su it looks normal, still prompts for user password then sends permission denied even for the right password. If I logged into the user on the computer itself I can use the exit command to switch back to the previous user however, on ssh this closes the connection instead


    THANK YOU EVERYBODY THAT HELPED ME SO QUICKLY

  7. #27
    Join Date
    Apr 2011
    Location
    Maryland
    Beans
    1,461
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: SSH block commands

    Quote Originally Posted by bellygrevios View Post
    Never mind I used:
    Code:
    sudo adduser username nosu
    and it worked. So it worked more perfectly then I imagined. If I use su it looks normal, still prompts for user password then sends permission denied even for the right password. If I logged into the user on the computer itself I can use the exit command to switch back to the previous user however, on ssh this closes the connection instead


    THANK YOU EVERYBODY THAT HELPED ME SO QUICKLY
    Excellent! Very happy to hear this worked well for you!

  8. #28
    Join Date
    Nov 2008
    Location
    S.H.I.E.L.D. 6-1-6
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: SSH block commands

    Quote Originally Posted by bellygrevios View Post
    Never mind I used:
    Code:
    sudo adduser username nosu
    and it worked. So it worked more perfectly then I imagined. If I use su it looks normal, still prompts for user password then sends permission denied even for the right password. If I logged into the user on the computer itself I can use the exit command to switch back to the previous user however, on ssh this closes the connection instead


    THANK YOU EVERYBODY THAT HELPED ME SO QUICKLY
    fixed
    typo on my part
    Don't waste your energy trying to change opinions ... Do your thing, and don't care if they like it.

  9. #29
    Join Date
    Dec 2012
    Beans
    26

    Re: SSH block commands

    Once again, another thanks to everyone that helped me so quickly. This forum has by far the best support that I have ever seen and as I gain more experience I plan on contributing a bit more. But for now if anyone could suggest a good DLNA server that'd be great.

Page 3 of 3 FirstFirst 123

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •