Sponsored Content
Top Forums Shell Programming and Scripting Check whether user has passwordless setup Post 302695517 by ryandegreat25 on Monday 3rd of September 2012 05:09:28 AM
Old 09-03-2012
Check whether user has passwordless setup

Hello Unix scripters,

I have created a small tool that i can distribute to users to check whether they have passwordless login to a list of servers.

The problem in my code below is if user do not have the passwordless login yet, it will prompt them with a password login and my message below will never be displayed. Users then will either enter their password or just control-c which i dont want

Am i tackling the right logic and code here?

Code:
                echo "Logging in as \"${SERVERS_ID}\" to $SERVER"
                ssh  ${SERVERS_ID}@${SERVER} "exit"
                if [ "$?" -ne 0 ] ; then
                        echo "Couldn't connect to server, please verify whether server is up or your ssh passwordless login to \"${SERVERS_ID}\" is setup properly."
                else
                        echo "CONNECTED"
                fi


Last edited by ryandegreat25; 09-03-2012 at 06:16 AM..
 

10 More Discussions You Might Find Interesting

1. Solaris

user setup - only ftp access

I want to setup a user on my server and only allow that user to ftp to my server but not to be able to get to command line (telnet /ssh) I ammended my /etc/passwd so the users shell would be /usr/bin/false and this prevents log on but it also prevents the ftp.. Any ideas? (1 Reply)
Discussion started by: frustrated1
1 Replies

2. UNIX for Dummies Questions & Answers

setup of user a/c in mysql in linux

Hi Friends, I am new user of linux operating system. I wanted to install a software but facing a difficulty. I am not able to proceed to the next statement without resolving this. WFT is the software i need for my purpose. Setup a MySQL user account for WTF that will have access to ... (1 Reply)
Discussion started by: alma
1 Replies

3. Shell Programming and Scripting

How ti check if passwordless ssh is enabled between two systems

I am writing a script which will execute commands on remote host only if they have a passwordless ssh setup. How do i check for that in my script (5 Replies)
Discussion started by: vickylife
5 Replies

4. Shell Programming and Scripting

Setup multiple passwordless authentication

I have experience in setting up passwordless authentication by sharing ssh public keys manually.Currently I am in the process to the write a script to perform the same functionality from one source(host) to multiple destinations. I have one source host (Host A) whose public keys has to be shared... (9 Replies)
Discussion started by: Lancel0t
9 Replies

5. AIX

passwordless ssh for non-root user???

hi all I have a problem to set up the password ssh login for a non-root user. what I want to do is that non-root user in host A logs into host B without password prompted. what I did listed as the following steps. 1. genarate a pair of keys from host A. ssy-keygen -t rsa -N "" -f... (9 Replies)
Discussion started by: rs6000er
9 Replies

6. Shell Programming and Scripting

su -m <user> passwordless?

Hi! I am working on mac osx and have a script which prompts for password for a non-root user, can I avoid that? su -m <user> Prompts for a password. Its a startup script and the start up fails? How can I fix this? Thanks, Jack. (4 Replies)
Discussion started by: jacki
4 Replies

7. Shell Programming and Scripting

Script to check if host key authentication is setup

Hey all, I have a script that I use for some automated installs. Unfortunately for the script to work the server that it's running from needs to have host-key authentication setup to the target server. If it isn't setup beforehand and the script is executed the install partially completes and... (1 Reply)
Discussion started by: Rike255
1 Replies

8. AIX

passwordless entry using ssh from one user to a different user on the same server

Hi, We have a requirement to do passwordless entry from one user to a different user on the same AIX server using ssh keys. Can some one help me with this? Thanks in advance, Panditt (3 Replies)
Discussion started by: deshaipet
3 Replies

9. Shell Programming and Scripting

Passwordless sftp using a different user than the runtime user

I am running a shell script as user A. In that script I need to execute a sftp that would transfer the file using another user B. I am using the below command: sftp -oPort22 B@remote server However, I am getting password prompts each time. I have done the following: Added the public... (4 Replies)
Discussion started by: mady135
4 Replies

10. UNIX for Advanced & Expert Users

Passwordless ssh for different user

Hello Folks, I lost touch in ssh key gen topics. I am in need of ssh to a server without password, kindly help me in configuring. I have two servers, server1 with user name apha & server1 with user name beta. I need to ssh to the server2 from server1 with respective users, Manually i... (3 Replies)
Discussion started by: Thala
3 Replies
NWUSERLIST(1)							    nwuserlist							     NWUSERLIST(1)

NAME
nwuserlist - List Users logged in at a NetWare server SYNOPSIS
nwuserlist [ -h ] [ -S server ] [ -U user name ] [ -P password | -n ] [ -C ] [ -a ] [ -q ] [ -f [ -d ] [ -D ] [ -t ]] DESCRIPTION
nwuserlist lists the users logged in at a NetWare server, together with their connection number and their login time. nwuserlist looks up the file $HOME/.nwclient to find a file server, a user name and possibly a password. See nwclient(5) for more informa- tion. Please note that the access permissions of $HOME/.nwclient MUST be 600 for security reasons. OPTIONS
-h -h is used to print out a short help text. -S server server is the name of the server you want to use. -U user user is the user name to use for login. -P password password is the password to use for login. If neither -n nor -P are given, and the user has no open connection to the server, nwuserlist prompts for a password. -n -n should be given if no password is required for the login. -C By default, passwords are converted to uppercase before they are sent to the server, because most servers require this. You can turn off this conversion by -C. -a With option -a the IPX address of the station the user is logged in from is printed as well. -q With option -q object ID is printed in addition to user name. -f List also files opened by each connection. -d List detailed informations about each file. -D List DOS filename instead of filename which was used for opening. -t Show raw hexadecimal values in addition to human readable conversions. AUTHORS
nwuserlist was written by Volker Lendecke. See the Changes file of ncpfs for other contributors. nwuserlist 7/22/1996 NWUSERLIST(1)
All times are GMT -4. The time now is 10:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy