Sponsored Content
Top Forums Shell Programming and Scripting Bash Login tester Script help! Post 302492766 by Corona688 on Tuesday 1st of February 2011 11:47:03 AM
Old 02-01-2011
Quote:
Originally Posted by RSPdev
So I am trying to write a script that allows me to use the "login" command in the terminal
Code:
function login
{
        local USERNAME
        local PASS
        read -p "username: " USERNAME
        read -p "last 3 digits of pass: " PASS
        for COMBO in {0..9}{0..9}
        do
                echo "trying ${COMBO}${PASS}"
        done
}

# You can now use the 'login' function like a command
$ login
username:

You may also like the advanced bash scripting guide.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

bash script for ssh login-

hi. I need a bash script which can login to an other mashin via SSH and then run some commands and then return the result to my mashine. I dont know where to begin, I think first I will need a ssh connection, dont know how to make it, then , do I need a ftp connection between the 2 mashins to... (5 Replies)
Discussion started by: big_pil
5 Replies

2. Shell Programming and Scripting

bash ssh login script

hello anyone have done ssh login script without "expect" (automatic login from host A / user b to Host B / user b without enter any passwords)? cheers (2 Replies)
Discussion started by: modcan
2 Replies

3. Shell Programming and Scripting

BASH ssh login

Ok, there's been a good number of posts about this, but here goes. I want a script to log in to a system via ssh without using keys. This will be used to log in to Cisco IOS devices. I have tried the following, but could not get it to work: SSH login expect shell script to supply username and... (1 Reply)
Discussion started by: mike909
1 Replies

4. HP-UX

begining to feel like a beta tester for emc :(

recently migrated from 5.2 to 6.1 EMC control center. proceeded to upgrade the master/host agents in our hp server env....when I encountered the following issues: # ipcs -mop IPC status from /dev/kmem as of Thu Jul 9 08:47:27 2009 T ID KEY MODE OWNER GROUP NATTCH CPID LPID Shared Memory:... (1 Reply)
Discussion started by: mr_manny
1 Replies

5. Shell Programming and Scripting

Help with Unix bash shell script login

Hi, I am a complete Unix novice and need some help with creating a login shell script. I have created a file with user details i.e. PIN, name etc and require help in recalling the specified details from the file and being prompted for a password on login. Any help would be very much appreciated.... (0 Replies)
Discussion started by: tdsrogers
0 Replies

6. Shell Programming and Scripting

login audit bash script

I am a bash beginner and I need to write an script to check my users login time. This has to be in a format of : This script has to work on a server to check all the users. I know that I have to use "last" command but I have no idea how to do it. any assistance is appreciated. Thanks (17 Replies)
Discussion started by: bashily
17 Replies

7. Shell Programming and Scripting

Proxy socks tester issue

I have a list of ip socks / port(eg: 192.168.0.1 80). I would like to write a bash to test automatically these addresses in a loop with firefox. The problem is that firefox process stays alive even when firefox does not work because of wrong network settings. So I want to kill the process when the... (3 Replies)
Discussion started by: arpagon
3 Replies

8. Shell Programming and Scripting

Simple proxy tester

This is a simple script to verify a proxy type8code0@core:~$ cat proxy-tester echo -e "\nTest proxy 10.10.10.10:80" curl echoip.net --proxy 10.10.10.10:80 echo -e "\n\nTest proxy 10.10.10.11:80" curl echoip.net --proxy 10.10.10.11:80 echo -e "\n\nTest proxy 10.10.10.13:80" curl echoip.net... (3 Replies)
Discussion started by: type8code0
3 Replies

9. Shell Programming and Scripting

Automate OTPW login to ssh via bash script

Hello everyone. I'm a Linux novice trying out a lot of bash scripting lately, as it is so very addictive. Lately I have been setting up one of my boxes remotely and have been hardening it as much as possible. Please allow me to explain the scenario, as it does tend to become a little... (1 Reply)
Discussion started by: instro
1 Replies

10. Shell Programming and Scripting

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies
finger(1)							   User Commands							 finger(1)

NAME
finger - display information about local and remote users SYNOPSIS
finger [-bfhilmpqsw] [username...] finger [-l] [ username@hostname 1 [ @hostname 2 .. .@hostname n...]] finger [-l] [ @hostname 1 [ @hostname 2 .. .@hostname n...]] DESCRIPTION
By default, the finger command displays in multi-column format the following information about each logged-in user: o user name o user's full name o terminal name (prepended with a `*' (asterisk) if write-permission is denied) o idle time o login time o host name, if logged in remotely Idle time is in minutes if it is a single integer, in hours and minutes if a `:' (colon) is present, or in days and hours if a `d' is present. When one or more username arguments are given, more detailed information is given for each username specified, whether they are logged in or not. username must be that of a local user, and may be a first or last name, or an account name. Information is presented in multi-line format as follows: o the user name and the user's full name o the user's home directory and login shell o time the user logged in if currently logged in, or the time the user last logged in; and the terminal or host from which the user logged in o last time the user received mail, and the last time the user read mail o the first line of the $HOME/.project file, if it exists o the contents of the $HOME/.plan file, if it exists Note: when the comment (GECOS) field in /etc/passwd includes a comma, finger does not display the information following the comma. If the arguments username@hostname1[@hostname2...@hostnamen] or @hostname1[@hostname2...@hostnamen] are used, the request is sent first to hostnamen and forwarded through each hostnamen-1 to hostname1. The program uses the finger user information protocol (see RFC 1288) to query that remote host for information about the named user (if username is specified), or about each logged-in user. The information dis- played is server dependent. As required by RFC 1288, finger passes only printable, 7-bit ASCII data. This behavior may be modified by a system administrator by using the PASS option in /etc/default/finger. Specifying PASS=low allows all characters less than decimal 32 ASCII. Specifying PASS=high allows all characters greater than decimal 126 ASCII. PASS=low,high or PASS=high,low allows both characters less than 32 and greater than 126 to pass through. OPTIONS
The following options are supported, except that the username@hostname form supports only the -l option: -b Suppresses printing the user's home directory and shell in a long format printout. -f Suppresses printing the header that is normally printed in a non-long format printout. -h Suppresses printing of the .project file in a long format printout. -i Forces "idle" output format, which is similar to short format except that only the login name, terminal, login time, and idle time are printed. -l Forces long output format. -m Matches arguments only on user name (not first or last name). -p Suppresses printing of the .plan file in a long format printout. -q Forces quick output format, which is similar to short format except that only the login name, terminal, and login time are printed. -s Forces short output format. -w Suppresses printing the full name in a short format printout. FILES
$HOME/.plan user's plan $HOME/.project user's projects /etc/default/finger finger options file /etc/passwd password file /var/adm/lastlog time of last login /var/adm/utmpx accounting ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWrcmds | +-----------------------------+-----------------------------+ SEE ALSO
passwd(1), who(1), whois(1), passwd(4), attributes(5) Zimmerman, D., The Finger User Information Protocol, RFC 1288, Center for Discrete Mathematics and Theoretical Computer Science (DIMACS), Rutgers University, December 1991. NOTES
The finger user information protocol limits the options that may be used with the remote form of this command. SunOS 5.10 6 Nov 2000 finger(1)
All times are GMT -4. The time now is 11:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy