General :: Shell Script To Automatically Login Through Ssh And Create User?

Oct 20, 2010

I was trying to create a shell script which will automatically login to the server 192.168.1.7 and checks if a user exists there or not, if it doesn't exist then it should create the user.I have very little idea about shell scriptThis is what I tried:Quote:

#!/bin/bash
pass="sacharje"
ssh 192.168.1.7

Now, how to pass that password automatically to the ssh when it asks for the password? (I can't use public key authentication here)

View 10 Replies


ADVERTISEMENT

General :: Create A Profile Settings And Network Drive Can Be Mapped Automatically When User Login?

Mar 26, 2010

create a profile settings and network drive can be mapped automatically when user login to the (like Domain and active user profile on windows environment) Ubuntu systems?

View 1 Replies View Related

General :: Login As Other User Using Shell Doesn't Load The Profile For That User?

Dec 11, 2009

I am using the sudo command to log on locally as another user by the following command:

sudo -u theotheruser -s
or
sudo -u theotheruser sh

As I see it, this initiates a new shell with the mentioned other user.However, this doesn't load that users profile from his home directory.Is there a way to automatically read the users profile when login in with selected command? I am mostely interested in getting a working prompt when logged in.

View 11 Replies View Related

General :: A Script For Deleting User , If He Has No Login Shell?

Nov 25, 2010

I want to create a script to delete user if he has no login shell.

View 4 Replies View Related

Programming :: Create A Shell Script That Would Automatically Backup And Shutdown?

Oct 14, 2010

I would like to develop a shell script that would automatically run a backup program and then shutdown the computers, but I do not know the first thing about script development or even writing scripting.

View 2 Replies View Related

Fedora Installation :: F13 To F14 No Shell At Login / After Upgrading Cant Login On User?

Jun 3, 2011

yesterday I updated my fedora 13 to fedora 14 (on laptop) and today i cannot log in on user. It just go blank for a sec and is back to login.

At text console (alt+ctr+f2/f3) i enter my username and pass it give this for a sec and resets (clean) console
username: Name
password:
last used: [date]
login: no shell permission denied

i used unetbootin (fedora 14 netinstall to update) and later i updated 1,5G before reboot (did update that fix, forgot its name tho :s)

I would most likely reinstall everything, but i have some work at laptop and as death-line is near, i would prefer to fix it if possible.

edited:
i have installed F13 on unused space, is there a way for me to access and fix it? or at least get some files from there?

View 1 Replies View Related

General :: User Login Activity - A Script That Will Create A Report That Will Be Emailed?

Sep 18, 2010

I need to produce a script that will create a report that will be emailed to me that will Log user login activity to detect unauthorized remote access attempts. Where would I start?

View 2 Replies View Related

General :: Create A New Mysql User And A Mysql Database At The Shell Prompt?

Aug 7, 2010

How do I create a new mysql user and a mysql database at the shell prompt?

View 1 Replies View Related

Programming :: Shell Scripting: How To Create A User

Sep 5, 2010

How do I create a user account in a shell script? I know this may sound n00bish to you, but I know it's more than just mkdir-ing the home directory and subdirectories.

View 7 Replies View Related

Ubuntu :: Automatically Login Can't Select User / Fix It?

Jun 19, 2011

I having really bad problem can't select user for Automatically Login
here is a picture as proof what is my problem !
As we see i can't select user in login as
image is in attachment !
if somebody knows how to bypass it trout terminal i will be glad to fix this problem my self any way thanks for attention !

View 9 Replies View Related

Security :: Login Automatically For An User Without Authentication?

Mar 9, 2010

I have installed CentOS 5.2. I want to login automatically for an user without authentication.

View 2 Replies View Related

Red Hat / Fedora :: Login - Error "no Profile For The User Can Be Found And It Couldnt Create Per-user Gnome Configuration Directory"

Aug 8, 2010

I have a network set up that has been working for around a year with no problems but has now developed a login problem. The system was set up with a main server with all users on it and another PC located elsewhere that people could log onto using there personal login and password that then gained access to the account on the main server. This remote PC has now got the problem. When you try to log onto an account it comes up with the message "your session has lasted less than 10 seconds. If you have not logged out yourself this could mean there is a installation problem or that you are out of disk space."

Error message says that no profile for the user can be found and it couldnt create per-user gnome configuration directory. I can log on as root onto the remote PC as it is obviously a local account but all the account on the main server are not accessible. From the root account I can see that the connection to the server is OK and I can actually log into the accounts on the server using the failsafe session so the physical network is OK.

I never built or designed this set up and to be honest I normally work with windows so its all a bit strange to me. Both PC's run Centos 5. I have checked the messages log and there doesnt seem to be any indication of a problem. Just that it stopped connecting from the remote PC. The accounts are all active on the main server itself and have no problems being accessed.

View 3 Replies View Related

Fedora :: Create A Shell Script That Adds User And Password In The Passwd And Smbpasswd?

Feb 18, 2010

is it possible to create a shell script that adds user and password in the passwd and smbpasswd?

View 3 Replies View Related

Ubuntu :: Broken Path To User Shell - Can't Complete Login

Jun 9, 2011

I inadvertently typed the wrong path when changing my user login shell and now every time I log in I get a message stating that it can't find the shell and boots me off the system. It will then redisplay the login prompt. I'm running Ubuntu Server x64 in VMware Workstation.

View 1 Replies View Related

Slackware :: VSFTPD User Versus Login Shell Definition

Jul 18, 2011

I'm using VSFTPD on my office LAN for one simple task: to receive-and send - installation images created with Ghost4Linux. Until recently, my main LAN server ran on CentOS, but I decided to migrate it to Slackware (nicer release policy ).

What I usually do is create an 'install' user who can login to FTP, but not on the system. Here's an example of what I used to do on my CentOS setup:

Code:

# mkdir -p -m 0700 /home/ftp/install
# groupadd install
# useradd -d /home/ftp/install -g install -s /sbin/nologin install
# chown -R install:install /home/ftp/install
# passwd install

The relevant bits in vsftpd.conf looked like this on the CentOS server:

Code:

...
anonymous_enable=NO
...
userlist_enable=YES
userlist_deny=NO
userlist_file=/etc/vsftpd/user_list
...

Then I only had to create the /etc/vsftpd/user_list file and put a single line in it to allow the newly created user:

Code:

install Now I've tried to get the same behaviour on Slackware, and I succeeded more or less, except for one thing. There's no way my 'install' user can login to FTP when his default shell is set to '/sbin/nologin' (or '/bin/false'). Only when I change the 'install' users' default shell to a "real" shell like '/bin/bash', he's able to login.

Here's a little practical demonstration of what's happening:

Code:

$ lftp localhost
lftp localhost:~> user install
Mot de passe :

[code]...

View 1 Replies View Related

General :: $HOME/.bashrc Disabled When User Shell Is 'rbash' (restricted Shell)?

Jun 15, 2011

MACHINE: HP Proliant DL260G5OS: SLES 11 SP1kernel: Linux xserver 2.6.32.12-0.7-default #1 SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64 x86_64 GNU/LinuxIt is used as remote xserver in a LAN.I have configured /usr/lib/restricted/bin/.rbashrc with some environment variables but when the users logon in the system finally is executed $HOME/.bashrc and some environment vars are overwritten.

View 2 Replies View Related

Ubuntu :: Create A User That Will Not Show Up In The GDM Login Screen?

Jun 10, 2010

Is there a way to create a user that will not show up in the GDM login screen? This user also needs to have sudo access

View 6 Replies View Related

General :: Write A Shell Script That Allows Only User 1 And User 2 To Execute A Program?

Feb 25, 2010

I've looked everywhere but I can't find where to change the default box for incoming mail, or am I on the wrong track. It's a nuisance having to change folders and I can't configure wastebin to empty on exit.And I can't get kmail to import from evolution. Do I have to go to the evolution storage and do it manually, and if so, how do I do that?

View 1 Replies View Related

OpenSUSE :: Interface For Managers To Login And Create Proxy User ID's For External People?

Mar 3, 2011

Does anyone know what is the best open source proxy solution out there? What we need out of the proxy are the following: Access Control - There should be a web interface for managers to login and create proxy user ID's for external people Good password complexity requirement Lock down the allowed websites

View 1 Replies View Related

General :: Shell Script Executing Automatically?

May 16, 2011

I want login.sh shell script executing automaticaly whenever i open the console..?and also logout.sh shell script executing automaticaly whenever close the console.

View 1 Replies View Related

General :: Diffrence Between Login And Non Login Shell?

Feb 17, 2010

diffrence between login and non login shell. What does it mean by user enviorment.

View 3 Replies View Related

General :: Create User Add File With Default Password And Force User To Change It?

Feb 2, 2010

I want to add 50 new users, not on the server yet I want to add them all to group Accounting - with 1 option, not user by user I want to setup a default password for them all, and have it say something like 'You must now change password or no access will be permitted' Any other options I also want to do once, not for each user?

View 3 Replies View Related

General :: Automatically Create Windows Partitions?

Mar 19, 2010

How to automatically create windows partitions(fat/ntfs) through Linux. I have all the required information for partitions to be created.

For example:

Size
Flag
Partition Type
etc.

View 2 Replies View Related

Programming :: Shell Scripting / Create A Shell Script Similar To Ls?

Jun 5, 2011

I am trying to create a shell script similar to ls, but which only lists directories. I have the first half working (no argument version), but trying to make it accept an argument, I am failing. My logic is sound I think, but I'm missing something on the syntax.

Code:
if [ $# -eq 0 ] ; then
d=`pwd`
for i in * ; do
if test -d $d/$i ; then
echo "$i:"
code....

View 10 Replies View Related

General :: Login Automatically On Every Startup?

Mar 21, 2011

I am using Vetor Linux and I want to login automatically every system starpup instead ask for user and password. Vector linux is based in slackware and uses shell to ask user and password.

View 1 Replies View Related

Ubuntu Installation :: Create New Partition Table Does Automatically Create New Mbr

Oct 28, 2010

When using the gparted option to create a new partition table does this automatically create a new mbr?

View 1 Replies View Related

General :: Create The Shell Which Would Support The LS Command In C++?

Sep 4, 2010

I would like to create the shell which would support the LS command in C++. And any way to change the command prompt.

View 1 Replies View Related

General :: Create An Automated Shell Script?

Sep 16, 2010

I am a complete newbie to linux. I am currently taking a course at Devry university called netw240. I am in my 2nd week of class and am required to turn in a paper at the end of the coures were I write an automated shell script. I am currently using Fedora 12 on a Vmware player and want to try to write a script that automates the process of Logging user login activity to detect unauthorized remote access attempts.I am looking for pointers on were to start, examples, ect.. anything that can get me started. Also, is this type of script to much for a beginner?

View 11 Replies View Related

General :: How To Change User Groups Automatically

Jun 16, 2011

I've created a set of users using the newusers command. Unfortunatelly ive messed up and added all users to the 1000 group as primary group instead of giving the group argument as null what would add them to a new group. To make things clear:

The entries should be

user:password:::User Name:/home/user:/bin/bash

but I did

user:password::1000:User Name:/home/user:/bin/bash

I need to create the missing groups. A simple fix could be do a for loop creating a group with the name of each user in my file and then adding the users to it. Are there any dangers of doing it? What impact could this change have? Are there any safer ways?

A combination of the following commands:

Quote:

Add users to a group with the gpasswd command:

# gpasswd -a [user] [group]

To delete existing groups:

# groupdel [group]

To remove users from a group:

# gpasswd -d [user] [group]

If the user is currently logged in, he/she must log out and in again for the change to have effect.

Quote:

for i in (names)
do groupadd $i
gpasswd -a $i $i

Assuming I've created all users in group 1000 I could remove them from it with

Quote:

# gpasswd -d [user] [group]

View 2 Replies View Related

General :: F14 - OpenVPN Disconnect Automatically After Login

Jan 15, 2011

I'm using openvpn under linux OS which is Fedora Core 14, in the folder "/etc/openvpn" i put 5 files which belongs to the network server that I should connect to, files are :
two files with the extension ".crt"
two files with the extension ".key"
one file with the extension ".conf"

Now, when I issue the following command (as root) :
Code:
/etc/init.d/openvpn start
It asks for my username & password to the network server, & after I entered the required authentication information, I successfully login, but I get disconnected automatically after two or three seconds.

- I connect to the network without any disconnection or problems under windows
- I use openvpn version "openvpn-2.1.1-2.fc13.i686"
- there was a bug in my OS "Fedora core 14" which is that I cannot activate or deactivate any ethernet cards, which solved by disabling NetworkManager in all run levels
- I disabled iptables
- I disabled selinux
- I got this error in /var/log/messages file when I disconnect from the openvpn network "

Jan 15 21:45:15 ViRuS openvpn[4143]: script failed: could not execute external program
Jan 15 21:45:15 ViRuS openvpn[4143]: Exiting
Jan 15 21:45:15 ViRuS avahi-daemon[1494]: Withdrawing workstation service for tun0.

- I couldn't find the file called "/etc/openvpn/update-resolv-conf"

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved