Disable telnet for a particular user


 
Thread Tools Search this Thread
Operating Systems Solaris Disable telnet for a particular user
# 1  
Old 06-01-2010
Disable telnet for a particular user

On Solaris 8 is there anyway to disable telnet for a particular user and not for entire system altogether?

I would like the user to retain a shell and so creating a noshell like ftp account is not an option.
# 2  
Old 06-02-2010
Make the default shell be /usr/bin/false. The /etc/passwd entry would look something like

Code:
user2:x:1234:4321:no telnet:/home/user2:/usr/bin/false

Also you can add the users entry in /etc/hosts.deny file to block the user.
# 3  
Old 06-02-2010
Like I said, the user needs to retain a shell. Setting it to "false" doesnt serve my purpose.

I am curious what hosts.deny is, can you send me code for that file to disable a user?
# 4  
Old 06-02-2010
Check this: Sun: Solaris - hosts.deny and hosts.allow and/or man hosts.deny
# 5  
Old 06-02-2010
I will investigate hosts.deny but it looks like it controls settings for hosts/IPs connecting to the server and not user accounts already on the system.
# 6  
Old 06-02-2010
Aaa yeah, you're right mate, sorry, I've missed that...

---------- Post updated at 15:25 ---------- Previous update was at 15:00 ----------

This is one way you could do it, though I'm sure it's not the best:
Run script which will monitor established connections from specific user;
if a telnet connection from that user is found, kill that process id.

On FreeBSD I can find the appropriate pid using following command:
Code:
$ sockstat | grep ^user-to-find | grep telnet
user-to-find  telnet     2107  3  tcp4   sourceip:sport    targetip:23
$ kill 2107

Code:
     sockstat -- list open sockets

Now you just need to find a proper sockstat alternative command for Solaris.
# 7  
Old 06-02-2010
try in hosts.deny
Code:
in.telnetd : forbiddenuser@hostIP

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Not able to disable finger & telnet command in Solaris 8

Hi I need to disable finger & telnet command in solaris 8 I have put the # infront of finger and telnet line in /etc/inetd.conf file. Further I have run the below command kill -1 <process id of inetd > But when I am running finger command it is till giving information for remote machine... (8 Replies)
Discussion started by: amity
8 Replies

2. Solaris

Disable Inactive User in Solaris 11

Goal: To disable a Solaris user, after that user was inactive for X days. My understanding for linux was that there was no systematic way to disable inactive users, therefore we had to set a password expiration via /etc/default/passwd, MaxWeeks; then in /etc/default/useradd (/etc/shadow), the... (1 Reply)
Discussion started by: Drasavokian
1 Replies

3. AIX

Allow telnet in AIX from specific IP adds, but disable for everyone else

I need to change the security on our AIX servers and disable telnet from all but certain IP addresses. I have hashed the telnet line in /etc/inetd.conf and added filter rules for those IP adds to allow access on port 23, but this didn't work. Does anyone have any ideas? Thanks. (2 Replies)
Discussion started by: Alps
2 Replies

4. Solaris

SSH enable, Telnet disable ...

Hi... How do I enable SSH and disable telnet.. Also - is there anything special I need to do to ensure that a new user can use ssh and su but not telnet? Adel (15 Replies)
Discussion started by: ArabOracle.com
15 Replies

5. AIX

How to disable user login infor?

If user login and don't do anything in 15 mins, the user is kicked off from the server. how to disable it? (5 Replies)
Discussion started by: rainbow_bean
5 Replies

6. Solaris

disable telnet on the startup

Hi All, I want to disable telnet on the startup of solaris 8-10 but still wants for a standby purposes. In case I need to troubleshoot ssh, I can connect thru telnet. Most solution on the internet is to permanently removed it. Best Regards, itik (5 Replies)
Discussion started by: itik
5 Replies

7. Solaris

Disable telnet timeout

Hi, Can someone help me how I can disable telnet timeout? I'm connecting remotely to some machines and after some time my telnet connection was closed. How can I disable this so that I'm always connected to those machines? Thanks! (2 Replies)
Discussion started by: ayhanne
2 Replies

8. Solaris

disable telnet on Solaris

All - would you please some one help me to disable telnet on Solaris? /etc/inetd.conf Thanks :confused: (11 Replies)
Discussion started by: March_2007
11 Replies

9. HP-UX

Temporarily Disable User Account

I want to temporarily disable a user account on HP-UX at the start of a script and renable the account at the end of the script. What would be the best method on HP-UX to temporarily disable a user account? I know of the passwd -l option that will lock the account, but I do not see a flag for... (4 Replies)
Discussion started by: scotbuff
4 Replies

10. AIX

How to disable cd to other folder for a user

How to disable user for cd to some another folders other than his folders. AIX 5L 5.2 Thanks Dilip. (1 Reply)
Discussion started by: Dilippatel
1 Replies
Login or Register to Ask a Question