How to enforce login as specific user in Solaris


 
Thread Tools Search this Thread
Operating Systems Solaris How to enforce login as specific user in Solaris
# 1  
Old 05-26-2009
How to enforce login as specific user in Solaris

Hi,

I need to implement something that will enforce login to a Solaris server as a particular, specifed user. After this login stage, users will be able to "su -" to whichever user they wish, by which time their activity will be captured by some sort of script (yet to be written). What I need to know is: how do I make the SSH or telnet sessions enforce login by a single, specified user rather than permitting login by any user?

Any help greatly appreciated.

James Geoghegan
# 2  
Old 05-26-2009
add

AllowUsers username1

or

AllowUsers username1 username2

to /etc/ssh/sshd_config

then restart ssh

man sshd_config for details
# 3  
Old 05-26-2009
Many thanks, funksen. I assume that sshd_config is for SSH only and not for telnet? Any ideas on telnet?

Thanks again,

James Geoghegan
# 4  
Old 05-26-2009
Why don't you change /etc/profile (and /etc/.login if a CSH variant is used) to check for a list of usernames and log you out if you're not one of them?
# 5  
Old 05-26-2009
Thanks, Cambridge; interesting idea - but I wouldn't know how would I log users out if they weren't desirable?

James
# 6  
Old 05-26-2009
In /etc/profile:

Code:
if [ "$LOGNAME" = invader ]; then
    echo You are not allowed to login to this host
    exit
fi

In /etc/.login:

Code:
if ("$LOGNAME" == "invader") then
    echo You are not allowed to login to this host
    logout
endif

# 7  
Old 05-26-2009
Thanks again, Cambridge. I'll use this.

James
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to enforce user to Enter text when login to a UNIX / Linux system?

Hi. I inject my tracklogin.sh script in the profile of each user. $ more .profile ./tracklogin.sh # This is the default standard profile provided to a user. MAIL=/usr/mail/${LOGNAME:?} bash-3.2$ more tracklogin.sh #!/bin/bash tdate=$(date +"%d%m%y") mkdir -p /tmp/root_log... (20 Replies)
Discussion started by: mohtashims
20 Replies

2. Solaris

Solaris 11 user account login expired

Hi everyone Please i need urgent help... I have installed solaris 11 using live media.. then i installed sunray.. every thing is fine.. but after system reboot i am unable to login on server on GUI it gives account expired error or some time authentication failed... but i can log in through... (11 Replies)
Discussion started by: amk
11 Replies

3. Solaris

HOW to set unlimited login attempts for user in Solaris?

Hi Admins, HOW to set unlimited login attempts for user in Solaris ? And do I need to insatll any packages before doing this? Thanks. (1 Reply)
Discussion started by: manalisharmabe
1 Replies

4. UNIX for Advanced & Expert Users

How to allow Solaris OS user to telnet to specific IP?

Dear All, I need help on allow/disallow OS user to telnet to specific IP address from client side? I have one Solaris 10 machine, I will permit OS user to telnet to specific IP address. (5 Replies)
Discussion started by: mamun_bu
5 Replies

5. Solaris

How to restrict user to a specific directory in solaris 10

Hi all, I want to create a new user and grant him ONLY transfer files access to a specific directory where he can only upload and read the files. He should be restricted to this activity only. Regards (6 Replies)
Discussion started by: gilldn
6 Replies

6. Solaris

How to Restrict user login after certain time in Solaris??

My OS is Solaris 10, I would like to know if there is any way to restrict user login to the system (either remote or console login) after certain time, say 20:00 on Mon to Fri and whole day on SAT and SUN??? Sorry that I am a new user on Unix System. Any comment is fully appreciated!!! Alex (7 Replies)
Discussion started by: alessandro31
7 Replies

7. Solaris

error message rmclomv ... SC Login Failure for user Please login:

Hello World ~ HW : SUN Fire V240 OS : Solaris 8 Error message prompts 'rmclomv ... SC login failure ...' on terminal. and Error Message prompts continually 'SC Login Failure for user Please login:' on Single Mode(init S) The System is in normal operation, though In case of rain, Can... (1 Reply)
Discussion started by: lifegeek
1 Replies

8. Solaris

create user with RWX access to a specific directory in Solaris 10

I need to create a user account for a developer that will allow him rwx access to all resources in a directory. How can I do that? Thanks (5 Replies)
Discussion started by: gsander
5 Replies

9. Shell Programming and Scripting

Script to login to attached SUN Storage through Solaris m/c w/o user intervention

I want to create a shell script to CLI login to attached SUN 6140 storage from Sun Solaris 9 m/c (instead of using CAM ) but that prompts me for password despite the fact that i am adding them in script .. i am using "expect" feature for this .. however as i never used "expect " before .. so... (0 Replies)
Discussion started by: yogesh29sharma
0 Replies

10. Solaris

give user permission on specific directory in solaris

dear all does any one give any user write permission using access control list or another way to solve this problem (1 Reply)
Discussion started by: murad.jaber
1 Replies
Login or Register to Ask a Question