Skip to main content

Posts

Adding users to sudoers file in linux operating systems

Let us say we need to add the users to the sudoers file in linux to run some commands with special root privileges to avoid seeing error such as "user is not in sudoers file. The incident will be reported " . We need to follow below steps: Login as root. Run visudo command , this opens /etc/sudoers file. Search for the line  # % wheel  ALL=(ALL)  ALL. Uncomment the line by deleting #. Save the file. Now run command as a root, "usermod -aG wheel logout from root session. Now if the user 'xyz' belongs to the group 'wheel' then the user "xyz" can run privileged commands with sudo access. If you want to give sudo access to specific user then add the following line in /etc/sudoers file by using visudo command xyz   ALL=(ALL)  ALL

Mounting nfs share on Mac

Mounting nfs share on Mac Through The Finder Accessing an NFS share with the Mac OS X Finder is simple. Select Go -> Connect to Server... in the Finder. In the Address box, enter the location of the NFS share as follows nfs:// servername /path/to/share. So if your server's name is taco and the share is /exports/media, you would use the address nfs://taco/exports/media. The Finder will then access the share and mount it on your desktop. An important note here is that the Finder uses an unprivileged port to do this, which may not work with some NFS server configurations. Through The Mount Command To use the mount command to mount a share, open the Terminal application. Enter the command sudo /bin/mount_nfs servername: /path/to/share _/private/mnt/point_, replacing the italicized sections with the necessary values. This command will also use an unprivileged port by default, but you can force a privileged port with the -P switch. Using the automount Daemon For more per...

What process is using your CD or DVD on *nix

Tried to eject a CD or DVD and you were told that the disk was in use and couldn't figure out what was using the disk? Use the below shell script is to findout. #!/bin/bash PATH=${PATH}:/sbin:/usr/sbin dr=($(drutil status | grep -i 'type:')) devtype=${dr[1]} device=($(mount | grep ${dr[3]})) if [ $devtype = "No" ] then echo No disk found. Sorry! >&2 exit 1; fi echo A $devtype is mounted on the device named $device pids=($(sudo -p 'Please enter the administrator password:' lsof -t $device)) echo \nList of programs that may be preventing the disk to eject ps -o pid,user,comm=COMMAND -www -p $(echo ${pids[*]} | sed 's/ /,/g') The output is a list of the processes that lsof says is using the CD or DVD.

Mount NFS Volumes in Snow leopard with Disk Utility

NFS mounts are now added using Disk Utility. To add a Linux-hosted NFS share on my network, 1. Start Disk Utility 2. Select NFS Mounts from the File menu 3. Click the plus sign in the lower left corner 4. Enter in your remote NFS URL info as described 5. Enter the mount point. If you add it to /Network, then it will show up in the Shared section of Finder, in an entry called All. 6. If you're using secure ports on your server, then click the Advanced option and enter -P 7. Click Verify 8. Save your settings The NFS mount is now available.