Linux Notes

Linux Notes

General Documentation

Samba

Samba can be installed by running:

 apt-get install samba

Samba allows you to share a directory on your Linux filesystem with your Windows machine. In the /etc/samba directory, there is an smb.conf.user file that is used for any Samba extensions that you'd like to make to share additional directories. By default, you should have your home directory set up as a samba share in smb.conf. It's in there as the [homes] clause, but the actual share name is the same as your username (ex. \\mylinuxservername\dkirkdorffer). If you are connecting for the first time, you will have to set the samba password using following command:

 sudo smbpasswd -a dkirkdorffer

You will be prompted to enter a new password; this will be the password to use when connecting to your Linux box from your Windows box.

 [dkirkdorffer]
    path = /home/dkirkdorffer
    read only = no
    valid users = dkirkdorffer
    create mask = 0644
    browsable = no

If you want to have access to the root of your linux drive, you can edit the /etc/samba/smb.conf.user file and add this snippet (modify the username to your username):

 [root]
    path = /
    read only = no
    valid users = dkirkdorffer
    create mask = 0644
    browsable = no

This will enable you to access the root of your linux drive using the alias “root” (ex: \\mylinuxservername\root)

Start (or stop and restart) the smbd daemon (at /usr/sbin or possibly at /etc/init.d) like so:

 /usr/sbin/smbd start
 
 /usr/sbin/smbd stop
 
 /usr/sbin/smbd restart

For troubleshooting info read the ”The Samba Checklist”.

To determine the IP address of the Samba server run:

nmblookup -B BIGSERVER __SAMBA__

UNIX

Additional UNIX resources of use:

Start and stop alternatives:

 /usr/sfw/sbin/smbd start
 
 /usr/sfw/sbin/smbd stop
 
 /usr/sfw/sbin/smbd restart
 

or

 svcadm enable samba wins
 
 svcadm disable samba wins

SSH

  • How to set up SSH keys - i.e. generate the keys on the server (UNIX, Linux, BSD etc.) instead of the client (i.e. in Windows).
  • Special instructions for Cervisia - Before doing a check-out for the first time, make sure that the key for the CVS server is in your .ssh/known_hosts file. One way to do this is: 'ssh <user>@<cvs_hostname>'. Failing to do this will make Cervisia ask for a password and then terminate the checkout with the error “Host key verification failed”.

VNC

You can start the VNC Server by running ./startvnc.sh or ./startvnc4.sh. VNC Viewer can then be installed on your Windows system, allowing you full access to your Linux system from Windows (or another Linux system). You can override the default geometry of the VNC window created by the server by altering the shell script like this:

 #!/bin/sh
 vncserver -geometry 1580x1100 -depth 24
 nohup vncconfig -nowin > /dev/null 2>&1 &

or

 #!/bin/sh
 /usr/bin/vnc4server -geometry 1220x830 -depth 24
 nohup /usr/bin/vnc4config -nowin > /dev/null 2>&1 &

An .vnc/xstartup file is also used and if using KDE can be setup as so

 #!/bin/sh
 vncconfig -nowin &
 startkde &

Set the password by running vncpasswd, vnc4passwd or tightvncpasswd, depending on your version of VNC.

The default starting port for VNC is 5901 (or 5801 through a web browser), additional instances of VNC will increment this number by 1 (so 5902 for the second one). You can find what port it's currently running on by running:

 ps -ef | grep vnc

and looking for the ”rfbport” parameter. Alternatively, look in the ~/.vnc directory at the log file.

TightVNC and RealVNC are both provide good client viewers, and VNC servers.

UNIX

See: VNC on Solaris

On Solaris, the ./startvnc.sh might look like this:

 #!/bin/ksh
 PATH=$PATH:/usr/dt/bin:/usr/openwin/bin:/usr/X11/bin
 cd ~
 vncserver -depth 24 -geometry 1500x768 :1

./killvnc.sh might look like this:

 #!/bin/ksh
 PATH=$PATH:/usr/dt/bin:/usr/openwin/bin:/usr/X11/bin
 cd ~
 vncserver -kill :1

and the .vnc/xstartup file might look like this:

 #!/bin/sh
 [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
 xsetroot -solid grey
 vncconfig -iconic &
 xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
 gnome-session &
linux_notes.txt · Last modified: 03/28/2014 13:24 by Daniel Kirkdorffer
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki