LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-08-2018, 06:20 AM   #1
opnine
LQ Newbie
 
Registered: Mar 2009
Posts: 12

Rep: Reputation: 0
SSH - Multilogin


Hello,

I have 2 users
Temp1
Temp2

I want to configure that this user only has one ssh connection, example:
Temp1 is already connected and if someone tries to connect again with Temp1 it will be rejected.

Also I need to know how I can limit users Temp so they can just execute only a few commands.


Thanks.

Last edited by opnine; 03-08-2018 at 06:59 AM.
 
Old 03-08-2018, 06:38 AM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,665
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
Well, that's not necessarily a good thing to do. If sshd thinks that you still have a session going, but you don't, then this can lock you out of a remote machine. Very messy.
 
Old 03-08-2018, 08:06 AM   #3
opnine
LQ Newbie
 
Registered: Mar 2009
Posts: 12

Original Poster
Rep: Reputation: 0
hello
the ssh connection I just got it fixed, what im having issue is how to configure the users to only execute and restrict commands.

thansk.
 
Old 03-08-2018, 11:51 AM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,314
Blog Entries: 3

Rep: Reputation: 3723Reputation: 3723Reputation: 3723Reputation: 3723Reputation: 3723Reputation: 3723Reputation: 3723Reputation: 3723Reputation: 3723Reputation: 3723Reputation: 3723
As you've probably seen, to limit SSH login to specific users, put them in a group and then set AllowGroups in sshd_config accordingly.

If you want to limit which programs an account can use while logged, that is much harder and you must turn to rbash or rksh. That's just the first step.

The second step is to make a read-only directory, say /usr/local/rbin, and populate it with links (symbolic or hardlinks) to only the programs that the restricted account would be allowed to, and needs to, run.

The next step is to set $PATH for the restricted user and remove the ability to write to the home directory and .basrc and .profile especially. The other files and directories can be writeable but it is essential that the restricted account be unable to modify $PATH. If it is too undesirable to limit the home directory permissions, then you'll have to modify /etc/profile, /etc/profile.d/*, and /etc/bash.bashrc instead. That might be trickier unless you are familiar with shell scripting.

It's doable but just be sure to test a bit.
 
Old 03-08-2018, 12:05 PM   #5
opnine
LQ Newbie
 
Registered: Mar 2009
Posts: 12

Original Poster
Rep: Reputation: 0
thanks all for the help but still need to understand how.

Last edited by opnine; 03-08-2018 at 12:59 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
The difference in settings: console from desktop & ssh as DISPLAY not set when ssh in wikapuki Linux - Newbie 10 07-02-2010 09:44 AM
ssh-agent, ssh-add and ssh-keygen AND CVS raylpc Linux - General 2 11-19-2008 02:50 AM
setting up an ssh soxy or local ssh tunnel from within an ssh soxy Mangenius Linux - Networking 0 03-05-2007 03:15 PM
Passwordless SSH with SSH commercial server and open ssh cereal83 Linux - General 7 04-18-2006 12:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration