LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
LinkBack Search this Thread
Old 04-08-2009, 09:42 AM   #1
scooper
LQ Newbie
 
Registered: Apr 2009
Location: Austin
Distribution: Ubuntu 8.04
Posts: 5

Rep: Reputation: 0
How do I prevent a user from being able to log into ssh?


Hi - I am running Solaris 10 and I need to create/modify a users account so they cannot log into the server directly with ssh. I do need to be able to su to their account once logged in with a different uname.

My goal is to run programs as this user.

I've found several posts that detail how to accomplish this for the root user but my searches on google, LQ and other sites have been fruitless.

I believe the term is non-interactive shell?

Any help is greatly appreciated.
Thanks!
 
Old 04-08-2009, 10:01 AM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 10,003

Rep: Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189Reputation: 1189
Quote:
Originally Posted by scooper View Post
Hi - I am running Solaris 10 and I need to create/modify a users account so they cannot log into the server directly with ssh. I do need to be able to su to their account once logged in with a different uname.

My goal is to run programs as this user.

I've found several posts that detail how to accomplish this for the root user but my searches on google, LQ and other sites have been fruitless.

I believe the term is non-interactive shell?

Any help is greatly appreciated.
Thanks!
You CAN do a non-interactive shell, but it's easier to use the DenyUsers directive, in the sshd_config, as so:

Code:
...<bulk of SSHD_config>
...
DenyUsers fred@*, joe@*, sally@*
AllowUsers scooper@*, mike@123.222.333.444
Restart SSHD. Fred, Joe, and Sally won't be able to log in over the network from ANY address. You will be able to log in from anywhere, but Mike will only be able to log in from 123.222.333.444. Check the man page for sshd_config for more options/details. Once you mess with the login shell, it causes you to have more 'fun' later, when you log in as YOU, then SU to another account...what happens then? That 'default' shell runs.......and you have to escape it, etc., to get something done....
 
Old 04-08-2009, 10:47 AM   #3
scooper
LQ Newbie
 
Registered: Apr 2009
Location: Austin
Distribution: Ubuntu 8.04
Posts: 5

Original Poster
Rep: Reputation: 0
I figured it out

When I created the users I did two things - one I gave them a blank password - which is denied by sshd, next I added DenyUsers [username] in the sshd_conf file and restarted ssh.
 
Old 04-08-2009, 10:50 AM   #4
scooper
LQ Newbie
 
Registered: Apr 2009
Location: Austin
Distribution: Ubuntu 8.04
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks TBone - you make a good point. I don't like that kind of "fun"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I prevent SSH tunnels through my squid proxy? drokmed Linux - Security 11 06-12-2008 08:07 PM
Prevent ssh to other machines cizzi Linux - Security 16 01-07-2008 07:29 PM
How to prevent root user from logging into ssh linuxjamil Linux - Server 2 10-08-2007 06:10 PM
How to prevent local IP's in apache log? esaym Linux - Server 2 02-17-2007 10:53 PM
Prevent Root access with SSH rshooper Linux - Security 4 11-18-2004 01:05 PM


All times are GMT -5. The time now is 08:07 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration