General :: Shell Script To Find Enabled System Accounts?

Jan 28, 2010

I wrote a small script that gets me the list of enabled system accounts in my system.

I figure '*' & '!' (in field #2 of /etc/shadow) mean that the account is disabled or they cannot login, hence 'safe-to-ignore'

Code:
IFS=$'
'
for i in `cat /etc/passwd` #get each line in the passwd file
do
var1=`echo $i | cut -d':' -f3` #get user ID field
if [ $var1 -lt 500 ] && [ $var1 -gt 0 ] #compare to extract relevant IDs

[Code].....

BTW i figure the following command gives me the list of system users, but i am not able to find a way to process it further... :-(

Code:
awk -F":" '$3 >= 1 && $3 < 500 { print $1 }' /etc/passwd

View 3 Replies


ADVERTISEMENT

General :: Disable - Non-root Shell Command To Find If A User Account Is Enabled Or Not?

Aug 10, 2011

Is there a non-root shell command that can tell me if a user's account is disabled or not? note that there is a fine distinction between LOCKING and DISABLED:

LOCKING is where you prepend ! or * or !! to the password field of the /etc/passwd file. On Linux systems that shadow the passwords, this marker flag may be placed in /etc/shadow instead of /etc/passwd. Password locking can be done (at a shell prompt) via password -l username (as root) to lock the account of username, and the use of the option -u will unlock it.

DISABLING an account is done by setting the expiration time of the user account to some point in the past. This can be done with chage -E 0 username, which sets the expiration date to 0 days after the Unix epoch. Setting it to -1 will disable the use of the expiration date.

The effect of locking to to prevent the login process from using a supplied password to hash correctly against the saved hash (by virtue of the fact that the pre-pended marker character(s) are not valid output character(s) for the hash, thus no possible input can ever be used to generate a hash that would match it). The effect of disabling is to prevent any process from using an account because the expiration date of the account has already passed.For my situation, the use of locking is not sufficient because a user might still be able to login, e.g. using ssh authentication tokens, and processes under that user can still spawn other processes. Thus, we have accounts that are enabled or disabled, not just locked. We already know how to disable and enable the account - it requires root access and the use of chage, as shown above.To repeat my question: is there a shell command which can be run without root privileges which can output the status of this account expiration info for a given user? this is intended for use on a Red Hat Enterprise 5.4 system.The output is being returned to a java process which can then parse the output as needed, or make use of the return code.

View 2 Replies View Related

General :: Set Default System Audio Output Port (for All Accounts)?

May 5, 2010

The default output audio port Ubuntu doesn't work on my system. It should be "Analog Mono Output/Amplifier", instead of "Analog Output/Amplifier". I can easily change that in sound preferences, just by choosing the right port in the "Output" tab. The problem is this would only apply to a single account, and I would like to change it system-wide, so it applies to all accounts on the system (I have more than 100 users...).

Update: I can achieve the same effect as I would by changing it in sound preferences using the following command: pacmd 'set-sink-port' 'alsa_output.pci-0000_00_1f.5.analog-stereo analog-output-mono;output-amplifier-on' Unfortunately that's still not system-wide,

View 2 Replies View Related

Ubuntu :: Gnome Shell User-theme Extension Not Enabled?

May 2, 2011

I have gnome-shell installed on Ubuntu 11.04, and installed gnome-tweak. When I open it and try to change the theme, however, it says the user-theme extension is not enabled. How to I fix this?

View 1 Replies View Related

Software :: Debian + Postfix + Dovecot Find Old Accounts?

Jul 13, 2010

I'm using mbox storing for dovecot 1.0.15 messages. The mailbox is in a different partition (/var/mail).The MTA is postfix 2.5.5. SO is Debian 5. How can I find email accounts that haven't be accessed within a 30 days period in order to delete them?

View 1 Replies View Related

General :: How To Find Out Which Shell Script Called

Dec 6, 2010

I have two shell scripts:

sh1.sh
echo "First script"
echo "Now calling second one"
sh2.sh
sh2.sh
echo "Second script"

In this shell script, I want to print out which shell script called this. In this case, sh1.sh called sh2.sh. So, I want to print out "sh1.sh".How to achieve?

View 1 Replies View Related

General :: Find The Tag Value In Xml File Through Unix Shell Script?

Nov 3, 2010

the below tag is in the xml file. Now i want to find and extract the value of application name test1 and test2 one by one in the unix shell script. how to do this

<application name="test1">
</application>
<application name="test2">

[code]...

View 2 Replies View Related

General :: Find A Shell Script That Will Encode Video To?

Apr 17, 2011

I was trying to find a shell script that will encode video to a an iso that I can burn for a dvd. It seems I have lost a few of my dvds and I backed them up into mkv and I need to convert it to pal so it will work until I find them. My search was leading to other formats, but I was wanting to use pal because it is smaller. My search lead me here, but this shell script is not in pal.I need a solution that would work with slackware.

View 2 Replies View Related

General :: Shell Script To Find A File Size?

Jul 20, 2010

am trying to write a shell script to find the size of a particular log file and if the log size grows, script should mail the changes to the administrator or a any user so script should monitor the log file continuously in a time interval, how can i do that?

I tried with these codes to find the file size but it throws me error says command not found

$s=$( stat -c %s mylogfile.log)
echo $s

View 10 Replies View Related

Ubuntu :: Ssh For Non System Accounts?

Jul 19, 2011

I currently have an ftp server setup using Ubuntu 10.04 and pureftpd with mysql as the backend. All the ftp users are "virual users" that are stored in mysql. I want my existing users to be able to use scp to transfer files instead of ftp. As far as I know, you can only use ssh/scp if you have a system account. All of my virtual users use the same system account of "ftpuser".

Is it even possible for me to setup the users with scp access, even though they don't have an actual system account? I really don't want to setup system accounts for each user. I have a lot of ftp users and I plan on expanding that number, so adding system accounts isn't ideal, plus I feel like that will bring new security issues (researching chroot for ssh and how to lock down ssh).

View 3 Replies View Related

General :: Shell Command To Find Newest File In Filesystem?

Apr 13, 2010

I'm relatively experienced with UNIX and Linux, but this has me thrown for quite a loop, and it seemed like such a simple question. How would I go about finding the newest file in a file system? I thought something like:

Code:

ls -ltr `find /usr -type f`

would work, but I seem to be exceeding the argument maximum for ls:

ksh: 0403-029 There is not enough memory available now

I thought something involving xargs might work, but I really suck with that command.

View 3 Replies View Related

General :: Find The TCSH Shell And Gzip Version Number?

Apr 7, 2010

I need to find TCSH shell and gzip version number by running a acript on several boxes through ssh. How can i do that? I made a script for tcsh but it is not working by ssh , it only works on my box . I dont know from where to find the gzip version info.

View 5 Replies View Related

General :: Shell Script To Run Source Code And Find All Its Dependencies?

Aug 1, 2010

this is srinath,newbie to linux and shell scripts.am in need of shell script,which have to checkout the source code(C/C++) from CVS server to a specified directory and compile that source code and get all its dependency files to a specified directory.

View 2 Replies View Related

Networking :: Setting Up An Email System And Accounts

Apr 17, 2010

I am in the process of setting up and e-mail system for my small business. In the past I have always had my ISP and my domain registrar handle the e-mail and just POP the e-mail to a ciient such as thunderbird. Now I have decided in order to better learn postfix or sendmail, I want to setup my own and administer it. My question is:

1 - Once I have my domain name for my company is the e-mail accounts just created via psotfix or sendmail or are the accounts created via my domain registrar like my domain name? For Example: my domain name is test.com and I wanted president@test.com.

2 - Are e-mail servers setup in a DMZ as realys and then forwarded to an internal e-mail server and them transmitted to the clients or are they normally just put inside the LAN?

View 3 Replies View Related

Server :: Redhat Repositories - Can't Find In The Currently Enabled Repository

Apr 14, 2011

I have installed RHEL 6 and registered it. I want to install

php-mcrypt
libmcrypt

and some other packages but could not find in the currently enabled repository. Can i get a list of the available repositories.

# yum repolist
Loaded plugins: rhnplugin
repo id repo name status
rhel-x86_64-server-6 Red Hat Enterprise Linux Server (v. 6 for 64-bit x86_64) 3,930
repolist: 3,930

View 6 Replies View Related

General :: Looking For System Shell Command?

May 31, 2011

I'm looking for a specific command,if it exist... i want to login from my server to another Linux server,but the question is: can i do it in a one line command for ex:
usually you type: ssh "user"@10.1.1.1 and then the password,but I'm looking for a command in one line a fake ex: ssh user@10.1.1.1 -p "password" something like that.
I don't know if anyone of you understand what do i want to say .

View 6 Replies View Related

Ubuntu Networking :: Sync System Accounts With Samba?

Feb 3, 2010

What I want is to use the systems account as the samba accounts.In school we have a project to simulate some sort of corporation with different platforms. I've created a map called shared and for authentication the users should only need to be a member of the group employees. (force group = groupname in smb.conf right?) Now, I don't want to create the users with smbpasswd -a because there is alot of accounts and the users should be able to choose their own passwords. So, is it possible to sync the system accounts with samba and only use group as authentication?

View 2 Replies View Related

Ubuntu Security :: Allow Sftp Access To System Using Accounts?

Nov 26, 2010

allow sftp access to my Ubuntu system (happens to be desktop as it's also my main system) using accounts that are not able to login normally. (I have already managed to create such accounts.) These accounts need to be chrooted (also already accomplished with the openssh daemon settings.) Where I run into problems is that I want to give them (read only) access to files outside the chroot (on another partition in fact) and the matter if made more difficult because the directories to be shared are on NTFS-3G partitions (as they are a shared linux / windows storage drive). Is this possible and if so, what do I need to do?

Edit - Forgot to include versions
Ubuntu 10.10
openssh 1.5.5p1-4ubuntu4 (the one that comes with 10.10)

View 9 Replies View Related

Programming :: Build An Accounts System Database For A Project?

Apr 21, 2010

I have recently trying to build an Accounts system database for a project. When you run the program it goes in the main menu sort of like this.

Accounts System
Add a Customer With a Contract......1
Add a Customer Without a Contract...2
Display all Customers...............3
Find a Customer.....................4
Edit a Customer.....................5
Print a Statement...................6
Print an Invoice....................7
Load File...........................8
Save and Exit.......................9

When you add a customer with a contract, you add name, address, start contract, end contract, payment and email address. Now, is there a code I could write to get back to this menu. To not confuse anyone, all I just saying is supposing I accidentally push number 1 on the keyboard and suppose I didn't want to add a customer. In other words I need a code that can cancel (or stop) adding a customer to go back to the accounts system menu.

[Code]...

View 3 Replies View Related

Server :: Setting Up Server With Shell Accounts

Mar 31, 2011

How do i configure the system and user accounts so that the users can't access each others directories, delete system files, install packages etc.I know i am probably going to need tools like chmod mkdir useradd.But i can't figure out how.If you know a good tutorial, please point me in that direction.

View 3 Replies View Related

General :: Shell Command To Let System Box Go Sleep?

Jun 21, 2010

I'm writing a shell script to check the I/O activity of a Linux box and if the server is quiet for a certain long time, the script should let the server go to sleep. But, after some Google searching, I didn't find a answer yet. Is there a shell script command to put a Linux box to sleep?

View 3 Replies View Related

Ubuntu Multimedia :: Find A Package For Mplayer With Dvdnav Support Enabled?

Jul 10, 2010

where I can find a package for mplayer with dvdnav support enabled?

I was disappointed to discover that in 10.04 dvdnav support was disabled in mplayer. I rely on it for my mythtv front end box to be able to play DVDs. According to a bug it was disabled because of an upstream email chain where dvdnav was considered 'experimental' and 'not ready for production use'. Funny as it worked fine for me.

Post #6 here is where I found the above reasoning for it being disabled.

[URL]

View 8 Replies View Related

General :: Copy From 1 Computer To Another With System Shell Commands?

Jun 23, 2011

I want to copy a file (home/remote_computer_user/Desktop/test1.txt) from my remote office computer (a permanent URL + open port) to my home computer (home/home_computer_user/Downloads/).

How can I do this with shell commands in Linux?

My current thoughts:

ssh <user>@<computer1address> -p <port> - gives me a shell on the remote computer
(I think I should use scp, but I dont how exactly how in my case)

What are the exact commands I should use?

View 1 Replies View Related

General :: Bash - Rename Files With Spaces Using System Shell?

Jun 8, 2011

I named a number of files with spaces in them, and I want to replace the space with "_". However, every time I write a command in the shell with the file name (eg "Spring 2011"), the shell doesn't recognize the file or directory. What can I do about this? Is there any way to use the unicode character for a space?

View 5 Replies View Related

OpenSUSE Wireless :: Cannot Find Map File. No Module Symbols Loaded - Kernel Modules Not Enabled

Aug 3, 2010

Used to work perfectly. I attempted to install VPN client, result is can't connect to anything. Networks are seen by network manager, nothing happens when click connect. Results below:

Wireless LAN present in Hardware information. Atheros AR242x 802.11abg Wireless PCI Express Adapter (wlan0)
Kernel Driver: ath5k
168c:001c
/var/log/boot.msg

[code]....

Advice is to use output of dmesg command to find problem, but as above I don't get any results for this in terminal.

attempt to ping external site
linux-cfi6:~ # ping -c 66.70.73.150
Usage: ping [-LRUbdfnqrvVaA] [-c count] [-i interval] [-w deadline]

[code]....

View 1 Replies View Related

General :: Good Online Source For Tutorial To Use System Shell / Terminal?

Jul 18, 2010

I have recently loaded Linux Mint on an old IBM Laptop and am very happy with the GUI; however, I would like to learn how to use the Linux shell/terminal. I don't know any of the commands. Is there a good online source for this information--a tutorial or list?

View 2 Replies View Related

Red Hat / Fedora :: Fedora Shell Scripting \ "Find In Curent Folder For Files, And It Copy First File He Find With Name Gived By User?

May 18, 2011

shell scripting in Fedora14I want a script"Find in curent folder for files, and it copy first file he find with name gived by user, if name already exist then echo error message and finish"command usage " bash scriptname copyASname"

smthing like Code: #!/bin/bash
for files in /home/user/*
do

[code]....

View 1 Replies View Related

Ubuntu :: Enabled System > Administration > Services?

Jan 7, 2010

I'm Using 9.04/Gnome. I was looking in System>Administration>Services and wonder if I need them All of below enabled? It seems like duplication to me.

View 3 Replies View Related

General :: System Bash Shell Copy Previous Lines (not History) With Keyboard?

Jun 14, 2011

Is it possible to use the keyboard in order to select some text in the terminal windows that is not in the currently edited line? (for example, in order to copy part of previous command output).

View 3 Replies View Related

General :: Change To Shell Type That From SH To TCH And Back Again And Lost Coloring Of File System

Nov 18, 2010

after i made the change to my shell type, that from SH to TCH, and back again, i lost my coloring for my file system, if you know what i mean, folders always come in blue, and devices in yellow hope you understand? now everything i do can't seem to differentiated between files colors anymore.

View 7 Replies View Related







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