Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

2012-02-17

Mounting Samba/Windows Share as directory

To be able to mount shares, smbfs is needed:

sudo apt-get install smbfs

Then we need some directory to mount to:

sudo mkdir /media/remote-music

Now, it's time to mount the share:
sudo mount -t smbfs //myserver/music /media/remote-music -o username=someuser,password=somepass
Remember, if needed at boot time, some more work is needed: a new entry in fstab is required.

2012-01-22

File transfer over ssh

If you want to transfer some files to or from your remote linux box from a Windows computer, using putty is a bit cryptic and less than ideal for GUI lovers. Instead, try some scp client like winscp. This works similar to ftp clients, but uses the ssh remote access.

Nothing is necessary to configure, when the ssh server on the linux box is already running (see how to "install ssh server").

Install ssh server

Remote access is often very useful, and should be part of the first things to set up after a new installation. This is specially nice to still be able to modify graphic settings when nothing can be seen due to bad X11 config.

sudo apt-get install openssh-server is enough to do the job. The computer can then be accessed using a ssh client (putty is a classic one for Windows computers). However, the default port is 22, and is commonly scanned. This is a good idea to change this to something else, if you want to access your computer also from outside your local network.

The port change is done editing the sshd_config file:

sudo gedit /ect/ssh/sshd_config

The default value "Port 22" should be changed to another number, preferably something with 4 digits or more. Once done, save the file and reload the configuration for the ssh server with following command:

sudo reload ssh

2011-02-01

ubuntu killer update

Some ubuntu 10.10 update broke it! I'm still having some problems, but I already learned about groups and the importance of the first created user.

This first user belongs (normally) to the admin group, and is allowed to use the 'sudo' command. It seems my '/etc/group' file got corrupted at some point, leaving my first user with almost no rights. Specially, I was not even allowed to use 'sudo' to get it fixed.

Thanks to this page, I got at least the required access rights back, editing the '/etc/group' file in recovery mode, adding my first user to the admin group. 'nano' is already configured to be used as alternative to 'vidudo' (often recommanded to edit '/etc/sudoers'), and much simpler to use for normal people. Also worth reading about 'sudo', in order to understand what it is all about: this ubuntu help page.

After I got my user back into the admin group, I had to edit again the '/etc/group' file to add my user also to various other groups, since every settings were gone.

Here is the list of groups I used (found on serverfault.com): 
  • adm
  • dialout
  • cdrom
  • floppy
  • fuse
  • audio
  • dip
  • video
  • plugdev
  • sambashare
  • lpadmin
  • admin

Note: having a backup is always the best solution. If you are lazy and lucky, you can find a valid 'group' file at one of these locations:
  • /etc/group_backup
  • /var/backups/group.bak