Tag Info

Hot answers tagged

48

Even as root, you can't execute files that have no x permission bit set. What you can do though is call ld.so on it: sudo /lib/*/ld*.so /bin/chmod 755 /bin /bin/chmod Or call something in /usr/bin or elsewhere to do the chmod like perl: sudo perl -e 'chmod 0755, "/bin", "/bin/chmod" Beware when restoring permissions that some files in /bin like mount ...


45

LVM is designed in a way that keeps it from really getting in the way very much. From the userspace point of view, it looks like another layer of "virtual stuff" on top of the disk, and it seems natural to imagine that all of the I/O has to now pass through this before it gets to or from the real hardware. But it's not like that. The kernel already needs to ...


23

rm /* should delete very little. There is no -r flag in there that would recursively delete anything, and without it directories will not be deleted (and even if directories were deleted, only empty ones can be deleted). This answer is predicated on the assumption that you did not run rm -rf /*. The only files in the root filesystem of consequence may be ...


22

Boot another clean OS, mount the file system and fix permissions. As your broken file system lives in a VM, you should have your host system available and working. Mount your broken file system there and fix it. In case of QEMU/KVM you can for example mount the file system using nbd.


20

To run a service without or before logging in to the system (i.e. "on boot"), you will need to create a startup script and add it to the boot sequence. There's three parts to a service script: start, stop and restart. The basic structure of a service script is: #!/bin/bash # RETVAL=0; start() { echo “Starting <Service>” } stop() { echo “Stopping ...


17

If you need to recover files from the current install, ask your host to help you. Assuming it's a VM, it takes about five minutes of their day to image your disk, reinstall your host from scratch and dump the old disk image in your new filesystem. If you don't need anything, just get them to reinstall. Almost always the faster option when you bone things ...


16

You can edit remotely with a local vim or gvim. :e scp://me@someplace.else/~/myfiles/whatever.file scp is a secure copy protocol. It authenticates the same way as ssh, so your ssh key needs to be available, etc. There are various other protocols supported (see :help netrw-externapp) but scp is probably the easiest if you are already using ssh to the ...


14

Depending on init system, you create init script differently. Fedora gives you upstart and systemd to choose from, and of course SysV compatibility. Upstart create service definition file as /etc/init/custom-tomcat.conf put inside: start on stopped rc RUNLEVEL=3 respawn exec /path/to/you/tomcat --and --parameters And you Tomcat should ...


14

sudo python -m SimpleHTTPServer 80 Ports below 1024 require root privileges. As George added in a comment, running this command as root is not a good idea - it opens up all kinds of security vulnerabilities. However, it answers the question.


13

One of the things that RHEL/CentOS (and other Enterprise Linux products) provides that other distros don't provide is API/ABI stability. This is a frustration to a lot of people who are new to RHEL, because all they see is that the versions available are all older than the latest releases found in the latest release of Ubuntu/Fedora/Gentoo/Whatever. But, ...


11

A user's home directory is the initial directory when a user logs in. Normally the user may create files and directories only in in home directory (apart from temporary directories). Also various settings (user specific startup files and such) are usually stored in the user's home directory. Server is just annother name for a host (a computer). Think of a ...


10

Yes, you can automate the authentication with your Raspberry Pi using SSH. As prerequisites the following is required: You have enabled SSH on the Pi. You know your Pi's IP Address. Linux Under Linux you can install SSH via you package manager, generate a keypair using ssh-keygen, copy the key to the Pi using ssh-copy-id and test using ssh. Install ...


9

There are several choices of minimal, relay-only mail transfer agents (MTAs, or "mail servers"), some of which have been mentioned in other answers: msmtp http://msmtp.sourceforge.net/ nullmailer http://untroubled.org/nullmailer/ (my personal favourite) esmtp http://esmtp.sourceforge.net/ (unmaintained) sSMTP http://packages.debian.org/source/sid/ssmtp (no ...


9

SELinux enhanced local security by improving the isolation between processes and providing more fine-grained security policies. For multi-user machines, this can be useful because of the more flexible policies, and it raises more barriers between users so it adds protection against malicious local users. For servers, SELinux can reduce the impact of a ...


8

If you have a separate server to run your check script on, something like this would do a simple Ping test to see if the server is alive: #!/bin/bash SERVERIP=192.168.2.3 NOTIFYEMAIL=test@example.com ping -c 3 $SERVERIP > /dev/null 2>&1 if [ $? -ne 0 ] then # Use your favorite mailer here: mailx -s "Server $SERVERIP is down" -t ...


7

There are two reasons lsof | wc -l doesn't count file descriptors. One is that it lists things that aren't open files, such as loaded dynamically linked libraries and current working directories; you need to filter them out. Another is that lsof takes some time to run, so can miss files that are opened or closed while it's running; therefore the number of ...


7

Creating an ha environment has a lot of caveats and is complicated, and often times depends on the actual software (e.g. creating a master-slave environment for mysql is different than for postfix0 If you want to get started and only want to have two systems and don't have time to configure all your daemons accordingly you should have a look at drbd, raid-1 ...


7

Create a user and set his login shell to your command. For example: sudo apt-get install sl sudo adduser foo sudo chsh -s $(which sl) foo ssh foo@localhost Also have a look at man sshd_config for some other ways to configure you ssh server. (Like adding a ForceCommand.)


6

You can read some of the various online linux-for-newbies resources, and they might be some help. Going through the documentation for your distribution is worthwhile — both Ubuntu and Fedora have teams producing professional-quality documentation, at https://help.ubuntu.com/ and http://docs.fedoraproject.org/ respectively. If you're a book learner, there's ...


6

LVM, like everything else, is a mixed blessing. With respect to performance, LVM will hinder you a little bit because it is another layer of abstraction that has to be worked out before bits hit (or can be read from) the disk. In most situations, this performance hit will be practically unmeasurable. The advantages of LVM include the fact that you can add ...


6

In the world I work in, the CAD tools used all require RedHat Enterprise be used -- some with specific kernel version and build numbers -- or the vendors won't support their products. The reason why they do this is obvious. There are just too many distributions and potential kernels and library combinations for them to be able to reproduce every possible ...


6

Seriously, if your provider does not offer free (or at least cheap) manual assistance for extreme cases, it's time to switch. Otherwise, I think that you are pretty much OK with your setup. When your system is so broken that fsck can't fix it, there isn't much else to do, other than a complete reinstall. I actually haven't seen this happen unless there was ...


6

Change the setuid bit of mysqld executable and the ownership of the executable file to mysql account, besides adding the required user in the group mysql for making him have access to the files on the filesystem. Use visudo -f /etc/sudoers and grant him permission to execute the /etc/rc.d/init.d/mysql start and /etc/rc.d/init.d/mysql stop as two seperate ...


6

RedHat Enterprise Linux (RHEL) is the server-based version offered by Redhat (the company behind Fedora), for which you can buy their support. CentOS is the version maintained and supported by the open source community. The primary difference, unless you want to buy RedHat's support, seems to be that CentOS unbrands RHEL (replacing the RH artwork) and, I ...


6

Fedora only has a Desktop edition. In my experience, "server" distros have a longer support lifetime than desktop distros. If you want something that has a longer support cycle, use Red Hat Enterprise Linux, or one of the RHEL clones like CentOS. Fedora really isn't suited for a long-term support OS, because at best you'll get 13 months of support if you ...


6

Method #1: ssh-keyscan One method would be to use the command ssh-keyscan to see if a ssh daemon is up and functioning. Just loop through the IP addresses and ssh-keyscan <ip> | grep -v ... each server. If the server is there, the status returned by running the ssh-keyscan ... | grep -v ... command will be a 0, anything else (1 or higher) means there ...


6

No you do not require a mail server to send mail. I'm most familiar with Sendmail and there are 3 classifications of functionality that fulfill email as a service. MDA (Mail Delivery Agents) is 1, and MTA (Mail Transfer Agents) is 2, and 3 is MUA (Mail User Agents). The terminology get's confusing but you do not require an MTA to be running all the time. ...


5

This really depends on your situation. Ubuntu has a sever and even LTS (long term support) version that in a lot of ways is just as good as RHEL/CentOS. I work in a mixed environment. Generally using Fedora or Ubuntu for desktops, use FreeBSD, Gentoo and such for appliances and for servers I stick mainly to CentOS but manage a lot of Ubuntu servers as well. ...


5

Certainly many people have used Ubuntu Server with Windows clients. The Ubuntu Server Guide covers pretty much all of what you want to do. Here are a few comments on your proposed setup: Ditch FTP. Use SSH instead. Personally, I would also add that you should set up key-based authentication and disable password auth. See this page for some help. I don't ...


5

Specific things you might want to look into is: Shell scripting Being able to use bash is a must for anyone thats going to get intimate on the command line Services You will have to understand the services your webserver will be running. If your running PHP and MYSQL. You'll want to read about LAMP. As Falmarri says, solving individual problems when ...



Only top voted, non community-wiki answers of a minimum length are eligible