Warning: A non-numeric value encountered in /homepages/31/d121558763/htdocs/InspireGames/wp-content/themes/Divi/functions.php on line 5560

Warning: count(): Parameter must be an array or an object that implements Countable in /homepages/31/d121558763/htdocs/InspireGames/wp-includes/post-template.php on line 265

Warning: count(): Parameter must be an array or an object that implements Countable in /homepages/31/d121558763/htdocs/InspireGames/wp-includes/post-template.php on line 265

Warning: count(): Parameter must be an array or an object that implements Countable in /homepages/31/d121558763/htdocs/InspireGames/wp-includes/post-template.php on line 265

Warning: count(): Parameter must be an array or an object that implements Countable in /homepages/31/d121558763/htdocs/InspireGames/wp-includes/post-template.php on line 265

I’m using PuTTY as a console for my nas4Free file server.

Note up-arrow and down-arrow keys show previous text input in the command line.

.cshrc Aliases

You will notice aliases in .cshrc for some of the ls commands (they are very convenient). You can create other aliases by editing .cshrc. You can make these aliases available to all users on the system by putting them in the system-wide csh configuration file, /etc/csh.cshrc.

Useful Unix commands in NAS4Free

See more here on Freebsd.org but note that some commands don’t work in NAS4Free

Note.. spaces and case sensitivity for all comands

ls

See the unix manual ls command.

  • ls / List the contents of your root directory.
  • ls ../ List the contents of the parent directory
  • ls ~ List the contents of your home directory
  • ls -F Lists the files in the current directory with a * after executables, a / after directories, and an @ after symbolic links
  • ls -l Lists the files in long format —size, date, permissions.

cd

  • cd .. backs up one level; note the space after cd.
  • cd /usr/local goes there.
  • cd ~ goes to the home directory of the person logged in—e.g., /usr/home/jack. Try cd /cdrom, and then ls, to find out if your CDROM is mounted and working.

mv

to move a directory

# cd /home/vivek
# mv data/ /nas/home/vivek/archived/

cat filename

Displays filename on screen.

df

Shows file space and mounted systems.

ps aux

Shows processes running. ps ax is a narrower form.

chmod

Use chmod to alter the permissions of the folder, the general way to use chmod would be something like:

 chmod 700 Dropbox

This would emulate the permissions we have here, 7 is made up of 4 for read, 2 for write and 1 for execute (so 6 is read/write, 5 is read/execute etc etc), the other way sometimes used for scripts etc would be:

 chmod a+x foobar

This would set the execute bit (x) for all users (a), using “a-x” would remove the execute bit for all users.

chroot

Change root directory

In order to chroot a user to a directory the permissions on that directory all the way back to the mountpoint must be exactly as required by chroot. The default permissions are not correct. Use the following shell commands executed as root to fix this. I suggest the following as an example taken from the HOWTO I had posted on the FreeNAS forum some time ago. You can change it as you wish, however, if any of the permissions and ownerships are even slightly wrong IT WILL NOT WORK. The below assumes a user and group named sftp with the user sftp being the one who is being chrooted.

mkdir -p /mnt/disk1/chroot/sftp
chown -R root:wheel /mnt/disk1/chroot/sftp
chmod -R 755 /mnt/disk1/chroot/sftp
mkdir /mnt/disk1/chroot/sftp/sftp
chown sftp:sftp /mnt/disk1/chroot/sftp/sftp

http://forums.nas4free.org/viewtopic.php?f=18&t=1552

Users and groups

http://www.tutorialspoint.com/unix/unix-user-administration.htm

pts m

pts m

groups

id

FTP setup

http://wiki.nas4free.org/doku.php?id=documentation:setup_and_user_guide:ftp-file_transfer_protocol