Use of sudoer with ssh login shell script (KSH)


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Use of sudoer with ssh login shell script (KSH)
# 1  
Old 07-01-2007
Use of sudoer with ssh login shell script (KSH)

Greetings all,

I'm in the midst of writing a login component for a series of shell scripts. What my login script does is this:

1. Prompt for username and read in username
2. Prompt for destination host and read in destination host
3. run ssh username and destination host
4. After user keys in password and verification is complete, the login script checks his username against a file and looks up his level of access rights (indicated by a number). The script then launches either a.sh (for superusers) or b.sh (for standard users) depending on his access rights.

I'm just wondering whether I can make use of the sudoers file to achieve step 4 instead of keeping an extra file on the system to store user priority records since it would appear that both files serve a similar function.

If it is possible to make use of the sudoer file to determine a given user's access rights and launch him/her into one of the shell scripts accordingly, how can this be achieved?

Thanks in advance Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to have local shell variables in a ksh script seen on remove server in SSH block?

I have googled this and found many solutions, but none of them are working for me. I am in a korn shell, most others reference bsh, maybe that is the issue? Anyway, all I am trying to do is use a variable I have declared in my main script in a remote shell I am running through ssh. So I have a... (8 Replies)
Discussion started by: DJR
8 Replies

2. Shell Programming and Scripting

Script as login shell (passing args to login shell)

Hello all, for security reasons my compagny imposes that my script be launch remotly via ssh under the users login shell. So serverA launches the ssh command to serverB which has a local user with my script as a login shell. Local script works like a charm on his own. serverB$ grep... (20 Replies)
Discussion started by: maverick72
20 Replies

3. Shell Programming and Scripting

issue on ssh command in ksh shell

Hi guru, I'm making crazy cause an issue on a ksh shell I made. In this shell I want to execute unix command on a remote machine using an ssh connection like ssh user@host 'command'..... The command is very simply, is an ls on a remote directory but it give me an unexpected result. The... (4 Replies)
Discussion started by: leobdj
4 Replies

4. Red Hat

ssh login using script

Hello All, I am trying to login on server using ssh script & expect.Login to server successful but after login when i hit enter it gets hanged & when pressing CTRL +C it logs me out from the server. Scripts are as below. #!/bin/bash FILE=login.txt CONNECT=sshlogin.exp SERVERNAME=$1... (2 Replies)
Discussion started by: ajaincv
2 Replies

5. Shell Programming and Scripting

Help with Backup Shell Script 'ksh + awk over ssh'

Hi newbeeeee alarm i want to send a little script over ssh this script mus download a report.tar then rename and move. the report name format is report_<host.with.dot>-10-09-20-11:55:25.tar function remote_cmd_mv { _host=$1 ARCHROOTDIR='/tmp' ... (8 Replies)
Discussion started by: TigerGoods
8 Replies

6. Shell Programming and Scripting

SSH - Passing Unix login passwords through shell scripts

Hi All , I need to call a script runscript_B.sh on server A, the runscript_B.sh script locating in server B. The runscript_B.sh in calls another script runscript_A on server A itself. it seend, i need to be connect from Server A to Server B using ssh. I have tryed like this in... (3 Replies)
Discussion started by: koti_rama
3 Replies

7. Shell Programming and Scripting

ksh script as a login shell return "no controlling terminal"

I have created a ksh shell script and used it as a login shell for a user. </etc/passwd> lramirev:x:111:200:Luis:/export/home/menush:/usr/local/menush/menush My shell script is like this: </usr/local/menush/menush> #!/bin/ksh # if ] then . $HOME/.profile fi ... (8 Replies)
Discussion started by: lramirev
8 Replies

8. UNIX for Advanced & Expert Users

Can we launch a shell script automatically upon ssh login?

Greetings all, I'll just like to know if it is possible to launch a shell script automatically upon a user's successful login into ssh from a remote host, without adding a command parameter to the ssh command... ie. after keying in ssh username@host (not ssh username@host "command") and upon... (1 Reply)
Discussion started by: rockysfr
1 Replies

9. Shell Programming and Scripting

ssh into a shell script (KSH)

Hi all, Just like to ask if it is possible to do the following: 1. Have a shell script that calls ssh username@destinationhost 2. Upon successful verification, we ssh into the destination host and automatically use ksh to run a shell script that resides in the destination host. (Hopefully no... (8 Replies)
Discussion started by: rockysfr
8 Replies

10. Shell Programming and Scripting

How can we ssh login with script?

Hi all, Normally, we give ip address to login with ssh like ssh 172.168.0.1 And we can give login name to ssh like ssh -l root 172.10.0.21 Then the shell asks the password, we enter the password and login to the system. While using the script file, we are not able to supply the password to... (5 Replies)
Discussion started by: pcsaji
5 Replies
Login or Register to Ask a Question
VIRT-LOGIN-SHELL(1)					      Virtualization Support					       VIRT-LOGIN-SHELL(1)

NAME
virt-login-shell - tool to execute a shell within a container matching the users name SYNOPSIS
virt-login-shell DESCRIPTION
The virt-login-shell program is a setuid shell that is used to join an LXC container that matches the user's name. If the container is not running, virt-login-shell will attempt to start the container. virt-sandbox-shell is not allowed to be run by root. Normal users will get added to a container that matches their username, if it exists, and they are configured in /etc/libvirt/virt-login-shell.conf. The basic structure of most virt-login-shell usage is: virt-login-shell OPTIONS
-h, --help Display command line help usage then exit. -V, --version Display version information then exit. CONFIG
By default, virt-login-shell will execute the /bin/sh program for the user. You can modify this behaviour by defining the shell variable in /etc/libvirt/virt-login-shell.conf. eg. shell = [ "/bin/ksh", "--login"] By default no users are allowed to use virt-login-shell, if you want to allow certain users to use virt-login-shell, you need to modify the allowed_users variable in /etc/libvirt/virt-login-shell.conf. eg. allowed_users = [ "tom", "dick", "harry" ] BUGS
Report any bugs discovered to the libvirt community via the mailing list "http://libvirt.org/contact.html" or bug tracker "http://libvirt.org/bugs.html". Alternatively report bugs to your software distributor / vendor. AUTHORS
Please refer to the AUTHORS file distributed with libvirt. Daniel Walsh <dwalsh at redhat dot com> COPYRIGHT
Copyright (C) 2013 Red Hat, Inc., and the authors listed in the libvirt AUTHORS file. LICENSE
virt-login-shell is distributed under the terms of the GNU LGPL v2+. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE SEE ALSO
virsh(1), <http://www.libvirt.org/> libvirt-1.1.1 2014-06-17 VIRT-LOGIN-SHELL(1)