FAQs

  1. How to change the webmin password from command line?
  2. How to use ssh key based login for ssh/sftp to my server/vps?
  3. How to set the default file and folder upload permissions to be 644 and 755 respectively?
  4. What all I can restore using Backuppc ?
  5. How to restore files using backuppc?
  6. How can I login to my Virtualmin?
  7. How can I setup email forwarding?
  8. How to upload files using winscp to my linux server?
  1. How to change the webmin password from command line?

    Login as root onto the machine and enter the command as follows
    /usr/libexec/webmin/changepass.pl /etc/webmin root secretpassword

    secrectpassword needs to be substituted with the correct password. Webmin requires atleast 8 characters for a password and will not accept dictionary words or passwords containing the username like rootsecret which contains username root as oart of the password.

    The mkpasswd command (available by installing expect) can be used to generate good passwords from the command line in linux.

  2. How to use ssh key based login for ssh/sftp to my server/vps?

    If you are on a linux machine.

    On terminal of your machine, type the below given commands.

    ssh-keygen -t rsa

    You will need to enter a secure pass-phrase when prompted.

    Two files will be generated after this step. They are, /home/$USER/.ssh/id_rsa.pub and /home/$USER/.ssh/id_rsa

    After this, the file needs to be copied over to destination server as given below.

    scp /home/$USER/.ssh/id_dsa :/home//authorized_keys

    .ssh directory should have 700 permissions and authorized_keys file
    should have 400 or 600 permissions, which can be set:

    $ chmod 700 .ssh/
    $ chmod 600 .ssh/authorized_keys

    . You can log into the remote server using ssh or scp/sftp using the
    command line (port 22 is used by default).

    For windows machine

    1. Install winscp (http://winscp.net/eng/download.php) - the default
    install option also installs pageant and puttygen for you.

    2. Launch PuTTYgen.
    Click the SSH2 key type and set the number of bits in the generated key
    to 2048 in the Parameters group at the bottom of the dialog box.

    3. Click Generate and follow the instructions.
    The key information is displayed in the upper section of the dialog box.
    Clear the Key Comment edit box.

    4. Select all the text in Public key for pasting into authorized_keys
    file and press Ctrl-C.

    You will need to paste this private key into /home/$user/.ssh/authorized_keys of destination server.

    5. Type a passphrase in the Key passphrase and Confirm passphrase edit
    boxes.
    Click Save private key.

    6. Run pageant (putty ssh agent). Click on "Add key" and select your
    private key generated earlier using PuTTYgen. It will ask you for the
    passphrase and remembers it for this session. Let it run in the
    background.

    7. Start winscp and open its Login dialog box. Select the session tab
    and fill in:
    hostname: serverip
    username: username
    password:
    port : 22
    protocol: sftp

    Check Advanced options on left hand page inn SSH->Authentication->
    Check Attempt Authentication using Pageant.

    Further documentation/howtos can be found here:
    http://www.howtoforge.com/ssh_key_based_logins_putty
    http://winscp.net/eng/docs/ssh

    Note: DSA is faster in *signing*, but slower in *verifying*.
    A DSA key of the same strength as RSA (1024 bits) generates a smaller
    signature. For all practical purposes, either can be used.

  3. How to set the default file and folder upload permissions to be 644 and 755 respectively?

    You can change the default permissions for files and directories by
    going to Webmin -> Servers -> ProFTPD Server -> Under Virtual Servers,
    Default Server. Click on that and go to "Files and
    Directories", under that you can see "New File umask" and "directory
    mask". You can set the permissions there accordingly.

    Use 133 and 022 for 644 and 755 respectively

  4. What all I can restore using Backuppc ?

    Backuppc can be used to restore /etc/, /home/, /var/lib/mysql/,
    /var/spool/cron/ and /var/spool/mail/ directories, not the whole OS.

  5. How to restore files using backuppc?

    1. After logging in to backuppc interface, please click on "Browse
    backups" link on the left pane.

    2. Select backup from the drop-down menu on the top. Select the
    required folder/files to backup and click on "Restore selected files".

    3. This should take you to a new page with backup options. You can use
    the option 1 (direct restore) to get back backed-up files or download
    the files using options 2 or 3 and then re-upload to your server using
    winscp for eg.

  6. How can I login to my Virtualmin?

    Open your web browser, such as Firefox or Internet Explorer.

    2. In the address bar at the top of your browser, browse to the following address:

    https://:10000

    Where ip is your server's ip address.

    3. Once you have entered the address above, hit enter to go to the Virtualmin Login screen.

    4. Enter the username as root in Username field. Enter your password in the password field.

    5. Click Login, and you will be logged into Virtualmin.

  7. How can I setup email forwarding?

    1. Choose the domain for which you would like to setup forwarding. You can do that by
    selecting the domain name from the drop-down box on the top-left.

    2. Choose Edit Mail and FTP Users.

    3. Click the name of the account for which you would like to add forwarding.

    4. Click Mail forwarding settings to view the forwarding text area.

    5. Click the checkbox next to Forward to other addresses

    6. In the text area beneath Forward to other addresses, enter any number of email
    addresses -- one per line -- for which you would like the email forwarded.

    7. Click Save.

  8. How to upload files using winscp to my linux server?

    WinSCP is a popular free Scp program for Windows. An scp program lets you transfer files between your computer and your Web server.

    First, you need t to download and install winscp in your pc.
    You can download it from here
    http://sourceforge.net/projects/winscp/files/WinSCP/4.3.2/winscp432setup.exe/download

    Once its installed, we need to configure it to connect to server.

    • First click on 'Session' on the left-hand side, to bring up the Session options.
    • Fill in the 'Host name' as your server hostname or ip
    • Make sure the 'Port number' is set to 22
    • Fill in 'User name' as root/user
    • The 'Password' field with root/user password
    • Select 'SCP' in the 'Protocol' section
    • Finally, click 'Save'
    The first time you login, you may see this message: "The server's host key is not cached in the registry. You have no guarantee that the server is the computer you think it is. You can ignore this message and click on yes to continue.
    Once logged in, you will be taken to your home directory of the user with which you have logged in, which you'll see in the right hand pane in WinSCP.

    You could browse through directories and reach the document root of your website(usually /home/username/public_html/, where you want to upload your website files.
    Once you've found your document root, you're now ready to upload your website. Use the left-hand pane in WinSCP to browse to your website folder on your hard disk. You can upload your files to the server by dragging it from the left-hand pane to the document root folder in the right-hand pane.