possible to lock accounts (passwd -l) and still allow acct to ssh to other server?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users possible to lock accounts (passwd -l) and still allow acct to ssh to other server?
# 1  
Old 10-30-2008
possible to lock accounts (passwd -l) and still allow acct to ssh to other server?

My scenario is as follows:

We have a handful of batch accounts that run our production jobs. Our users are able to use sudo to become that account. Also, because of other reasons, the passwords are also listed in an encrypted file that each team can see their batch ID. So, I have some users that feel it is ok to su - $ID. Then, what happens is that they forget the password an lock out the account therefore causing production processing to stop. Our servers are HPUX, and my thought was that I could put an administrative lock on the accounts (passwd -l). That works and will prevent anybody from logging into via a new shell session or from a command prompt typing su - $ID. We are working towards a situation that will allow that the users not know the password...however they could still su - $ID 3 times and lock the acct out. My catch 22 is that these batch accounts need to ssh (using shared ssh keys) between servers. doing the admin lock prevents that. Any ideas?
# 2  
Old 10-31-2008
Have you ever taught about disabling the policy that locks the account after 3 failed login attamps using strong password instead. The situation you discribe is a kind of DOS Attack and you pay the price for slightly improved security with a major decline of availability.

I'm not shure what happen when U set the login shell of the involved accouts to /bin/false.
this will definetely prevent from logging in via su but background jobs should commonly be able run as expected.
# 3  
Old 10-31-2008
company policy has us lock out at 3 incorrect attempts. /bin/false would work except that these batch IDs also need to ssh between servers. each batch acct exists on 6 different servers. we are able to ssh, scp, etc. between them without any authentication. if I set the shell to /bin/false then ssh'ing to the other server will immediate end the session on the remote server.
# 4  
Old 10-31-2008
I dont know...
I usually use sudo for these account and give the permissions to users to su - batch account with no passwd.. and I am the only one who know them and when I forget I change them... Like that there is no fuss no one has the passwd except myself...
# 5  
Old 10-31-2008
since these accounts are for batches, there shouldnt be interactive shell, and so only users doing su - will read the .profile, I would take that opportunity to modify the .profile so it saves a .sh_history for each of the people that can su - while logging also date-time on connection and from where (tty or IP), because what is stopping the user to type passwd? (maybe not realizing in multi windoing he is in the wrong one...) and changing the passwd...
# 6  
Old 10-31-2008
Even though the accounts are not directly logging in, they still need to login and hence cannot be set to /bin/false or /bin/nologin.
The only thing I can think of is to have users execute batch files from some other system. The batch file connects to your prod servers using only SSH keys and do what ever they have to do.
That way users don't have to 'su' on your Production and accidentally lock up the accounts.
Use SSH keys. You can even restrict IP or hostname access with these keys.

P.S. I would tell users to stop 'su' if they are not sure about the password first time... Smilie

HTH,
Nitin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ssh passwd less, shell script

Hi All, Wishes!! I need some help to prepare a script to copy the public key from admin host to multiple client hosts to make them login without password. Detailed : I have an admin host "admin1" and i generated sshkeygen, now i have id_rsa.pub and i have around 50 client hosts. i... (4 Replies)
Discussion started by: kumar85shiv
4 Replies

2. UNIX and Linux Applications

Logging to server to get etc/passwd file of all 300 server

i am new to scripting ,i need bash script in jump server to pull the /etc/passwd of all servers and the ssh keys are installed (3 Replies)
Discussion started by: profiles
3 Replies

3. UNIX for Dummies Questions & Answers

Extract user accounts and home directory from /etc/passwd.

I am trying to obtain all user accounts and their respective home directories. /etc/passwd contains the required information, but I want to filter it to only show the uid,username and home directory path. I am working on a Solaris 11 machine. I made a little headway so far, but I got stuck... (7 Replies)
Discussion started by: Hijanoqu
7 Replies

4. Red Hat

SSH lock users to the Home Directory

Hi friends, I must to give ssh connection to own customer. So I want to lock ssh user on own home directory. It is not necessery to reach other folders. I know that ftp user can lock on own folder but I don't know how to lock ssh user. I am waitting your kindly helps :D ---------- Post... (10 Replies)
Discussion started by: getrue
10 Replies

5. Cybersecurity

openssh_4.6 on Unixware 7.1.4 - ssh does not lock account after x attempts

Hi all, I am having some issues with openssh vers OpenSSH_4.6p1 on SCO unixware 7.1.4 when a user accesses the system via ssh and the password is incorrect and more attempts have been made that the lock out limit I find that although there are messages in the syslog the account does not lock... (0 Replies)
Discussion started by: chlawren
0 Replies

6. Solaris

Change passwd for bulk servers using SSH script

Hi, I need to Change passwd for bulk servers using SSH script. I have one server, from which i can reach all the servers without password via SSH. There is some expect script, from which i can achieve it. Can any one help me out here. Thanks in advance. Vicky (1 Reply)
Discussion started by: vickyingle5
1 Replies

7. Solaris

Solaris 10 allow ssh login with empty passwd

I have turned off PermitEmptyPasswords in sshd_config, but a user with empty passwd (deleted by passwd -d user) can still login without password, why? it is big security concern, linux doesn't have the issue. $ uname -a SunOS 5.10 Generic_118855-14 i86pc i386 i86pc ... (8 Replies)
Discussion started by: honglus
8 Replies

8. UNIX for Advanced & Expert Users

How do you manage your DMZ server accounts?

I'd just like to know what you use for user account management on your DMZ servers? Do you use the same authentication realm as internally? Do you use a different authentication realm, perhaps only for the DMZ? Do you use local accounts? (2 Replies)
Discussion started by: humbletech99
2 Replies

9. UNIX for Dummies Questions & Answers

Passwd lock for 5days

Hi Admin, I need a help regarding to lock the user for 5 days.. for example i want to lock user account from Monday 1.00AM to Friday 1.00PM.. is there any method to do from Cron or passwd command. Regards, Prem :cool: (2 Replies)
Discussion started by: Prem
2 Replies

10. UNIX for Advanced & Expert Users

How to migrate user accounts to a new server

Hello All, I am a student sys admin and not a professional. I'd like to know how can I migrate the user accounts in the current server to a new server( to be installed) non-destructively. Also in what way the old server can be used after installation of the new server. I'd sincerely... (2 Replies)
Discussion started by: maybemedic
2 Replies
Login or Register to Ask a Question